Nodes/comfyui-superside-nodes/Superside Image Composite Masked
ComfyUI Node

Superside Image Composite Masked

The node that pastes things back — masked compositing for every region fix

By Superside·Created about a month ago·Updated 3 days ago· 1
Superside Image Composite Masked
  • destination
  • source
  • mask
  • IMAGE
x0
y0
resize_sourcefalse

Paste one image onto another, masked. That's the whole job, and it's the least glamorous but most load-bearing step in a huge share of real workflows - anything that processes a region and then has to put it back. This is the Superside in-house version of core ComfyUI's ImageCompositeMasked, meaning a workflow built entirely from this pack doesn't need core's node set for this operation. It behaves like the original because it's a faithful reimplementation of the same contract.

You'll recognize the shape of the job from any detailing or re-skin loop: detect a region, process it in isolation, then paste the result back over the original so the edit lands exactly where it should. The KB's masking doc calls that final step the "paste back" - this is that node. The Superside portrait workflow uses it in reverse, too: paste the original back over the parts of a retouched image you want left alone, with the protection mask controlling exactly where the original wins.

The inputs that matter

  • destination - the background image being pasted onto.
  • source - the image being pasted in.
  • mask (optional) - decides where the source shows through. White = source wins, black = destination stays. No mask means the whole source rectangle pastes.
  • x / y - the top-left position where the source lands on the destination. Ranges up to 16384, so they cover any canvas.
  • resize_source (default off) - if on, the source is scaled to match the destination before compositing. Handy when a generator returned a slightly different size than your crop, though you can also fix that upstream.

One output: the composited IMAGE.

How it works

Pure local tensor math - the source and mask get positioned at (x, y), the mask weights the blend per-pixel, and out comes the composite. No model, no network, no API key, and no fal credits. If resize_source is on, the source is resampled to the destination's dimensions first.

Installing it

Same story as every node in this pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Superside/comfyui-superside-nodes
pip install -r requirements.txt

Restart ComfyUI, and it's under Superside. Or install the whole pack via ComfyUI Manager by searching "comfyui-superside-nodes."

Where people get confused

The mask semantics trip people up once: in ComfyUI's convention for this node, white in the mask means "show the source here," which is the opposite of how some inpainting tools treat masks. If your paste comes out backwards (destination winning everywhere it shouldn't), flip the mask with an invert node and the behavior snaps into place. The other classic gotcha is resize_source being off while the source is bigger than the destination - the paste just clips at the edge. Position with x/y, resize deliberately, and the node is as predictable as compositing gets.

CategorySuperside

Inputs (6)

NameTypeDefaultDescription
destinationIMAGE
sourceIMAGE
xINT00–16384
yINT00–16384
resize_sourceBOOLEANfalse
maskoptMASK

Outputs (1)

NameTypeDescription
IMAGEIMAGE