Visit ComfyUI Online for ready-to-use ComfyUI environment
Sophisticated node for cropping images based on masks, ensuring consistent aspect ratio and size in batch processing for AI art.
BatchCropFromMaskAdvanced is a sophisticated node designed to crop multiple images based on their corresponding masks. This node is particularly useful for AI artists who need to isolate specific regions of interest within a batch of images, ensuring that the cropped areas are consistent and optimized for further processing. By calculating the maximum bounding box size across all masks and applying a smoothing function, this node ensures that the cropped regions maintain a consistent aspect ratio and size, which is crucial for tasks that require uniformity. The node also allows for the application of a crop size multiplier, giving you control over the final dimensions of the cropped images. This advanced functionality makes BatchCropFromMaskAdvanced an essential tool for batch processing in AI art projects, where precision and consistency are key.
This parameter represents the collection of masks that will be used to determine the regions to be cropped from the original images. Each mask should correspond to an image in the original_images
parameter. The masks are used to identify the non-zero regions, which define the bounding boxes for cropping.
This parameter is the collection of original images from which the regions defined by the masks will be cropped. Each image should correspond to a mask in the masks
parameter. The images are processed in conjunction with the masks to produce the final cropped outputs.
This parameter is a multiplier that adjusts the size of the bounding boxes used for cropping. By applying this multiplier, you can control the final dimensions of the cropped images. The default value is typically 1, but you can increase or decrease it to get larger or smaller cropped regions, respectively.
This parameter is used to smooth the changes in the bounding box size across the batch of masks. It helps in maintaining a consistent size for the bounding boxes, which is important for ensuring uniformity in the cropped images. The value of bbox_smooth_alpha
typically ranges from 0 to 1, where a higher value results in smoother transitions.
This output parameter contains the collection of images that have been cropped based on the regions defined by the masks. Each cropped image corresponds to an original image and its mask, and the dimensions are adjusted according to the crop_size_mult
and bbox_smooth_alpha
parameters.
This output parameter provides the bounding boxes used for cropping each image. These bounding boxes are calculated based on the non-zero regions in the masks and are adjusted for size and aspect ratio consistency. This information can be useful for further processing or analysis of the cropped regions.
masks
parameter corresponds to an image in the original_images
parameter to avoid mismatches.crop_size_mult
parameter to control the size of the cropped regions. Increasing the multiplier will result in larger cropped areas, while decreasing it will produce smaller regions.bbox_smooth_alpha
parameter to achieve smoother transitions in bounding box sizes across the batch. A higher value will result in more consistent sizes, which is useful for maintaining uniformity in the cropped images.masks
and original_images
parameters contain the same number of elements.crop_size_mult
parameter is set to an invalid value, such as a negative number.crop_size_mult
parameter to a positive value to ensure valid cropping dimensions.bbox_smooth_alpha
parameter is set within the appropriate range.© Copyright 2024 RunComfy. All Rights Reserved.