Nodes/KJNodes for ComfyUI/Image Concatenate From Batch
ComfyUI Node Runs on cloud

Image Concatenate From Batch

Turn a batch of images into one grid

By kijai·Created 3 years ago·Updated a day ago· 2,908
Image Concatenate From Batch
  • images
  • IMAGE
num_columns3
match_image_sizefalse
max_resolution4096

You generated a batch of eight images, or you pulled a stack of frames out of a video, and now you want to see them all at once in a single picture - a contact sheet. That's what ImageConcatFromBatch is for. It takes a batch (a stack of images traveling down one wire) and tiles them into a grid with however many columns you ask for, spitting out one combined image. Great for comparisons, previews, and turning video frames into a filmstrip you can eyeball.

How it works

In ComfyUI, a "batch" is N images stacked together as one tensor. This node lays those N images out left-to-right, top-to-bottom, wrapping to a new row every num_columns images, and stitches the whole thing into a single output image. Nothing fancy - it's a layout operation - but doing it by hand with core nodes is a pain, so having one node for it is nice.

The inputs

  • images - the batch to tile. This is the required input; feed it the output of a batch generation, a video loader, or anything that produces multiple images on one wire.
  • num_columns - how many across before wrapping to the next row. Default is 3. Set it to the batch size for a single row, or lower it for a taller grid.
  • match_image_size - off by default. If your images are different sizes, turn this on so they get normalized before tiling; otherwise a grid of mismatched images will look ragged.
  • max_resolution - a ceiling (default 4096) so a giant batch of big frames doesn't try to assemble into an absurdly large canvas that eats memory.

The output is a single IMAGE - the grid. Wire it into a Preview or a Save node.

Don't confuse it with its cousin

Worth being clear, because the names overlap: this node takes one batch and arranges it into a grid. The pack's ImageBatchMulti does the opposite - it takes several separate image inputs and merges them into one batch. Use ImageBatchMulti to build a batch out of individual sources; use ImageConcatFromBatch to flatten a batch you already have into a single grid image.

Installing KJNodes

In ComfyUI Manager, search "KJNodes for ComfyUI" in the Custom Nodes Manager, install, and restart. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, then pip install -r ComfyUI-KJNodes/requirements.txt (portable: python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ComfyUI-KJNodes\requirements.txt), then restart. No downloads.

Watch out for

If your source images aren't all the same dimensions and you leave match_image_size off, the grid can come out misaligned or the node can choke trying to stitch tensors of different shapes. Flip that toggle on when in doubt.

And keep an eye on scale: a batch of 64 high-res frames tiled into one image is a large canvas. That's what max_resolution is guarding against, but if your grid looks downscaled or blurry, that ceiling is why - raise it if you actually need the detail, or reduce the batch you're tiling.

CategoryKJNodes/image

Inputs (4)

NameTypeDefaultDescription
imagesIMAGE
num_columnsINT31–255
match_image_sizeBOOLEANfalse
max_resolutionINT4096

Outputs (1)

NameTypeDescription
IMAGEIMAGE