ComfyUI Node
NB2 Smart Region
Fits a rectangular NB2 crop around a semantic region mask. Use this after a Florence/SAM-style selector when you want to keep the existing NB2 Crop and NB2 Stitch workflow.
NB2 Smart Region
- image
- region_mask
- mask
- nb2_width
- nb2_height
- preview_image
- center_x
- center_y
- crop_width
- crop_height
- info
◄aspect_ratioauto►
◄resolution2K►
◄padding_percent8.0►
◄crop_scale1.00►
◄depad_florencetrue►
◄region_info—►
Categoryinpaint/nb2
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| region_mask | MASK | — | |
| aspect_ratio | COMBO | auto | 4 options: auto, 16:9, 9:16, 1:1 |
| resolution | COMBO | 2K | 3 options: 1K, 2K, 4K |
| padding_percent | FLOAT | 8.00–100 | Expands the detected region before rectangle fitting. |
| crop_scale | FLOAT | 1.001–4 | Additional scale multiplier applied after aspect-ratio fitting. |
| depad_florence | BOOLEAN | true | Remove Florence2's internal square letterbox padding before resizing the mask. Keep True when the mask comes from Florence2Run (kijai). Disable only if your mask is already at the exact source image resolution. |
| region_infoopt | STRING | — |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |
| nb2_width | INT | — |
| nb2_height | INT | — |
| preview_image | IMAGE | — |
| center_x | INT | — |
| center_y | INT | — |
| crop_width | INT | — |
| crop_height | INT | — |
| info | STRING | — |