ComfyUI Node

NB2 Add Alpha

NB2 Add Alpha — one trick for softer Nano Banana seams

By amortegui84·Created 5 months ago·Updated 3 months ago· 3
NB2 Add Alpha
  • image
  • rgba_image
feather_percent5.0

This is the pack's smallest node and it does exactly one thing: take an RGB image and add a feathered alpha channel, turning it into RGBA. That's it. One input, one output, and no reason to reach for it unless you know why a soft alpha helps.

The why is the stitch. NB2 Stitch composites the Nano Banana output back onto the original, and it has a clever bit of behavior: if the generated image arrives with an alpha channel, that alpha is used as an additional blend mask on top of the edge feathering. So if you want the composite boundary softer than edge_feather_percent alone gives you, you can pre-compute a smooth alpha on the NB2 output with this node and let the stitch respect it.

Think of it as feathering, done twice: once in the alpha, once at the stitch edge. The default feather_percent of 5 fades the outer 5% of the image in each direction (a smoothstep, matching the stitch's own feather math). Crank it to 50 and the fade reaches the center. Set 0 and you get a hard-edged alpha, which is usually not what you want for a seamless paste.

Inputs and outputs

  • image - RGB or RGBA input. If it already has alpha, the node regenerates/overwrites it with the feathered one, so feeding in a ragged-alpha image is a way to clean it up.
  • feather_percent (0–50, default 5) - width of the edge fade as a percentage of image size.

Output is a single rgba_image, which you'd wire into NB2 Stitch's inpainted_image between the edit node and the composite.

Where it fits

Nano Banana 2 Edit -> NB2 Add Alpha -> NB2 Stitch

Honestly, for most jobs the default edge feather on NB2 Stitch is enough and you can skip this node entirely. Where it earns its place: edits that come back from the model with slightly misaligned content at the border, where a soft alpha hides the transition better than a percentage-based edge fade can. It's also handy if you're pulling the generated crop out of the roundtrip for compositing elsewhere and want a ready-to-use RGBA PNG.

Install

Same pack, same drill:

cd ComfyUI/custom_nodes
git clone https://github.com/amortegui84/comfyui-inpaint-cropstitch-nb2

or search comfyui-inpaint-cropstitch-nb2 in ComfyUI Manager, then restart. Local computation, no API key, no models. If you never use it, no harm - it's there for the edge case, not the daily driver.

Categoryinpaint/nb2

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
feather_percentFLOAT5.00–50Width of the edge fade as %% of image size. 0 = hard edges, 50 = fully fades to centre.

Outputs (1)

NameTypeDescription
rgba_imageIMAGE