Nodes/zhangp365/ComfyUI-utils-nodes/Image Composite Masked
ComfyUI Node

Image Composite Masked

Image Composite Watermark

By zhangp365·Created 2 years ago·Updated 5 months ago· 134
Image Composite Masked
  • destination
  • source
  • mask
  • IMAGE
x0
y0
resize_sourcefalse

At its core this node pastes one image onto another at a chosen position - which is exactly what a watermark stamp is: your logo or signature as the source, your generated output as the destination, composited at a specific x/y coordinate. It's the same compositing primitive that underlies a lot of ComfyUI image work - inpainting paste-backs, overlay graphics, sticking a badge or watermark into a corner - just aimed here at the watermarking use case specifically.

Mechanism: you give it a destination image (the base you're stamping onto) and a source image (what gets stamped), plus x and y coordinates telling it where in the destination the source gets placed, top-left corner reference. resize_source (a boolean, off by default) controls whether the source gets scaled to fit before compositing rather than pasted at its native resolution - turn it on if your watermark image isn't already sized appropriately relative to your output. An optional mask lets you control exactly which pixels of the source actually get composited, rather than the full rectangular source image - useful if your watermark asset isn't a clean transparent PNG and you need to mask out its background yourself.

Inputs that matter: destination, source, x, y, and resize_source are all required; mask is optional. There's no "auto-position in a corner" preset here and no built-in margin control - positioning is manual, via the x/y values you supply, so if you want your watermark consistently in the bottom-right corner across different output sizes, you'll want to compute those coordinates from the destination image's dimensions (this pack's own NeedImageSizeAndCount node pairs naturally here) rather than hardcoding a fixed offset.

Output: a single composited IMAGE, ready to save or pass further down the graph.

Install: search "ComfyUI-utils-nodes" in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/zhangp365/ComfyUI-utils-nodes

Restart ComfyUI. No models or API keys involved - this is pure image compositing.

Troubleshooting:

  • If your watermark shows up at the wrong scale or bleeds off the edge of the frame, check resize_source first - with it off, the source is pasted at its native pixel dimensions regardless of how big or small the destination is, so a watermark asset sized for a 1024px image will look enormous or get clipped on a 512px output.
  • Hardcoded x/y values that worked for one batch will drift on the next if your pipeline generates images at varying resolutions. Compute the position from the destination's actual width/height rather than fixing it once and forgetting about it.
  • If you're masking the source, make sure the mask's dimensions actually match the source image - a mismatched mask is one of the more common silent-failure modes in ComfyUI compositing generally, producing an unexpectedly cropped or misplaced result rather than a clear error.

One honest note on this one: the README describes a richer watermark node elsewhere in the pack - position presets, ratio-based resizing, margin control - but what's actually exposed through this node's interface is the simpler destination/source/x/y/resize_source/mask set described above. Treat the above as the ground truth for what you can currently configure.

Categoryimage/compositing

Inputs (6)

NameTypeDefaultDescription
destinationIMAGE
sourceIMAGE
xINT00–16384
yINT00–16384
resize_sourceBOOLEANfalse
maskoptMASK

Outputs (1)

NameTypeDescription
IMAGEIMAGE