Visit ComfyUI Online for ready-to-use ComfyUI environment
Extract specific image regions based on masks, resize output, batch processing, complex editing.
The Cut By Mask node is designed to extract specific regions from an image based on a provided mask. This node is particularly useful for isolating parts of an image that match a certain criteria defined by the mask. By cutting the image to the bounding box of the mask, you can focus on the areas of interest and discard the rest. Additionally, the node offers the flexibility to resize the extracted region to specified dimensions, ensuring that the output fits your desired size. This can be especially beneficial when working with images that need to be processed in a batch or when preparing images for further manipulation. The optional mask mapping feature allows for cutting multiple pieces from a single image, making it a powerful tool for batch processing and complex image editing tasks.
This parameter represents the input image from which regions will be extracted. The image should be in a format that the node can process, typically a tensor or an array representing pixel values.
The mask parameter is an image that defines the regions to be extracted from the input image. The mask should have the same dimensions as the input image, with non-zero values indicating the areas of interest.
This integer parameter specifies the width to which the extracted region should be resized. If set to 0, the width will not be resized. The default value is 0, with a minimum value of 0 and a maximum value defined by VERY_BIG_SIZE
.
This integer parameter specifies the height to which the extracted region should be resized. If set to 0, the height will not be resized. The default value is 0, with a minimum value of 0 and a maximum value defined by VERY_BIG_SIZE
.
This optional parameter allows for the inclusion of a mask mapping, which can be provided from a Separate Mask Components
node. This enables the cutting of multiple pieces from a single image in a batch, facilitating more complex image processing workflows.
The output is an image that contains the region(s) extracted from the input image based on the provided mask. If resizing parameters are specified, the output image will be resized accordingly. This output is useful for isolating and focusing on specific parts of the original image for further processing or analysis.
force_resize_width
and force_resize_height
parameters to standardize the size of the extracted regions, especially when preparing images for a uniform output format.mask_mapping_optional
parameter in conjunction with the Separate Mask Components
node to efficiently process and extract all desired regions in one go.force_resize_width
or force_resize_height
parameters are set to values outside the acceptable range.VERY_BIG_SIZE
) and adjust them accordingly.mask_mapping_optional
parameter is expected but not provided.Separate Mask Components
node. If not needed, you can ignore this parameter.© Copyright 2024 RunComfy. All Rights Reserved.