Nodes/ComfyUI-NynxzNodes/Grid From Images
ComfyUI Node

Grid From Images

One contact sheet out of a whole batch, no stitching nodes

By Nynxz·Created 11 months ago·Updated about 12 hours ago· 4
Grid From Images
  • images
  • style
  • background
  • preview
  • grid

You ran a batch of twelve. Twelve preview nodes is a wall of noise, and twelve separate images is a worse result than one picture of twelve things. Grid From Images takes the batch - or a list off a folder/dataset loader - and composes it into a single grid image you can actually look at, with a real preview on the node and an IMAGE output you can save or feed onward.

The one behaviour that makes it work

It's an input-list node, and it consumes the whole list in one call. That sounds like plumbing trivia; it isn't. Without it, a list of images executes the node once per image and you get N grids containing one image each. With it, both shapes collapse into one grid: an [N,H,W,3] batch and a list of [B,H,W,3] tensors are flattened into single frames and laid out together.

Frames of different sizes are fine. Each cell handles its own fit.

Inputs and output

Required: images. Optional: style, background, preview. Output: grid. It's an output node, so it runs and previews on its own.

style is a NYNXZ_GRID_STYLE - wire Grid Style, or any of the chained Layout / Border / Shadow nodes, and unwired it assumes sensible defaults (3 columns, 320×180 cells, 12px gaps, 24px padding, cover fit, rounded corners, a soft drop shadow). background is a Background Maker spec, rendered at the canvas size, unwired giving a plain dark backdrop.

preview you can ignore. The node saves its own preview records under a custom key rather than images, specifically so ComfyUI's default bottom preview strip doesn't fire as well - you get the pack's on-node preview with a batch pager and a fullscreen lightbox, not both.

What the compositor actually does

Pure numpy and PIL, no models. It works out the layout from your style: either fixed cell size with a derived canvas (size_mode = cells) or fixed canvas with derived cells (size_mode = canvas). Each cell is cover (crop to fill) or contain (letterbox). Rounded corners are anti-aliased off a signed distance field rather than by supersampling, which means a corner looks equally smooth on a 320px cell and on a 4K one - a nicer detail than most of the "rounded corners" I've seen in node packs.

Borders and shadows are per cell: solid, a two-colour gradient at an angle, or auto sampled from each image - a saturation-weighted average pushed away from grey, so a mostly-grey screenshot with one splash of colour borders in that colour. Shadow mode drop is an offset blur, glow is a symmetric bloom.

One thing to know: the grid output can be RGBA. A transparent Background Maker ground survives through the compositor to the saved file, because everything composites with proper alpha rather than paste-with-mask. The on-node preview flattens that over a checkerboard so you can see it's transparent; the output doesn't.

Install

Manager → search Nynxz → ComfyUI-NynxzNodes, or:

comfy node install comfyui-nynxz-nodes

From source:

cd ComfyUI/custom_nodes
git clone https://github.com/Nynxz/ComfyUI-NynxzNodes
cd ComfyUI-NynxzNodes
pnpm install && pnpm build

Restart. No models, no Python dependencies - numpy and Pillow only.

The build step is the one thing to get right. web/ is gitignored upstream, so a bare clone registers the node but gives you no custom preview widget and no style/background panels. Manager and comfy node install ship the frontend built. The pack also offers an optional ZenKit install for pop-out panels - nice, not needed.

Troubleshooting

A batch made twelve grids. You fed it a list of lists, or a loader that emits something the flattening doesn't recognise. The node handles [B,H,W,3] and [H,W,3]; anything else in the list is skipped silently, which can look like frames going missing.

Images look cropped. fit defaults to cover, which crops to fill the cell. Switch to contain if you're comparing compositions and can't afford to lose edges - letterboxing is ugly but honest.

The grid is enormous. size_mode = cells derives the canvas from cell size × columns, and the defaults (3 columns of 320×180) are modest, but bump columns to 8 while leaving cell width at 320 and you've ordered a 2560px-wide image with three rows' worth of height. Switch to size_mode = canvas and set 1920×1080 when you want a page-sized sheet.

Style changes do nothing. Check what's actually feeding the grid's style. If you have a Grid Style node in the graph but the wire goes to background, or nothing, you're looking at defaults and wondering why the border vanished. There's no visible socket mismatch to warn you because both inputs are optional.

Worth saying plainly: this node is a presentation tool. It doesn't sample, it doesn't upscale, it doesn't judge. It just stops you from posting eleven tabs to a friend.

CategoryNynxz/Grid

Inputs (4)

NameTypeDefaultDescription
imagesIMAGEImages to lay out (a batch or a list — both collapse into one grid).
styleoptNYNXZ_GRID_STYLEOptional Grid Style node. Unwired = sensible defaults.
backgroundoptNYNXZ_BACKGROUNDOptional Background Maker — rendered to the canvas size. Unwired = plain dark.
previewoptNYNXZ_SAVE_PREVIEW—

Outputs (1)

NameTypeDescription
gridIMAGEThe composed grid image.