Nodes/ComfyUI-Apt_Preset/Image_batch_composite
ComfyUI Node

Image_batch_composite

Stamp the same overlay onto every frame in a batch

By cardenluo·Created 2 years ago·Updated 18 days ago· 309
Image_batch_composite
  • bg_image
  • batch_image
  • batch_mask
  • image
x0
y0
resize_sourcefalse
Invertfalse

Pasting one image onto another is a solved problem in ComfyUI - the annoying part is doing it consistently across an entire batch. Image_batch_composite is the batch-aware version: give it a background, a batch of images to paste on top, an x/y position, and it stamps the same placement across every item in the batch in one shot.

How it works

bg_image is what everything lands on, batch_image is what gets pasted - it can be a single image or a real batch, and x/y set where the top-left of the paste sits (both clamped to 0 minimum, so no negative offsets - if you need something to hang off an edge, pad the canvas first). resize_source toggles whether the pasted content gets resized to fit rather than dropped in at its native resolution. Invert flips the optional batch_mask before compositing, which is only meaningful once you've actually wired a mask in - without one, the paste is effectively fully opaque and Invert has nothing to act on.

The inputs and outputs that matter

  • bg_image, batch_image (both required) - background and what's being stamped on top.
  • x, y (default 0, min 0, max 9999) - paste position.
  • resize_source (default false) - resize the pasted content to fit instead of pasting at native size.
  • batch_mask (optional) plus Invert - control exactly which pixels of batch_image actually show through.
  • Output: image - the composited result.

How to install it

Via ComfyUI Manager: search ComfyUI-Apt_Preset, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git

Windows: double-click install.bat. Linux/Mac: activate your venv and run pip install -r ComfyUI-Apt_Preset/requirements.txt yourself - there's no cross-platform install script. Restart ComfyUI. Nothing to download for this node specifically; it's plain image compositing. The pack's dependency list (pandas, gguf, onnxruntime, audio/video libraries) is there for other parts of this fairly large, actively maintained pack - around 300 GitHub stars, MIT-licensed - not for anything this node touches.

Common issues & troubleshooting

Batch size mismatches between bg_image and batch_image. ComfyUI generally broadcasts a single image across a batch or errors on mismatched counts that aren't 1 - if you're compositing a static logo onto a whole video sequence, keep bg_image at a single frame so it broadcasts, rather than trying to match counts manually.

Negative placement isn't possible. x/y bottom out at 0, so you can't intentionally hang a paste off the top or left edge the way you might in a general-purpose compositor. If you need that, pad the background canvas first with something like Image_pad_adjust or Image_pad_keep, then composite onto the padded canvas.

Invert doing nothing. It only flips batch_mask - with no mask wired, the paste is opaque everywhere resize_source/position put it, and Invert has no effect to invert. Wire a mask before reaching for this flag.

One import failure can take out the whole pack. Every Apt_Preset node registers from a single Python module, so a broken dependency anywhere in requirements.txt can make nodes disappear from the menu across the board, not just this one - check the ComfyUI console for import errors first if Image_batch_composite (or any other Apt_Preset node) has gone missing after an update.

CategoryApt_Preset/image/ImgBatch

Inputs (7)

NameTypeDefaultDescription
bg_imageIMAGE
batch_imageIMAGE
xINT00–9999
yINT00–9999
resize_sourceBOOLEANfalse
InvertBOOLEANfalse
batch_maskoptMASK

Outputs (1)

NameTypeDescription
imageIMAGE