Nodes/WtlNodes/Image Batch
ComfyUI Node

Image Batch

Stack images into one batch — and let ComfyUI's crop rules do the work

By Scorpiosis0·Created 10 months ago·Updated 2 months ago· 3
Image Batch
  • image_1
  • image_2
  • batch (crops to image 1 size)

ComfyUI's batch system is a stack of images in one tensor, and it's how you run a sampler over multiple frames at once, or feed an animator several frames. The problem is that every image in a batch has to share the same dimensions - and images from different sources almost never do. WtlImageBatch solves that the same way ComfyUI itself does: it stacks your images and forces them all to the size of the first one.

You connect image_1, image_2 - and here's the nice part - keep connecting, and new slots (image_3, image_4, …) appear automatically as you wire them up. The node walks its slots, collects every frame, and returns a single stacked IMAGE tensor. The output port is even named "batch (crops to image 1 size)" so you can't miss the catch.

The mechanism is the standard ComfyUI batch behavior: any frame that isn't already the same size as the first one gets scaled-then-center-cropped to match, via comfy.utils.common_upscale with bilinear sampling and center crop. So a 1024×1024 frame and a 768×768 frame stacked with a 1024×1024 first frame will end up 1024×1024, with the smaller one scaled up and cropped to fit. It's the same normalization ComfyUI applies internally when it batches, which means you're not inventing a second, inconsistent rule - you're just forcing it early.

Where this earns its keep: feeding several loaded images into a single KSampler pass, batching frames for a video pipeline, or pre-stacking images before a node that expects one batch tensor rather than a list. If you've hit the "expected a single batch but got separate images" wall, this is the merger.

The honest warning is the crop. Center-cropping means you will lose edges on mismatched images. If keeping every pixel matters, that's what the pack's Image Combiner is for - it outputs a list and preserves each image's original dimensions. WtlImageBatch is the version for when you accept the crop and want the fast, uniform batch.

It's part of WtlNodes (Scorpiosis0/ComfyUI-WtlNodes). Install via ComfyUI Manager (search "WtlNodes") or:

cd ComfyUI/custom_nodes
git clone https://github.com/Scorpiosis0/ComfyUI-WtlNodes.git

then restart ComfyUI. Deps: numpy, scipy, pillow. No models, no downloads. Just remember - whatever you connect last, it gets cropped to the shape of the first.

CategoryWtlNodes/image

Inputs (2)

NameTypeDefaultDescription
image_1IMAGE
image_2IMAGE

Outputs (1)

NameTypeDescription
batch (crops to image 1 size)IMAGE