Nodes/ComfyUI-QG-tools/Mask Analysis
ComfyUI Node

Mask Analysis

Measure the non-zero bounding box of a mask, grow or shrink each of its four sides by a percentage, and paint that rectangle solid white. Positive values grow outward, negative values pull inward (the shrink guard matches the original Mask Analysis node, so the same numbers can be pasted between them). Pixels count as painted at >= 0.5, a batch uses the combined extent of every frame, and the node also returns the canvas size, the rectangle size and the rectangle centre.

By live1617·Created about a month ago·Updated a day ago· 4
Mask Analysis
  • mask
  • mask
  • canvas_width
  • canvas_height
  • mask_width
  • mask_height
  • center_x
  • center_y
◄expand_top0►
◄expand_bottom0►
◄expand_left0►
◄expand_right0►
CategoryQG-tools/Mask

Inputs (5)

NameTypeDefaultDescription
maskMASKThe mask to measure. Pixels count as painted at >= 0.5; a batch uses the combined non-zero extent of every frame and keeps every frame in the output.
expand_topINT0-90–1000How far the top edge grows outward, as a percentage of the mask height. Negative values pull it inward; when the two sides together shrink too much they are scaled down, exactly like the original Mask Analysis node, so the same numbers work in both.
expand_bottomINT0-90–1000How far the bottom edge grows outward, as a percentage of the mask height. Negative values pull it inward; when the two sides together shrink too much they are scaled down, exactly like the original Mask Analysis node, so the same numbers work in both.
expand_leftINT0-90–1000How far the left edge grows outward, as a percentage of the mask width. Negative values pull it inward; when the two sides together shrink too much they are scaled down, exactly like the original Mask Analysis node, so the same numbers work in both.
expand_rightINT0-90–1000How far the right edge grows outward, as a percentage of the mask width. Negative values pull it inward; when the two sides together shrink too much they are scaled down, exactly like the original Mask Analysis node, so the same numbers work in both.

Outputs (7)

NameTypeDescription
maskMASK—
canvas_widthINT—
canvas_heightINT—
mask_widthINT—
mask_heightINT—
center_xINT—
center_yINT—