Grid Image from batch (OFF)
A Pretty Contact Sheet, With One Random Twist
- images
- IMAGE
Need a contact sheet - a grid of thumbnails from a batch so you can eyeball variations at a glance? This node makes one that's actually pleasant to look at: rounded corners, a border color you choose, tiles that keep their aspect ratio, and the whole thing scaled to a target height. The "(OFF)" in its name just means it's from Off-Live's pack; the code is adapted from WAS Suite's grid image node, so it's built on proven DNA.
The one behavior nobody warns you about: the tiles are randomly shuffled. Don't assume slot one is batch image one.
What you plug in
- images - the batch. That's the only required input.
- number_of_columns - grid width, default 3 (1–24).
- max_cell_size - longest edge of each tile, default 320px. Bigger tiles for readability, smaller for denser sheets.
- border_width, border_red/green/blue - the gutter width and color (default a dark gray, RGB 38/38/38).
- border_radius - corner rounding on each tile, default 24. Zero for sharp corners.
- target_size - the output's target height in pixels, default 1080. It pads the outer border to push the sheet toward that height.
Output is a single IMAGE you can preview or save.
The shuffle gotcha
Read the source and you'll find np.random.shuffle applied to the slot indices before pasting. The author either did it for visual variety or as a leftover, but the net effect is real: tile order in the grid does not match batch order. If you're building a grid to compare image #1, #2, #3 against each other, the layout will lie to you. For a general "show me my batch" sheet it doesn't matter; for a rigorous A/B comparison it does. If you need order-preserving, use a different grid node.
How it behaves
Each tile is resized to fit within max_cell_size while keeping its aspect ratio, given rounded corners (via a rounded-rect mask composited over the border color), then bordered and placed into a grid where cell size is uniform but tiles are centered in their cells. So a portrait and a landscape photo sit side by side with equal cell footprints - tidy. Output height is "roughly target_size," not exact: the node pads the outer border to push toward it, which means small batches get a lot of margin and large ones may exceed it. If you need a precise output size, crop after.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Off-Live/ComfyUI-off-suite
# or: ComfyUI Manager → search "ComfyUI-off-suite"
No extra dependencies - Pillow and numpy, both bundled with ComfyUI. Batch previews, prompt-variation sheets, dataset sanity checks: that's its lane, and it does the job well enough that you'll forget the shuffle thing until the day you rely on order. Then you'll remember this page.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| border_width | INT | 200–100 | — |
| number_of_columns | INT | 31–24 | — |
| max_cell_size | INT | 32032–2048 | — |
| border_red | INT | 380–255 | — |
| border_green | INT | 380–255 | — |
| border_blue | INT | 380–255 | — |
| border_radius | INT | 240–128 | — |
| target_size | INT | 10800–8192 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |