ComfyUI-KJNodes
Run ComfyUI Easily with InstaSD
Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:
- One-click deployment
- Any model, any node
- Powerful GPUs for rapid iteration
Available Nodes
GetMaskSizeAndCount
Get Mask Size & Count Node Documentation
Overview
The Get Mask Size & Count node in the ComfyUI-KJNodes package provides essential information about a given mask by identifying its dimensions and batch size. This node is particularly useful in workflows where understanding the properties of a mask is crucial for subsequent image processing tasks.
Functionality
The Get Mask Size & Count node performs the following operations:
-
Determines the Size of the Mask:
- Calculates and returns the width and height of the input mask.
-
Counts the Number of Masks in the Batch:
- Returns the total number of individual masks contained within the input batch.
-
Outputs the Unchanged Mask:
- Passes the original mask through without modifying it, enabling further use in the workflow.
Inputs
The node accepts the following input:
- Mask: This is the primary input and must be of type "MASK". The mask input can be a single mask or a batch of masks.
Outputs
The Get Mask Size & Count node produces the following outputs:
-
Mask: The same mask input provided to the node is passed through without alteration. This allows for integration with other nodes in the workflow.
-
Width: An integer value representing the width of the mask.
-
Height: An integer value representing the height of the mask.
-
Count: An integer value indicating the number of masks present in the batch.
Usage in ComfyUI Workflows
This node is primarily used to extract metadata from mask inputs in image processing workflows. It provides information about the dimensions and batch size of the masks, which can be crucial for subsequent operations, such as resizing, cropping, or combining masks. Users can incorporate this node in their workflows when they need to:
- Verify the dimensions of a mask before further processing.
- Confirm the number of masks in a batch to ensure they match expected inputs for downstream nodes.
Special Features and Considerations
- Transparency: The
Get Mask Size & Countnode passes through the mask without changes, making it a non-intrusive tool in workflows. - User Interface: The node may display additional information about the output dimensions right in the user interface, offering a convenient way to verify mask properties visually.
- Batch Processing: Handles both single masks and batches efficiently, making it versatile for a range of use cases.
This node facilitates improved decision-making in multistage image processing by providing essential mask property data without modifying the original input.