Nodes/网格图像/网格图像
ComfyUI Node

网格图像

Glue a batch into one numbered contact sheet — no model, no deps

By ageless-h·Created 8 months ago·Updated 8 months ago· 1
网格图像
  • images
  • IMAGE
resolution1080p (1920x1080) 16:9
rows2
cols2

You've just run a workflow five times tweaking the prompt, or batch-generated a pile of LoRA / pose / style variants, and now you have a folder of loose images and no way to eyeball them at once. That's the exact problem 网格图像 (Grid Image) solves: it takes up to 32 images and stitches them into a single numbered grid, ready to save or share in one PNG. It's the ComfyUI version of A1111's grid view, minus the effort of building it yourself - and unlike a lot of "helper" packs, it has zero dependencies, zero model downloads, and no API call. It's pure, boring, CPU-side pixel work, which is exactly why it's dependable.

How it actually works

The node is written against ComfyUI's newer node API (comfy_api.latest, the io.ComfyNode + define_schema() style the ecosystem doc tracks), and that one fact drives most of its behavior. It takes your incoming image tensors, resizes each one with LANCZOS down to exactly one cell of the target canvas, pastes them in row-major order, and draws a small white number with a black outline in each cell's bottom-right corner. Feed it image #1, #2, #3 and you get back one tensor labeled 1-2-3 - handy when you're telling someone "variant 7 is the good one" and they can point at a cell instead of squinting.

Two things follow from that design, and they're the honest gotchas:

  • Every image is stretched to fill its cell. The node resizes to the cell's exact size; it doesn't letterbox, crop-to-cover, or preserve aspect ratio. Feed it 1:1 squares into a 16:9 grid and they'll come out squished. If your sources are all one aspect, fine. If they're not, this is where you notice.
  • Cells beyond rows * cols are silently dropped. The autogrow input accepts up to 32 images, but a 2×2 grid only ever shows four. The extra inputs aren't an error - they just never appear. Set your grid to match your batch before you run it.

The inputs and output that matter

There are only three widgets, and honestly only two of them matter:

  • resolution (combo, default 1080p (1920x1080) 16:9) - eleven presets: 16:9 from 480p up to 4K, one ultrawide 1080p (1920x810) 21:9, and the same size ladder in 9:16 portrait. There is no free-form size input, so if you need, say, 512×512 you'll want a different tool - but for "contact sheet to post or archive," the presets cover it.
  • rows and cols (int, 1–8, default 2) - the grid layout. That's it.
  • images - the autogrow socket. Plug one image in and another appears, up to 32.

The single output is IMAGE: one tensor holding the finished grid. Wire it into a Preview Image or Save Image node - it's not an output node itself, so nothing happens until you do.

Installing it

ComfyUI Manager is the easy route: search ComfyUI_Grid_image, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ageless-h/ComfyUI_Grid_image
# restart ComfyUI

Then find it in the node palette as 网格图像 (the pack's README is in Chinese, and so are the node's own labels - search for "Grid" or "网格"). No requirements.txt beyond a no-op, no models to fetch; the pyproject declares dependencies = []. The one real requirement is a recent ComfyUI - the README says v0.7.0+, because it needs the newer node API. If it shows up as a missing/unknown node on an old install, that's why. One more wart worth knowing: the README's manual-install snippet literally says git clone https://github.com/yourusername/ComfyUI_Grid_image.git - a copy-paste leftover. Use the ageless-h URL above, not the README's.

Where people get burned

Aside from the aspect-ratio squish and the silently-dropped extras, the other thing to know is the numbering font: it tries arial.ttf and falls back to PIL's tiny default font if it's not found, so on some Linux boxes the numbers render smaller than the Windows demo. Cosmetic, not broken. And if you pick 4K on a 32-image grid, each cell is a genuine 1080p-ish crop - the canvas is a plain numpy array so it works fine, but it's a chunk of RAM for something you're going to shrink for Discord anyway. Reach for the 2K or 1080p preset unless you actually need the pixels.

CategoryGrid image

Inputs (4)

NameTypeDefaultDescription
resolutionCOMBO1080p (1920x1080) 16:911 options: 4K (3840x2160) 16:9, 2K (2560x1440) 16:9, 1080p (1920x1080) 16:9, 720p (1280x720) 16:9, 480p (854x480) 16:9, 1080p (1920x810) 21:9, +5
rowsINT21–8
colsINT21–8
imagesCOMFY_AUTOGROW_V3

Outputs (1)

NameTypeDescription
IMAGEIMAGE