Nodes/ComfyDL/Show Images
ComfyUI Node

Show Images

A batch of tensors, finally looking like a grid of pictures

By Cynthia-lxx·Created 2 months ago·Updated 2 days ago· 6
Show Images
  • images
  • image
num_rows1
num_cols4
scale1.5
titles

In the ComfyDL world, a "batch of images" is a tensor - numbers in four dimensions that you cannot look at. CdlShowImages fixes that: it takes an IMAGE batch and arranges it into a labeled grid, rendered as a single IMAGE you can preview, save, or hand off. It's the node you reach for the moment you load a dataset and want to see what the model is actually being fed.

This is ComfyDL's port of the d2l show_images utility, and in the textbook it's the thing that makes the Fashion-MNIST exploration workflows look alive - the README's own screenshots show exactly this: a grid of fashion items right in the node graph. It's the difference between "I loaded 64 images" and "I can see 64 images."

The inputs

  • images - an IMAGE tensor [B, H, W, C], standard ComfyUI image format. This is the one input that connects to the rest of the ComfyUI world rather than the pack's private cdlTensor type.
  • num_rows - rows in the grid (default 1).
  • num_cols - columns (default 4).
  • scale - per-cell scale factor (default 1.5); the figure is cols*scale × rows*scale inches. Crank it up when the thumbnails are too small to see.
  • titles - comma-separated per-image captions (optional).

Output: image, a [1, H, W, C] IMAGE of the assembled grid - wire it into Preview Image and you're done. If you give it more images than rows*cols, it quietly renders the first rows*cols of them.

Installing ComfyDL

The standard light install:

cd ComfyUI/custom_nodes
git clone https://github.com/Cynthia-lxx/ComfyDL
cd ComfyDL && pip install -r requirements.txt

Restart ComfyUI; it's under ComfyDL → Visualization, or search "ComfyDL" in ComfyUI Manager. matplotlib is the only extra dependency; no model downloads.

Where it shines and where it trips

Shines: dataset inspection. Load Fashion-MNIST or a custom batch, set rows×cols to something that fits your screen, and you instantly see class patterns, weird samples, broken crops - the stuff that ruins training runs if you never look. Titles help a lot here; caption each cell with its label and mislabeled data becomes obvious at a glance.

Trips: the silent truncation. Feed 40 images to a 3×4 grid and you get 12, no warning. When your "dataset exploration" shows fewer images than expected, that's not a bug - it's the grid math. Set rows×cols ≥ your batch size and check the batch dim.

The grid renders every cell even when the batch is smaller, so trailing cells come out blank. That's normal, not corruption. And titles is comma-separated and positional - if your titles don't line up with the rendered images (because of truncation), the captions shift and everything looks mislabeled. Keep the grid large enough that nothing gets cut.

One more note: unlike the pack's cdlTensor-only nodes, this takes standard IMAGE input and emits standard IMAGE - so it's a rare friendly node that plays nice with the rest of ComfyUI. The dataset nodes in this pack output IMAGE for exactly this reason.

Categoryd2l/Visualization

Inputs (5)

NameTypeDefaultDescription
imagesIMAGE
num_rowsINT11–100
num_colsINT41–100
scaleFLOAT1.50.1–10
titlesoptSTRING

Outputs (1)

NameTypeDescription
imageIMAGE