ImageGridCompose
Turn a stack of frames into a contact sheet (and learn RAVE's core trick)
- images
- IMAGE
ImageGridCompose is the pack's one-trick utility: it takes a batch of images and arranges them into a grid, x_dim × x_dim cells, returning them as a single composite image. If your batch is bigger than one grid it quietly makes several, one per full grid. That's a contact sheet, which is handy on its own - but the interesting part is the random toggle, because that's the exact mechanism the pack's KSampler (RAVE) uses under the hood to keep video frames temporally consistent.
How it works
Images go in as a batch (IMAGE), and each image is dropped into a cell in row-major order. With random enabled, the placement is shuffled using seed rs - a torch.randperm drives which image lands in which cell. Randomness is the whole point: when the companion sampler shuffles the frame grid on every denoising step, the model can never memorize "this frame is always in the corner," so it treats the whole video as one coherent image instead of nine unrelated pictures.
The inputs that matter
- images - any
IMAGEbatch. - x_dim (2–8, default 3) - cells per side. 3 is fine for most uses; a batch of 9 images fills a 3×3 grid exactly.
- pad_grid - adds 8px of padding around each cell. That's not arbitrary: 8 image pixels lines up with 1 latent pixel (latent space is 8× smaller), so grids made here can swap cleanly with the latent versions of this node. Whatever you pick, use the same value on the decompose side.
- random + rs - shuffle the placement with a seed. Same
random=Trueand samersonImageGridDecomposerestores the original order losslessly.
Output
A single IMAGE per grid. The obvious standalone use is making contact sheets for previewing a batch of generations or feeding a grid image into a ControlNet preprocessor. But its real job is being the "pack" half of RAVE's grid round-trip: compose → sample → decompose.
One gotcha: if the batch doesn't fill the last grid, the leftover cells are black. Keep your image count a multiple of grid_size² if you want a clean sheet.
Installing it
It ships in the ComfyUI-RAVE pack - no extra dependencies, no model downloads. Install via ComfyUI Manager (search "ComfyUI-RAVE") or:
cd ComfyUI/custom_nodes
git clone https://github.com/spacepxl/ComfyUI-RAVE
then restart ComfyUI. The node lives in the RAVE/Image menu.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| x_dim | INT | 32–8 | — |
| pad_grid | BOOLEAN | false | — |
| random | BOOLEAN | false | — |
| rs | INT | 00–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |