ComfyUI Node

NB2 Crop

Crops the image to the mask region and scales to the exact Nano Banana 2 resolution. Set aspect_ratio and resolution to match NB2 Mask Generator. Pair with InpaintStitchNB2 after generation.

By amortegui84·Created 5 months ago·Updated 2 months ago· 3
NB2 Crop
  • image
  • mask
  • stitcher
  • cropped_image
  • cropped_mask
aspect_ratio16:9
resolution2K
context_extend_factor1.00
downscale_algorithmbilinear
upscale_algorithmbicubic
device_modegpu (much faster)
Categoryinpaint/nb2

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
aspect_ratioCOMBO16:9Must match the aspect_ratio set in NB2 Mask Generator.
resolutionCOMBO2KMust match the resolution set in NB2 Mask Generator.
context_extend_factorFLOAT1.001–4Grow the crop region by this factor in every direction before aspect-ratio adjustment. 1.0 = crop exactly the masked area.
downscale_algorithmCOMBObilinear6 options: nearest, bilinear, bicubic, lanczos, box, hamming
upscale_algorithmCOMBObicubic6 options: nearest, bilinear, bicubic, lanczos, box, hamming
device_modeCOMBOgpu (much faster)2 options: gpu (much faster), cpu (compatible)
maskoptMASK

Outputs (3)

NameTypeDescription
stitcherSTITCHER
cropped_imageIMAGE
cropped_maskMASK