ComfyUI Node
π― Crop To Mask (nhk)
Crop image+mask to mask bbox with uniform padding (great after SAM3)
π― Crop To Mask (nhk)
- image
- mask
- image
- mask
- x
- y
- width
- height
βpadding32βΊ
βmask_threshold0.50βΊ
βdivisible_by1βΊ
Categorynhk/image
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Image to crop (BHWC) | |
| mask | MASK | Mask defining the object bounding box | |
| padding | INT | 32-2048β4096 | Pixels added on all sides of the mask bbox. Negative values tighten the crop. |
| mask_thresholdopt | FLOAT | 0.500β1 | Pixels with mask value above this count as 'object' when computing the bbox |
| divisible_byopt | INT | 11β256 | Round the crop width/height up to a multiple of this value (e.g. 8, 16, 64). 1 = disabled. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| mask | MASK | β |
| x | INT | β |
| y | INT | β |
| width | INT | β |
| height | INT | β |