ComfyUI Node Runs on cloud

JoinImageBatch

Turn a batch of images into one contact-sheet image

By ali1234·Created 3 years ago·Updated 3 months ago· 130
JoinImageBatch
  • images
  • image
modehorizontal

You just ran a sweep - six CFG values, eight seeds, whatever - and now you've got a folder of separate output PNGs you have to click through one at a time to compare. JoinImageBatch skips that: stack your batch and it tiles every image into one single image, side by side or top to bottom, so you can eyeball the whole comparison in one file.

How it works

It's a tensor reshape, not a resize or a canvas paste. ComfyUI represents an image batch as one tensor of shape [N, H, W, C] - N images, each H tall and W wide, sharing the same channel count. For vertical mode, the node just reshapes that tensor into [1, N×H, W, C], which works because stacking images top-to-bottom is exactly how the data is already laid out in memory. Horizontal mode needs an extra transpose step to lay the images side by side without warping them, but the end result is the same idea: one image, N times wider (or taller), with your original images placed in order.

Because it's a reshape and not a resize, every image in the batch has to already be the same width and height. That's automatically true if the batch came out of a genuine ComfyUI batch (a KSampler run with batch_size > 1, for instance) - a batch tensor can't hold mismatched sizes in the first place. Where it bites is if you're assembling images from separate sources or separate steps of a job-iterator sweep that don't share dimensions; you'll want to resize them to match before this node, not after.

The inputs and outputs that matter

  • images (IMAGE) - your batch. Needs to be an actual stacked batch, not a Python list of separately-sized images.
  • mode (enum, default horizontal) - the only real choice you make here: horizontal for a filmstrip, vertical for a stacked column. Pick whichever fits your comparison better - horizontal reads more naturally for "same subject, different setting" grids.
  • image (IMAGE, output) - the single joined image. Wire it straight into a Save Image or Preview Image node.

How to install it

Via ComfyUI Manager: search "comfyui-job-iterator", install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ali1234/comfyui-job-iterator

Restart ComfyUI. No dependencies, no models - this pack is genuinely just Python logic on top of ComfyUI's own tensor types.

Common issues & troubleshooting

You get a shape error or a warped-looking result. Almost always a size mismatch - one or more images in the batch aren't the same H/W as the rest. If your images came from different resolutions or different steps of a workflow that didn't lock dimensions, resize them to a common size first (a plain Resize Image node upstream is enough).

You wanted to compare images that arrived as a list, not a batch. This node wants a true batch tensor. If your images are coming out of ComfyUI's list-execution mode instead (which is exactly what happens downstream of this pack's own JobToList), you'll likely need to collect them into a batch first rather than feeding a list straight in - check what the node just upstream of this one is actually outputting if the wiring looks odd.

The output looks tiny or squished in the preview. That's just N images side by side or stacked - the result image is genuinely N times as wide or tall as a single input. Zoom in, or lower N, if you want each individual frame to stay readable at a glance.

Categoryali1234/image

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
modeCOMBOhorizontal2 options: horizontal, vertical

Outputs (1)

NameTypeDescription
imageIMAGE