Nodes/Umbra Nodes/Soft Inpaint Composite (Umbra UI)
ComfyUI Node

Soft Inpaint Composite (Umbra UI)

Soft Inpaint Composite — blend the fix in without ghosting the subject

By Nocturne-Ai-Labs·Created 2 months ago·Updated 10 days ago· 0
Soft Inpaint Composite (Umbra UI)
  • original
  • generated
  • mask
  • image
  • blend_mask
preservation0.50
transition_contrast2.00
mask_influence0.00

Masked inpainting has one classic tell: the replacement is pasted back with a hard, visible seam, or worse, the blend is so weak the original subject shows through underneath and you get two half-visible people. Soft Inpaint Composite (Umbra UI) exists to fix the seam without resurrecting the thing you removed. Its core promise, straight from the source: the painted mask interior is always the replacement at full opacity - only the feathered boundary blends. No ghosting where the mask is solid, ever.

How it works

You hand it the original image, the generated (inpainted) result, and the mask, and it does the paste-back math. The subtlety is in the boundary handling:

  • The opaque threshold. It computes a threshold from preservation (opaque_threshold = 0.35 + preservation * 0.40). Any mask pixel at or above that value becomes fully the generated image - solid mask = solid replacement, no ghosting, regardless of settings. The author's comment is blunt about why: earlier versions used image-difference strength as alpha across the whole mask, which left two partially-visible subjects in the saved result. This version refuses to do that.
  • The feathered edge. Only the gradient zone below the threshold blends, through a contrast-shaped smoothstep. transition_contrast (0.25–8, default 2) sharpens or softens that transition band - higher = a crisper seam between original and replacement, lower = a longer, softer fade. preservation (0–1, default 0.5) controls how much of the feather belongs to the source image.
  • mask_influence (0–1, default 0) blends between the smoothed edge and the raw mask - at 1.0 the composite trusts the mask's own alpha more than the smoothing.

It also handles the plumbing quietly: generated and mask get resized to the original's dimensions if they differ, and batch dimensions are matched (a single mask broadcasts across the batch).

Outputs: image (the composite) and blend_mask - the actual alpha it used, handy if you want to inspect or re-use the blend.

The inputs a beginner sets

Three to start: original, generated, mask. Then preservation is the feel knob - 0.5 means the replacement and the source split the feathered band about evenly; nudge it up if you want the source to dominate the transition, down if you want the replacement to. transition_contrast at its default of 2 is fine for most seams. Leave mask_influence at 0 until you have a specific reason to trust the mask over the smoothing.

Installing it

Part of Umbra-Nodes, the ComfyUI companion pack for Umbra Studio (NocturneLabs' open-source local AI suite). ComfyUI Manager → search "Umbra Nodes", or:

cd ComfyUI/custom_nodes
git clone https://github.com/Nocturne-Ai-Labs/Umbra-Nodes

Restart ComfyUI. No pip deps, no models - it's pure tensor math.

Gotchas

The mask is everything. If your mask is a fully hard-edged binary with no feather (no gradient), the "soft" composite degrades to a hard cut - the node can only smooth a boundary that has one, so feather the mask upstream or blur it before it arrives. And remember this node composites pixels; it doesn't fix a wrong inpaint - a replacement that doesn't match lighting or perspective will still look pasted, just without a visible cut line. Get the inpaint right, and this node makes the seam invisible; get it wrong, and the seam was never the problem.

CategoryUmbra UI/Inpaint

Inputs (6)

NameTypeDefaultDescription
originalIMAGE
generatedIMAGE
maskMASK
preservationFLOAT0.500–1
transition_contrastFLOAT2.000.25–8
mask_influenceFLOAT0.000–1

Outputs (2)

NameTypeDescription
imageIMAGE
blend_maskMASK