ComfyUI Node

Chunk Up

Process a 64-Image Batch in 32-Image Chunks Without Crying About VRAM

By vivax3794·Created 2 years ago·Updated 2 years ago· 3
Chunk Up
  • batch
  • amount_chunks
  • chunks
chunk_size16

Big batches are the fastest way to hit your VRAM ceiling. If you've ever queued 64 latents and watched the sampler grind to a halt with an OOM error, Chunk Up is the node that lets you dodge it: it splits any batch or list into fixed-size chunks you can process one at a time. The README spells out the exact use case - process 64 latents in batches of 32 when you don't have enough VRAM.

It's one third of a chunking trio (with Get Chunk and Join Chunks) built for ComfyUI's core For Loops. The loop walks through chunks, you process each one inside the loop body, and Join Chunks collects the results on the way out.

How it works

Under the hood it's Python slicing plus one special case. It walks the input in steps of chunk_size and slices out each chunk. The clever bit is latent handling: if the input is a latent dict (the {"samples": tensor} wrapper ComfyUI uses), Chunk Up slices the tensor inside it and re-wraps each slice back into a proper latent dict. That means every chunk you get is a valid latent batch downstream - you can feed it straight into a sampler without unwrapping anything.

The inputs and outputs that matter

  • batch (* wildcard) - the tensor batch, latent dict, or Python list you want to split. This is where the wildcard typing earns its keep: the same node handles latents, images, and lists.
  • chunk_size (INT, default 16) - elements per chunk. This is the one you'll actually touch. The default of 16 is small for images; for a 64-latent workload you'd set it to 32.

Two outputs:

  • amount_chunks (INT) - how many chunks were produced. Handy for configuring a loop.
  • chunks (*) - the list of chunks, each one a slice of the original batch.

Common issues

  • A single latent is a chunk of one. If you feed in one latent that isn't already batched, you get one chunk containing that one latent. Batch your inputs first.
  • Latent chunks vs. plain tensors don't mix. Keep the same data shape through the whole loop. Chunk Up gives you latent-dict chunks from a latent batch; don't try to join those with plain tensor batches later - Join Chunks will complain.
  • chunk_size default is just a default. The 16 is a guess from the author. Set it based on what your GPU can actually hold, not what the node suggests.

Install

Install with ComfyUI Manager (search ComfyUI-Vivax-Nodes) or clone:

cd ComfyUI/custom_nodes
git clone https://github.com/vivax3794/ComfyUI-Vivax-Nodes

then restart ComfyUI. The only Python dependency is rich; Manager installs it automatically, or pip install rich if you cloned by hand. No model files, no keys. Small single-author pack, so give the repo a skim before you trust it - the whole custom-node ecosystem runs on that kind of due diligence.

Categoryvivax/chunks

Inputs (2)

NameTypeDefaultDescription
batch*
chunk_sizeINT16

Outputs (2)

NameTypeDescription
amount_chunksINT
chunks*