Eden_ImageMaskComposite
Paste one image onto another, mask and all β the compositor behind face swaps and region swaps
- destination
- source
- mask
- IMAGE
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.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| destination | IMAGE | β | |
| source | IMAGE | β | |
| x | INT | 0-8192β8192 | β |
| y | INT | 0-8192β8192 | β |
| offset_x | INT | 0-8192β8192 | β |
| offset_y | INT | 0-8192β8192 | β |
| maskopt | MASK | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |