ComfyUI Node

Image Array

Turn a pile of images into a labeled comparison grid

By rjgoif·Created 9 months ago·Updated 2 months ago· 5
Image Array
  • images
  • array
  • images
backgroundwhite
resizegrow
size_methodpad
padtrue
shapehorizontal
labels
label_endloop
label_locationbottom
label_size32
fontarial.ttf
spacing5
label_input

Image Array is the flagship of this pack and probably why you're here. You feed it a batch of images and it returns a single, neatly labeled grid - a contact sheet, a comparison panel, whatever you want to call it - ready to drop into a Reddit post or a Discord channel. The community has a whole genre of posts that boil down to "look, I labeled it properly," and this is the node that gets you there without leaving ComfyUI.

The pipeline is equalize → label → arrange. It makes all the images a uniform size, stamps labels under (or over, or beside) each one, and lays them out in a grid you control. That "make it presentable" step is exactly what r/StableDiffusion's comparison posts are begging for, and it's the whole point of this pack.

How it works

Three stages under one hood. First your images are equalized (the same logic as the Image Equalizer node) so they fit together. Then each cell gets a label. Finally the layout engine picks rows and columns from your shape choice:

  • horizontal / vertical - one row, one column.
  • square - the N×M grid closest to square that minimizes empty cells.
  • smart_square / smart_landscape / smart_portrait - pick the grid whose cell aspect ratio best fits 1:1, 3:2, or 2:3. This is the one you want for mixed portrait/landscape photo galleries, because a grid sized for the wrong aspect leaves ugly blank strips.

background (white or black) decides the canvas color and the label scheme - the opposite color becomes the label background, so you always get readable contrast. spacing puts a pixel border around each cell (5–10 reads much cleaner than 0).

The inputs that matter

  • images - your batch. It's a list-aware node, so a Python list of tensors works too.
  • labels - multiline text, one label per line. This is where people get burned: pressing Enter makes a new label, so to get a line break inside one label you type a literal \n. Semicolons split labels too, and numbers get auto-formatted (decimals truncated to 5 places, trailing zeros dropped).
  • label_input - optional dynamic input. Connect a string, number, or list from another node and it overrides the labels widget. Handy when labels are themselves generated, like prompt text or a seed counter.
  • label_end - loop repeats your label list if you have more images than labels; end just stops labeling.
  • resize / size_method / pad - the equalizer stage. pad (default) letterboxes to a uniform size; stretch distorts; crop_center fills by cropping. resize: grow upscales small images rather than shrinking big ones.

Two outputs: array (the single combined grid image) and images (a list of the individually labeled images, if you want them separately).

Install

ComfyUI Manager → search "Img Label Tools" → Install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/rjgoif/ComfyUI-Img-Label-Tools

Restart ComfyUI after either. No models, no heavy deps - Pillow and PyTorch are already there. For custom fonts, drop a .ttf into a fonts folder at your ComfyUI root and it'll show up in the font dropdown; otherwise it falls back to Arial.

Gotchas

The \n-vs-Enter label thing is the #1 confusion, so read the labels section twice. Also, the equalizer is CPU-bound and grow mode scales to the largest image in the batch - one oversized input makes the whole grid balloon, so normalize your inputs first if memory complains.

CategoryImage Label Tools

Inputs (13)

NameTypeDefaultDescription
imagesIMAGE
backgroundCOMBOwhite2 options: white, black
resizeCOMBOgrow2 options: grow, shrink
size_methodCOMBOpad4 options: pad, stretch, crop_center, fill
padBOOLEANtrue
shapeCOMBOhorizontal6 options: horizontal, vertical, square, smart_square, smart_landscape, smart_portrait
labelsSTRING
label_endCOMBOloop2 options: loop, end
label_locationCOMBObottom6 options: top, bottom, left_vert, left_hor, right_vert, right_hor
label_sizeINT320–200
fontCOMBOarial.ttf1 options: arial.ttf
spacingINT50–100
label_inputoptSTRING

Outputs (2)

NameTypeDescription
arrayIMAGE
imagesIMAGE