ComfyUI Node
NB2 Mask Generator
Creates a positioned rectangle mask matching Nano Banana 2 aspect ratios. Connect mask → InpaintCropNB2, nb2_width/nb2_height → NB2 Crop inputs, and preview_image → any Preview Image node to see the crop position annotated on the original.
NB2 Mask Generator
- image
- mask
- nb2_width
- nb2_height
- preview_image
◄aspect_ratio16:9►
◄resolution2K►
◄center_x512►
◄center_y512►
◄crop_width960►
Categoryinpaint/nb2
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| aspect_ratio | COMBO | 16:9 | 3 options: 16:9, 9:16, 1:1 |
| resolution | COMBO | 2K | 3 options: 1K, 2K, 4K |
| center_x | INT | 5120–16384 | Horizontal centre of the crop rectangle in pixels. |
| center_y | INT | 5120–16384 | Vertical centre of the crop rectangle in pixels. |
| crop_width | INT | 96064–16384 | Width of the crop region on the original image in pixels. Height is auto-calculated from the aspect ratio. Clamped if larger than the image. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |
| nb2_width | INT | — |
| nb2_height | INT | — |
| preview_image | IMAGE | — |