DY Image List to Grid
Turn the pack's IMAGE_LIST into one contact sheet
- images
- IMAGE
DY Image List to Grid exists for one very specific reason: this pack's DYImageMasks outputs an IMAGE_LIST - one mask per palette color - and that's a type ComfyUI's normal preview nodes can't display directly. This node takes that list and stitches it into a single grid image you can actually look at. It's the pack's built-in way of seeing what you just made.
Here's the workflow it's designed for: run the pack's Quantize → Palette → Masks pipeline, and Masks hands you back N single-channel masks. A list of N masks is useful data but invisible - you have no idea what each mask covers. Drop this node on the end, set your columns, and suddenly you get a contact sheet: mask 1 top-left, mask 2 next to it, and so on, all in the order the masks came out (which is frequency order, biggest first). It turns an abstract list into something you can actually debug and decide from.
How it works
The mechanism is simple tensor math: it takes the first image's height/width as the grid cell size, arranges the list into rows of max_columns, pads any incomplete last row with solid black images so the grid stays rectangular, then concatenates horizontally per row and vertically across rows. One IMAGE out. Because the padding is black (i.e., 0, "nothing"), it reads naturally when you're viewing masks - empty cells are just empty.
Two constraints worth knowing. All images in the list need to be the same size, or the torch.cat will throw a shape mismatch - which is a given with this pack's masks, since they all come from one source image, but will bite if you try to grid arbitrary images from elsewhere. And max_columns caps at 10, so a huge mask list will produce a tall skinny sheet rather than a compact one.
Inputs
- images - the
IMAGE_LIST(wire DYImageMasks' output here). - max_columns (1–10, default 3) - how many thumbnails per row.
Install
Part of dymokomi/comfyui_dygen by Dy Mokomi. ComfyUI Manager → search "comfyui_dygen", or:
cd ComfyUI/custom_nodes
git clone https://github.com/dymokomi/comfyui_dygen
Restart. No extra dependencies.
The honest take
This is a utility node in the purest sense: zero cleverness, no knobs beyond the column count, and it only makes sense inside this pack because IMAGE_LIST is a pack-private type. If you're using DYImageMasks seriously, this is the preview you'll reach for constantly - mask work is impossible to tune blind, and one glance at the contact sheet tells you whether your quantize level was too high (masks all speckly) or too low (masks all the same). On its own, outside the pack, it has no reason to exist. Inside the pack, it's the difference between a pipeline you can see and one you're flying blind in.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE_LIST | — | |
| max_columns | INT | 31–10 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |