Nodes/ComfyUI_BadgerTools/ImageOverlap-badger
ComfyUI Node

ImageOverlap-badger

Paste one image on top of another at exact coordinates — the pack's flagship

By AbyssBadger0·Created 3 years ago·Updated 2 years ago· 8
ImageOverlap-badger
  • base_image
  • additional_image
  • IMAGE
x0
y0

The pack author's README is two lines long, and the first line is this node: 图片覆盖 - "image overlay." ImageOverlap-badger is the feature this pack was built around. It takes a base image, takes a second image, and pastes the second one onto the first at exact X/Y coordinates. That's the whole thing, and it's the exact compositing primitive that half of image-editing workflows are secretly made of.

Think about the crop-and-stitch pattern from inpainting: you crop a region, regenerate it at full detail, and paste it back. CropImageByMask-badger gives you the crop and the coordinates; this node is the paste-back half. Watermarks, logos, stickers, an inpainted patch, a composited element - anything that goes on top of something else at a known position uses this move. And because it takes plain IMAGE inputs, you can chain any generation output in as the overlay.

How it works

Pillow's paste(), with the overlay placed at (x, y) on the base. The base's size wins - the output is exactly as big as the base image, and the overlay is drawn onto it. Two details worth knowing:

  • The overlay pastes opaquely unless it has an alpha channel and you use the alpha. The code's paste is the plain version - it does not use the overlay's alpha as a mask. So a fully opaque overlay will cover what's underneath with a hard rectangle. If you want a soft blend, give the overlay real transparency first (e.g. with ApplyMaskToImage-badger) - a transparent PNG will paste with its transparency intact because PIL respects the alpha already in the image data.
  • No clamping. Paste pastes; if the overlay would run past the edge, the overflow just gets clipped. Coordinates beyond the base are accepted, they just mean "mostly off-canvas."

Inputs and outputs

  • base_image - what everything gets pasted onto.
  • additional_image - what gets pasted on top.
  • x - INT, horizontal position of the overlay's top-left corner, default 0, min 0.
  • y - INT, vertical position, default 0.

One output: the combined IMAGE, sized to the base.

Installing it

In ComfyUI_BadgerTools: ComfyUI Manager → search "BadgerTools" → install, or

cd ComfyUI/custom_nodes
git clone https://github.com/AbyssYuan0/ComfyUI_BadgerTools

Restart after install. No models - pure Pillow. (The pack's heavy requirements install and import at startup regardless; the usual tax.)

Gotchas

  • Coordinates start at 0,0 (top-left), and negative positions aren't allowed per the schema - if you need to nudge something off the top-left edge, that's not this node's move.
  • The 4096 coordinate ceiling matches the schema's max - fine for any normal canvas, but know it's there.
  • Hard edges are the default. If your overlay is a cutout you made with a mask, it'll blend beautifully because it carries alpha. If it's a raw generated image, you'll get a hard rectangle - that's paste working as designed, not a bug.

There's no community lore for this node - the pack is a personal utility drawer. But the author led the README with it for a reason: image-on-image compositing is the most reusable primitive in this pack, and it's the one you'll actually reach for in a composite-heavy workflow.

Categorybadger

Inputs (4)

NameTypeDefaultDescription
base_imageIMAGE
additional_imageIMAGE
xINT00–4096
yINT00–4096

Outputs (1)

NameTypeDescription
IMAGEIMAGE