Nodes/BrushNet/Blend Inpaint
ComfyUI Node Runs on cloud

Blend Inpaint

The node that stops VAE round-trips from wrecking your image

By nullquant·Created 2 years ago·Updated about a year ago· 947
Blend Inpaint
  • inpaint
  • original
  • mask
  • origin
  • image
  • MASK
kernel10
sigma10.00

Here's the problem this node exists to fix, straight from the pack author: "Sometimes inference and VAE broke image, so you need to blend inpaint image with the original." Every time an image round-trips through a VAE encode/decode, you lose a little fidelity across the whole frame - not just the region you were inpainting. Run that a few times and areas you never touched start drifting in color and detail. Blend Inpaint pastes only the actually-inpainted pixels back onto your untouched original, so the rest of the image never pays that tax.

This is one of the oldest, most-repeated pieces of advice in the inpainting community - "please composite your image after inpainting" is close to a mantra at this point - and it's exactly why later tooling like ComfyUI-Inpaint-CropAndStitch built compositing in structurally instead of leaving it to the user to remember. Blend Inpaint is nullquant's own answer to the same problem, built into this pack specifically for BrushNet/PowerPaint workflows.

How it works

It takes your inpainted result and your original image, uses the mask to figure out which pixels actually changed, and composites just those back onto the original. A Gaussian blur softens the seam so the transition doesn't look pasted-on. If you cropped a region out first (with CutForInpaint) rather than working on the full image, an optional origin input tells Blend Inpaint exactly where that crop belongs, so it lands back in the right spot.

Inputs and outputs

  • inpaint - the result image coming out of your inpainting pass.
  • original - the untouched source image, pre-inpaint.
  • mask - the region that was actually regenerated.
  • kernel (default 10, range 1–1000) - the blur kernel size applied to the blend.
  • sigma (default 10, range 0.01–1000) - the Gaussian blur strength. Same tradeoff as any mask-feathering setting: too tight and you get a visible seam, too soft and the blend bleeds into surrounding detail that should've stayed sharp.
  • origin (optional, VECTOR) - only needed if you're feeding in a cropped region from CutForInpaint; it tells this node where that crop sits within the full-size image.

Outputs are image (the blended composite) and MASK (the blended mask used for the composite).

Installing it

Comes with the pack - ComfyUI Manager search "BrushNet," or manually cd ComfyUI/custom_nodes && git clone https://github.com/nullquant/ComfyUI-BrushNet && pip install -r requirements.txt, then restart. No separate model download needed for this node specifically - it's pure image math, not a network.

Common issues

Wiring original wrong. This has to be the pre-inpaint source image, not a second copy of whatever BrushNet output. If you feed it the inpainted result twice, there's nothing to blend against and you'll just get your inpaint back unchanged.

Forgetting origin when chaining with CutForInpaint. If you cropped a small region out of a bigger image to inpaint it (the pack's "big image" workflow), leaving origin unwired means Blend Inpaint has no way to know where that crop goes - wire CutForInpaint's origin output straight into this node's origin input.

Kernel/sigma too aggressive or too weak. If you're still seeing a hard edge around the inpainted region, bump sigma up before touching anything else. If detail near the mask boundary looks smeared or soft when it shouldn't, that's the blur reaching too far - bring kernel and sigma back down.

Categoryinpaint

Inputs (6)

NameTypeDefaultDescription
inpaintIMAGE
originalIMAGE
maskMASK
kernelINT101–1000
sigmaFLOAT10.000.01–1000
originoptVECTOR

Outputs (2)

NameTypeDescription
imageIMAGE
MASKMASK