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.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | The 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_top | INT | 0-90–1000 | How 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_bottom | INT | 0-90–1000 | How 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_left | INT | 0-90–1000 | How 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_right | INT | 0-90–1000 | How 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)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |
| canvas_width | INT | — |
| canvas_height | INT | — |
| mask_width | INT | — |
| mask_height | INT | — |
| center_x | INT | — |
| center_y | INT | — |