Nodes/Eden.art nodesuite/Eden_ImageMaskComposite
ComfyUI Node Runs on cloud

Eden_ImageMaskComposite

Paste one image onto another, mask and all β€” the compositor behind face swaps and region swaps

By edenartlabΒ·Created 3 years agoΒ·Updated 6 months agoΒ· 119
Eden_ImageMaskComposite
  • destination
  • source
  • mask
  • IMAGE
β—„x0β–Ί
β—„y0β–Ί
β—„offset_x0β–Ί
β—„offset_y0β–Ί

Eden_ImageMaskComposite is the node you reach for when you've rendered something in isolation - a face, a hand, an object - and need to plant it back onto a larger image at a specific spot. Paste with position control, optional masking, and the ability to nudge the whole thing around without rewiring anything.

How it works

You give it a destination (the background) and a source (the thing to paste). x and y place the source's top-left corner onto the destination, and offset_x/offset_y add a nudge on top of that - handy when you want to reposition a batch of composites without touching the base coordinates. The optional mask is applied to the source before compositing, so you can paste a source whose edges feather into the background instead of slicing in with a hard rectangle. No mask means a plain opaque paste.

Behind the scenes it's a lot of careful tensor housekeeping: the node normalizes masks in several formats (2D, 3D, [H,W,C] vs [B,H,W] - it detects and reshapes), resizes the mask to the source, matches batch sizes, then splices the source into the destination for each frame in the batch.

Inputs that matter

  • destination (IMAGE) - the background canvas.
  • source (IMAGE) - what gets pasted.
  • x / y (default 0, βˆ’8192 to 8192) - placement of the source's top-left corner.
  • offset_x / offset_y (default 0) - additional shift applied on top of x/y.
  • mask (MASK, optional) - feathered paste, or you can use a mask to only paste part of the source.

Output is a single IMAGE: the composited result.

Where it fits

This is the "put it back" half of a crop-and-paste loop - the kind of thing the mask pipeline in ComfyUI revolves around when you're doing regional fixes at high resolution (render a region big, composite it back). In the Eden pack it lives under face because it's the standard sink for face-render pipelines: generate a fresh face, mask it, paste it back onto the original portrait. The offset inputs matter there - they let you fine-tune alignment without re-running the generation that produced the source.

Installing it

Part of the Eden.art nodesuite. Install via ComfyUI Manager (search "Eden.art nodesuite") or:

cd ComfyUI/custom_nodes
git clone https://github.com/edenartlab/eden_comfy_pipelines
cd eden_comfy_pipelines && pip install -r requirements.txt

Restart ComfyUI. The pack's requirements are heavy (transformers, scikit-image, opencv-python, the CLIP interrogator stack), so give the install a minute.

Common issues

Watch batch sizes and shapes. The node prints diagnostic info to your ComfyUI console (source shape, mask shape, per-batch shapes) - if the composite looks wrong, that log is where the answer is. A mask with a hard edge pastes with a hard edge; blur it before it reaches this node if you want soft seams. And x/y place the source corner, so negative coordinates are valid and will crop the source against the destination's edge rather than erroring.

CategoryEden 🌱/face

Inputs (7)

NameTypeDefaultDescription
destinationIMAGEβ€”
sourceIMAGEβ€”
xINT0-8192–8192β€”
yINT0-8192–8192β€”
offset_xINT0-8192–8192β€”
offset_yINT0-8192–8192β€”
maskoptMASKβ€”

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”