Nodes/TrentNodes/Image+Text Grid
ComfyUI Node

Image+Text Grid

Contact Sheets With Captions, in One Node

By TrentHunter82·Created 9 months ago·Updated 4 days ago· 36
Image+Text Grid
  • images
  • layout
images_per_row0
image_size256
caption_height64
font_size12
padding0
background_colorwhite
caption_prefix
caption_1
caption_2
caption_3
caption_4
caption_5
caption_6
caption_7
caption_8
caption_9

When you generate a batch of variations, the fastest way to review them is a contact sheet: everything on one grid, captioned so you know which prompt or seed made which. Assembling that by hand - resize, tile, draw text, add borders - is exactly the kind of busywork ComfyUI should absorb. Image+Text Grid does it in one node: a batch of up to 9 images becomes a clean grid with a caption under each.

It's the review/QC node for batch generation, comparison grids, and anything where "put these side by side with labels" is the deliverable. The README even calls out the intended pairing: contact sheets, comparison grids, and captioned galleries.

How it works

Feed it images (up to 9 frames in the batch). Layout is controlled by:

  • images_per_row - your column count, or 0 for auto-fit, which picks the best columns via ceil(sqrt(n)) (9 images → 3×3, 4 images → 2×2). Auto-fit is the right default for most contact sheets.
  • image_size (default 256) - max dimension per image cell; images keep their aspect ratio.
  • caption_height (default 64), font_size (default 12), padding, background_color (white/black/gray) - the chrome around the images.

Captions are the part worth explaining. Each image has a matching optional input - caption_1 through caption_9 - so cell N shows caption_N. With caption_prefix you can prepend bold text to every caption (e.g. the run name, with per-image labels coming from the caption inputs). Wire the pack's text utilities or per-image metadata in and you get labelled sheets automatically.

Captions are forceInput sockets, so they want wires, not typed values - but a plain string node or the pack's String List Cowboy feeds them fine. One important README note: if your images come from a list-based node (like StringListCowboy-style outputs or a list producer), collect them into a single batch with an ImageListToImageBatch node upstream first - this node expects a real batch, not a list.

Single output: layout, the finished grid as one IMAGE. Preview it, save it, or feed it into a video node - it's a normal image like any other.

Honest positioning: for "I need to eyeball 9 generations at once," it's the nicest one-node answer in the pack. The caption machinery is the differentiator over a plain grid tiler - a labelled contact sheet is genuinely more useful than an unlabelled one when you're A/B-ing prompts or tracking seeds.

Install

Search "Trent Nodes" in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/TrentHunter82/TrentNodes.git
cd TrentNodes
pip install -r requirements.txt

Pure PIL/tensor composition - no models. Restart ComfyUI after installing. (The author has flagged Manager install flakiness on this pack from an early repo rename; manual clone is the reliable fallback.)

Common issues

  • Captions landed on the wrong cells. Each caption_N is positional - caption_1 labels image 1, and so on. Wire them in matching order.
  • "It only shows one image." If you're feeding a list rather than a batch, it collapses. Collect the list into a batch first (ImageListToImageBatch upstream), per the README.
  • Text is cramped or overflowing. Raise caption_height or drop font_size; long captions need headroom.
  • More than 9 images? The node caps at 9. Split the batch or run it twice.

For a captioned contact sheet in one node, this is the one. Batch in, labelled grid out - the review loop gets a lot less tedious.

CategoryTrent/Image

Inputs (17)

NameTypeDefaultDescription
imagesIMAGE
images_per_rowINT00–10Images per row (0 = auto-fit)
image_sizeINT25664–1024Max dimension for each image cell
caption_heightINT640–256Height reserved for caption text
font_sizeINT128–48Font size for caption text
paddingINT00–100Padding between images
background_colorCOMBOwhiteBackground color of the layout
caption_prefixSTRINGBold text prepended before each caption
caption_1optSTRING
caption_2optSTRING
caption_3optSTRING
caption_4optSTRING
caption_5optSTRING
caption_6optSTRING
caption_7optSTRING
caption_8optSTRING
caption_9optSTRING

Outputs (1)

NameTypeDescription
layoutIMAGE