Visit ComfyUI Online for ready-to-use ComfyUI environment
Isolate and focus on specific mask regions with optional padding for enhanced precision in image processing tasks.
The Mask Crop Region node is designed to help you isolate and focus on specific regions within a mask, either the dominant or minority regions, with optional padding. This node is particularly useful for AI artists who need to refine their masks by cropping out unnecessary areas and concentrating on the most significant parts of the mask. By providing a streamlined way to crop masks, this node enhances the precision and quality of your image processing tasks, making it easier to work with complex masks and ensuring that the most relevant regions are highlighted and preserved.
This parameter represents the input mask that you want to crop. The mask should be provided in a format that the node can process, typically as a tensor. The mask is the primary input that determines the region to be cropped based on the specified criteria.
This parameter allows you to add extra space around the cropped region. The padding value is an integer that specifies the number of pixels to add around the cropped area. The default value is 24, with a minimum of 0 and a maximum of 4096. Increasing the padding can help ensure that the cropped region includes some surrounding context, which can be useful for certain image processing tasks.
This parameter specifies the type of region to crop from the mask. You can choose between "dominant" and "minority" regions. The "dominant" region refers to the largest connected component in the mask, while the "minority" region refers to the smallest connected component. This choice allows you to focus on either the most significant or the least significant part of the mask, depending on your needs.
This output parameter provides the cropped mask based on the specified region type and padding. The cropped mask is returned as a tensor, which can be used in subsequent image processing steps.
This output parameter contains metadata about the cropped region, including the size of the cropped mask and the coordinates of the cropping box. This information can be useful for understanding the dimensions and position of the cropped area within the original mask.
This output parameter represents the top coordinate of the cropping box. It indicates the vertical position of the top edge of the cropped region within the original mask.
This output parameter represents the left coordinate of the cropping box. It indicates the horizontal position of the left edge of the cropped region within the original mask.
This output parameter represents the right coordinate of the cropping box. It indicates the horizontal position of the right edge of the cropped region within the original mask.
This output parameter represents the bottom coordinate of the cropping box. It indicates the vertical position of the bottom edge of the cropped region within the original mask.
This output parameter provides the width of the cropped region. It indicates the horizontal size of the cropped area in pixels.
This output parameter provides the height of the cropped region. It indicates the vertical size of the cropped area in pixels.
region_type
parameter to "dominant". This will crop the largest connected component in the mask.padding
parameter. This can help ensure that important details near the edges of the region are not lost.crop_data
output to understand the dimensions and position of the cropped region, which can be useful for aligning the cropped mask with other image elements.region_type
parameter is set to an unrecognized value.region_type
parameter to either "dominant" or "minority".© Copyright 2024 RunComfy. All Rights Reserved.