Nodes/ComfyUI Essentials/πŸ”§ Image Composite
ComfyUI Node Runs on cloud

πŸ”§ Image Composite

Image Composite β€” paste one image onto another, with a mask if you want

By cubiqΒ·Created 3 years agoΒ·Updated about a year agoΒ· 1,152
πŸ”§ Image Composite
  • destination
  • source
  • mask
  • IMAGE
β—„x0β–Ί
β—„y0β–Ί
β—„offset_x0β–Ί
β—„offset_y0β–Ί

Sometimes you just need to stick one picture on top of another at a specific spot. A logo in the corner, a generated subject onto a background, a cropped face back where it came from. Image Composite does that - it pastes a source image onto a destination image at coordinates you set, optionally through a mask so only part of the source shows.

It's the "layer on top" node, and it's more precise than most because it gives you both absolute placement and a separate offset.

What it does

You feed it two images and it returns one:

  • destination - the background, the thing you're pasting onto.
  • source - the thing being pasted.
  • x and y - where the source's anchor lands on the destination, in pixels from the top-left. These accept negatives, so you can push the source partway off the edge.
  • offset_x and offset_y - an additional nudge on top of x/y. Two placement controls sounds redundant, but it's handy: set x/y as the base position and use the offsets for fine adjustment (or drive the offsets from a slider/math node while keeping the base fixed).
  • mask (optional) - a MASK that controls which pixels of the source actually get composited. White shows the source, black keeps the destination. This is how you paste a cut-out subject without its rectangular bounding box coming along for the ride.

Output is a single composited IMAGE.

Where it fits

The obvious job is re-assembly. You cropped a region out (say, to inpaint a face at higher resolution), fixed it, and now you need to drop it back exactly where it was - Image Composite with the right x/y puts it home. Pair it with Mask Bounding Box from the same pack, which hands you the exact x/y/width/height of a region, and the round-trip crop β†’ edit β†’ paste-back becomes clean and repeatable.

The other job is plain compositing: subject onto background, watermark onto output, an overlay element positioned just so. With a mask feeding it, you get a proper alpha-style paste rather than a hard rectangle.

Installing it

Ships in ComfyUI Essentials by cubiq (Matteo Spinelli, the developer behind ComfyUI_IPAdapter_plus):

  • ComfyUI Manager: search "ComfyUI Essentials" β†’ Install β†’ restart.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/cubiq/ComfyUI_essentials, install requirements.txt, restart.

Recognise it by the πŸ”§ wrench and the + (ImageComposite+).

Gotchas

Placement is measured from the top-left corner, and the source's anchor is its top-left too - so x/y positions the corner of the source, not its center. If your paste lands lower-right of where you expected, that's why; subtract half the source's width/height from x/y to center it.

If you're compositing a cut-out and getting an ugly rectangle around it, you forgot the mask - or your mask has hard edges. Run the mask through Mask Fix with a few pixels of blur first for a soft, seamless join.

And the standing pack note: cubiq set Essentials to maintenance-only in April 2025. Composite still works fine, but if it errors after a major ComfyUI update, roll ComfyUI back or patch the file - no upstream fixes are coming. A red "missing node" means the pack failed to load; check your startup log and reinstall via Manager.

Categoryessentials/image manipulation

Inputs (7)

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

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”