ComfyUI > Nodes > ComfyUI 1hewNodes > Int Mask Side Length

ComfyUI Node: Int Mask Side Length

Class Name

1hew_IntMaskSideLength

Category
1hewNodes/int
Author
1hew (Account age: 1113days)
Extension
ComfyUI 1hewNodes
Latest Updated
2026-04-17
Github Stars
0.03K

How to Install ComfyUI 1hewNodes

Install this extension via the ComfyUI Manager by searching for ComfyUI 1hewNodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI 1hewNodes in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Int Mask Side Length Description

Analyzes masks to determine dimensions like longest, shortest side, width, or height.

Int Mask Side Length:

The 1hew_IntMaskSideLength node is designed to analyze a given mask and determine a specific dimension based on the selected mode. This node is particularly useful for AI artists who need to extract dimensional information from masks, which are often used in image processing and manipulation tasks. By providing a straightforward way to calculate either the longest or shortest side, or specifically the width or height of a mask, this node simplifies the process of obtaining these measurements, which can be crucial for further image processing or analysis. The node's ability to handle different modes of measurement makes it versatile and adaptable to various artistic and technical needs.

Int Mask Side Length Input Parameters:

mask

The mask parameter is a tensor input that represents the mask from which you want to extract dimensional information. This mask is typically a two-dimensional array, where each element indicates whether a particular pixel is part of the mask. The mask serves as the primary data source for the node's calculations, and its dimensions directly influence the output. There are no specific minimum or maximum values for this parameter, but it should be a valid tensor with at least two dimensions.

mode

The mode parameter determines the method used to calculate the side length from the mask. It offers four options: "longest," "shortest," "width," and "height." The default mode is "shortest." Selecting "longest" will return the length of the longer side of the mask, while "shortest" will return the length of the shorter side. Choosing "width" or "height" will return the respective dimension of the mask. This parameter allows you to tailor the node's output to your specific needs, whether you are interested in a particular dimension or a relative measurement.

Int Mask Side Length Output Parameters:

int

The int output parameter provides the calculated side length based on the selected mode. This integer value represents the dimension of interest from the mask, such as the width, height, longest side, or shortest side. The output is crucial for tasks that require precise dimensional information, enabling you to make informed decisions in subsequent processing steps. The value is presented in a user-friendly format, ensuring that you can easily interpret and utilize the information in your creative workflows.

Int Mask Side Length Usage Tips:

  • To ensure accurate results, always verify that the input mask is a valid tensor with at least two dimensions before using this node.
  • Experiment with different modes to understand how each one affects the output, especially if you are unsure which dimension is most relevant to your task.

Int Mask Side Length Common Errors and Solutions:

Invalid mask tensor

  • Explanation: This error occurs when the input mask is not a valid tensor or does not have the required dimensions.
  • Solution: Ensure that the mask is a properly formatted tensor with at least two dimensions before passing it to the node.

Unsupported mode selection

  • Explanation: This error happens if an invalid mode is selected, which is not among the predefined options.
  • Solution: Double-check the mode parameter to ensure it is set to one of the following: "longest," "shortest," "width," or "height."

Int Mask Side Length Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI 1hewNodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Int Mask Side Length