ComfyUI Node

Batch Image Grid

Stack a batch of images into one grid, in one node

By muskccat·Created 3 months ago·Updated 3 months ago· 0
Batch Image Grid
  • images
  • image
columns3
rows3
orderrow_major
gap0
background_color#000000

So you've generated nine images and you want the classic 3×3 comparison grid. You could stitch them in an image editor, or pull in another pack, or hand-wire a row-and-column arrangement - or you can drop in Batch Image Grid, feed it the batch, tell it the shape, and get one combined image back. It's the finishing step of this pack's sweep pipeline, and it's genuinely handy on its own.

How it works

The node takes an IMAGE batch and reassembles it into a single larger image. You set columns and rows (up to 64 each), and it places images in order. order matters: row_major fills left to right, top to bottom; column_major fills top to bottom first, column by column. The gap parameter (0–256) inserts blank space between cells, and background_color (a hex string, default #000000) fills that space.

That ordering detail matters more than it looks. A KSampler Multi Run sweep orders its runs row-major (x horizontal, y vertical), so connect that node's columns and rows outputs here, pick row_major, and the grid lays itself out exactly the way the sweep ran. Get the order wrong and your labeled grid reads like a shuffled deck.

The output math is simple: nine 1024×1024 images with gap = 0 give you one 3072×3072 image. Add a 20px gap and you get the same grid with thin black separators. Output is a single IMAGE, ready for a save node.

The inputs that matter

  • images - the batch. Typically VAEDecode's output, optionally after Batch Status Bar Overlay has labeled each frame.
  • columns / rows - defaults 3 and 3. Want a long strip instead? Set rows to 1.
  • order - row_major vs column_major; the one beginners get wrong.
  • gap / background_color - presentation. Zero gap by default, so cells butt together edge to edge.

Install

Via ComfyUI Manager, search "StatusBarOverlay" (pack title ComfyUI-StatusBarOverlay), or:

cd ComfyUI/custom_nodes
git clone https://github.com/muskccat/ComfyUI-StatusBarOverlay

then restart. Only dependency is Pillow, already present, so nothing to download or configure.

Troubleshooting

The failure mode is too few images: if the batch is smaller than rows × columns, the node raises an error instead of leaving holes - so check columns/rows against the actual batch size. More images than cells isn't an error, but extras are silently ignored; that's a footgun if your sweep produced more frames than the grid allows and you only see the first few. And remember the row/column-major pairing with whatever generated the batch.

Real talk: the grid itself is nothing special - a dozen packs do grids. But it's bundled with the sweep node and the labeler so your whole "run a sweep, label it, grid it" pipeline stays in one tiny dependency. For that, it's quietly the right tool.

Categoryimage/grid

Inputs (6)

NameTypeDefaultDescription
imagesIMAGE
columnsINT31–64
rowsINT31–64
orderCOMBOrow_major2 options: row_major, column_major
gapINT00–256
background_colorSTRING#000000

Outputs (1)

NameTypeDescription
imageIMAGE