Visit ComfyUI Online for ready-to-use ComfyUI environment
Identifies and extracts mask bounding box for precise image editing and manipulation.
The Mask Bounding Box node is designed to identify and extract the bounding box of a mask within an image. This node is particularly useful for AI artists who need to isolate specific regions of an image based on a mask, allowing for more precise editing and manipulation. By computing the bounding box, the node helps in determining the smallest rectangle that can encompass all the non-zero pixels of the mask, which is essential for tasks like cropping, resizing, or focusing on particular areas of an image. The node ensures that the bounding box meets minimum width and height requirements, making it versatile for various applications.
This parameter represents the mask from which the bounding box will be computed. The mask is typically a binary or grayscale image where the regions of interest are highlighted with non-zero values. The node will analyze this mask to determine the bounding box.
This parameter sets the minimum width of the bounding box. If the computed bounding box is narrower than this value, the node will adjust the width to meet this minimum requirement. This ensures that the bounding box is not too small for practical use. The default value is not specified in the context, but it should be set according to the specific needs of your project.
This parameter sets the minimum height of the bounding box. Similar to min_width
, if the computed bounding box is shorter than this value, the node will adjust the height to meet this minimum requirement. This ensures that the bounding box is sufficiently tall for practical use. The default value is not specified in the context, but it should be set according to the specific needs of your project.
This parameter represents the image that corresponds to the mask. The node uses this image to extract the region defined by the bounding box, allowing you to work with both the mask and the corresponding image area.
This parameter defines the threshold value for determining which pixels in the mask are considered part of the region of interest. Pixels with values above this threshold are included in the bounding box computation. The default value is not specified in the context, but it should be set according to the specific needs of your project.
This output parameter represents the minimum x-coordinate of the bounding box. It indicates the leftmost boundary of the bounding box within the mask.
This output parameter represents the maximum x-coordinate of the bounding box. It indicates the rightmost boundary of the bounding box within the mask.
This output parameter represents the minimum y-coordinate of the bounding box. It indicates the topmost boundary of the bounding box within the mask.
This output parameter represents the maximum y-coordinate of the bounding box. It indicates the bottommost boundary of the bounding box within the mask.
This output parameter represents the width of the bounding box. It is calculated as the difference between max_x
and min_x
.
This output parameter represents the height of the bounding box. It is calculated as the difference between max_y
and min_y
.
This output parameter is the raw bounded mask extracted from the original mask based on the computed bounding box. It allows you to work with the specific region of the mask that is of interest.
This output parameter is the raw image region corresponding to the bounding box. It allows you to work with the specific region of the image that is of interest.
threshold
parameter is set appropriately to accurately capture the regions of interest in the mask. A higher threshold may exclude important areas, while a lower threshold may include unwanted regions.min_width
and min_height
parameters to ensure that the bounding box is of a practical size for your specific application. This is particularly useful when working with small or detailed regions in the mask.raw_bb
and raw_img
outputs to focus your image processing tasks on the specific regions of interest, improving efficiency and precision.min_width
and min_height
parameters to appropriate values that match the expected size of the regions of interest in the mask.© Copyright 2024 RunComfy. All Rights Reserved.