ComfyUI Node

Image Batcher

Stacking images into one batch, bars and all

By DadoIrie·Created 2 years ago·Updated a day ago· 10
Image Batcher
  • image
  • image_2
  • image_3
  • IMAGE

Some ComfyUI nodes are hungry for batches. Batch-to-batch nodes, KSampler with a batch of latents, video-frame stacks, upscalers that process a whole strip at once - they all want one IMAGE tensor with multiple images along the batch dimension, not two separate tensors sitting in parallel wires. The Image Batcher exists to merge 2–3 images into exactly that single batched tensor.

The name undersells one detail that actually matters, so let's say it up front: if your images are different sizes, it doesn't just refuse or fail - it center-pads the smaller ones with black to match the largest, then concatenates. Same size, and it's a clean torch.cat. Different sizes, and you get letterbox bars. That's the entire personality of this node.

The inputs and output

  • image and image_2 - required, the two images you're batching.
  • image_3 - optional, for when two isn't enough. Leave it unplugged and the node just merges the pair.
  • output - a single IMAGE tensor, batch size 2 or 3, all frames at the largest height/width.

How it works, in practice

The mechanism is simple but worth understanding because it decides whether the result looks right. The node computes the max height and width across your inputs, then:

  • If every image is already that size, it concatenates directly - zero surprises.
  • If any image is smaller, it builds a black tensor at max dimensions and pastes the image into the center, so the bars split evenly top/bottom or left/right.

The padding choice is where people get bitten. Center-padding means a square image and a wide image don't stack cleanly into a side-by-side strip - the wide one ends up with black bars top and bottom. If you want a seamless multi-panel composite, pre-resize to a common size before batching. If you're batching frames of the same resolution (the common case - multiple renders at the same dims, or frames from a video node), this is a non-issue and the node is exactly what you want.

Install

Part of Dados Nodes: ComfyUI Manager → search "Dados Nodes", or

cd ComfyUI/custom_nodes
git clone https://github.com/dadoirie/ComfyUI_Dados_Nodes.git
cd ComfyUI_Dados_Nodes
pip install -r requirements.txt

then restart. No models, no keys, no ffmpeg - this one is pure torch.

When to reach for it

Grab it when a downstream node is erroring with "input tensor must have batch size X" or you're feeding multiple reference images into something that takes one batched input. It's also a lazy person's way to preview several renders in one preview node - batch them first, preview once. Just remember the black-bar caveat for mixed sizes, and if your workflow already guarantees uniform dimensions, this node is as boring and reliable as a file copy - which is exactly what you want from plumbing.

CategoryDado's Nodes/Image

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
image_2IMAGE
image_3optIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE