Nodes/ComfyUI-RAVE/ImageGridDecompose
ComfyUI Node

ImageGridDecompose

Slice a grid image back into individual frames

By spacepxl·Created 3 years ago·Updated 2 years ago· 95
ImageGridDecompose
  • images
  • IMAGE
x_dim3
pad_gridfalse
randomfalse
rs0

ImageGridDecompose is the mirror of ImageGridCompose: it takes a grid image and cuts it into x_dim × x_dim tiles, returning the tiles as a batch of images. Compose packs, this unpacks. It's also what the pack's KSampler (RAVE) calls internally after every denoising step to pull a gridded latent back into separate frames - so even if you never wire it up yourself, you're using it every time you run the sampler.

How it works

The node walks the grid in row-major order and crops out each cell, computing the tile size from x_dim and the total dimensions. The math handles the padding too: it subtracts the inter-cell borders before dividing, so tiles come back at their original size. That means pad_grid and x_dim must match whatever produced the grid - compose with padding, decompose with padding, or the crop boundaries drift and you get misaligned frames.

The random + rs pair is where the round-trip magic lives. If ImageGridCompose shuffled a batch with random=True and seed rs, then decomposing that grid with the same random=True and same rs restores the original order. The shuffle is a permutation, and applying the same one on the way out undoes it - so compose → decompose is lossless. Leave random off and you just get the plain row-major tiles.

Inputs and output

  • images - the grid IMAGE.
  • x_dim (2–8, default 3) - cells per side; must match the compose that built the grid.
  • pad_grid - must match too, or tiles come back misaligned.
  • random + rs - used to un-shuffle, only meaningful if the source was a shuffled compose.

Output is an IMAGE batch, one tile per cell. If the original batch didn't fill the last grid, you'll get black tiles back where the empty cells were - crop or trim them.

Installing it

Part of the ComfyUI-RAVE pack, found in the RAVE/Image menu. No dependencies beyond what ComfyUI ships and no model files. Install via ComfyUI Manager (search "ComfyUI-RAVE") or:

cd ComfyUI/custom_nodes
git clone https://github.com/spacepxl/ComfyUI-RAVE

then restart. If you're only here to split a contact sheet, this (or the latent version) is all you need from the pack.

CategoryRAVE/Image

Inputs (5)

NameTypeDefaultDescription
imagesIMAGE
x_dimINT32–8
pad_gridBOOLEANfalse
randomBOOLEANfalse
rsINT00–18446744073709550000

Outputs (1)

NameTypeDescription
IMAGEIMAGE