ComfyUI Node
RulZ Mask Intelligent Crop
Crop an image and/or mask to the mask's bounding box, extended on every side by a percentage of the crop, mask or image size: one value for all sides or one per edge. Both inputs are optional.
RulZ Mask Intelligent Crop
- image
- mask
- image
- mask
◄padding_modeuniform►
◄padding_percent10.0►
◄padding_top10.0►
◄padding_bottom10.0►
◄padding_left10.0►
◄padding_right10.0►
◄padding_referencecrop►
◄aspect_limit2:3 / 3:2►
◄divisible_by1►
◄mask_threshold0.00►
CategoryRulZnodes
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| padding_mode | COMBO | uniform | uniform: padding_percent is used on every side. per_edge: padding_top, padding_bottom, padding_left and padding_right set each side separately. |
| padding_percent | FLOAT | 10.00–100 | uniform mode: how far each side extends beyond the masked area, as a percentage of the padding_reference size (width for left/right, height for top/bottom). |
| padding_top | FLOAT | 10.00–100 | per_edge mode: how far the top side extends beyond the masked area, as a percentage of the padding_reference height. |
| padding_bottom | FLOAT | 10.00–100 | per_edge mode: how far the bottom side extends beyond the masked area, as a percentage of the padding_reference height. |
| padding_left | FLOAT | 10.00–100 | per_edge mode: how far the left side extends beyond the masked area, as a percentage of the padding_reference width. |
| padding_right | FLOAT | 10.00–100 | per_edge mode: how far the right side extends beyond the masked area, as a percentage of the padding_reference width. |
| padding_reference | COMBO | crop | crop: percentage of the final cropped image, so the subject sits inside a border of that size. mask: percentage of the mask bounding box. image: percentage of the full input image. |
| aspect_limit | COMBO | 2:3 / 3:2 | Never crop more elongated than this ratio. A crop that would be taller than 2:3 is widened, one wider than 3:2 is heightened. The crop is only ever grown, never shrunk. |
| divisible_by | INT | 11–1024 | Grow the crop so its width and height are multiples of this value. 1 disables it. |
| mask_threshold | FLOAT | 0.000–1 | Mask pixels above this value count as masked. |
| imageopt | IMAGE | — | |
| maskopt | MASK | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |