Visit ComfyUI Online for ready-to-use ComfyUI environment
Facilitates image cropping based on masks for AI artists, identifying non-zero regions to crop precisely and efficiently.
The easy imageCropFromMask
node is designed to facilitate the cropping of images based on a provided mask. This node is particularly useful for AI artists who need to isolate specific regions of an image for further processing or analysis. By leveraging the mask, the node identifies the non-zero regions and calculates the bounding box to crop the image accordingly. This ensures that only the relevant parts of the image are retained, making it easier to focus on specific details or features. The node also includes options to smooth the bounding box size and apply a crop size multiplier, providing flexibility and control over the cropping process. Overall, this node simplifies the task of image cropping, making it more efficient and precise.
This parameter represents the input image that you want to crop. The image should be in a format that the node can process, typically a tensor with dimensions [B, H, W, C], where B is the batch size, H is the height, W is the width, and C is the number of channels.
The mask parameter is a binary mask that indicates the regions of the image to be retained. The mask should have the same height and width as the input image and can be used to identify the non-zero regions that define the bounding box for cropping.
This parameter is a floating-point value that acts as a multiplier for the crop size. It allows you to adjust the size of the cropped region by scaling the bounding box dimensions. The default value is 1.0, with a minimum of 0.0 and a maximum of 10.0. Adjusting this value can help include more or less of the surrounding area in the cropped image.
Similar to image_crop_mult
, this parameter is a floating-point value that scales the size of the cropped region based on the mask. The default value is 1.0, with a minimum of 0.0 and a maximum of 10.0. This parameter provides additional control over the cropping process by allowing you to fine-tune the mask's influence on the crop size.
This parameter is a floating-point value that controls the smoothing of the bounding box size across multiple frames or images. The default value is 1.0, with a minimum of 0.0 and a maximum of 1.0. A higher value results in smoother transitions in the bounding box size, which can be useful for maintaining consistency in the cropped regions across a sequence of images.
This output parameter represents the cropped image based on the provided mask and input parameters. The cropped image retains only the relevant regions as defined by the mask, making it easier to focus on specific details or features.
The crop_mask
output is the corresponding mask for the cropped image. It indicates the regions of the cropped image that were retained based on the original mask, providing a clear reference for further processing or analysis.
The bbox
output parameter provides the bounding box coordinates used for cropping the image. This includes the x and y coordinates, as well as the width and height of the bounding box. These coordinates can be useful for understanding the exact region of the image that was cropped.
image_crop_mult
and mask_crop_multi
parameters to fine-tune the size of the cropped region based on your specific needs.bbox_smooth_alpha
parameter to ensure smooth transitions in the bounding box size when processing a sequence of images.image_crop_mult
or mask_crop_multi
parameter is set to a value outside the allowed range (0.0 to 10.0).image_crop_mult
and mask_crop_multi
parameters to be within the valid range.bbox_smooth_alpha
parameter is set to a value outside the allowed range (0.0 to 1.0).bbox_smooth_alpha
parameter to a value within the valid range to ensure proper smoothing of the bounding box size.© Copyright 2024 RunComfy. All Rights Reserved.