Get Chunk
Grab Chunk Number N From the List — Including the Loop's Own Counter
- chunks
- chunk
- seed
Chunk Up splits a batch into pieces; Get Chunk hands you one specific piece. Feed it the chunk list and an index, and out comes the chunk at that position, ready to be processed. On its own that's a boring utility. Combined with ComfyUI's core For Loops, it's the node that turns "process in chunks" from a manual chore into a loop you can run unattended.
The README points at exactly this: attach the index input to the loop's remaining counter. A core For Loop counts down how many iterations are left, and Get Chunk is built to consume that count directly - as long as you have one_index enabled.
How it works
Two small behaviors make it loop-friendly:
- one_index (BOOLEAN, default true) - when enabled, the node uses negative indexing (
chunks[-index]). Because the loop's "remaining" value starts at the total chunk count and counts down, that negative index maps onto successive chunks: first iteration grabs chunk 0, next grabs chunk 1, and so on. Leave it off and it's plain 0-based indexing withchunks[index]. - Seed handling - the optional
seedinput and theseedoutput exist so every iteration of a loop can get a deterministic, distinct seed. The node returnsseed + index, so iteration 3 gets seed+3. Same run, same seeds; change the base and everything shifts consistently.
The inputs and outputs
- chunks (
*wildcard) - the chunk list from Chunk Up. - index (INT, default 0) - which chunk to pull. In a loop, wire the loop's remaining output here.
- one_index (BOOLEAN, default true) - on = negative indexing for loop compatibility.
- seed (INT, optional, default 0) - base for the derived per-chunk seed.
Outputs:
- chunk (
*) - the chunk you asked for, same shape Chunk Up gave you (latent dict, tensor, or list). - seed (INT) -
seed + index; wire it into your sampler inside the loop.
Common issues
- One-indexing surprises people. With
one_indexon,index=1returns the last chunk, not the first - it's Python negative indexing. If you're not driving this from a loop counter, flip it off and use 0-based indexes or you'll be very confused. - Out of range throws. Asking for an index past the end of the chunk list raises an
IndexErrorthat kills the whole workflow. If you're calculating the index yourself, clamp it against Chunk Up'samount_chunksoutput. - Keep one_index consistent. Toggling it mid-loop is a fast way to silently grab the wrong chunks.
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. Only dependency is rich (Manager installs it; pip install rich if you cloned by hand and hit an import error). No models, no keys. As with any single-author custom node pack, give the repo a quick read before you install - it runs as your user when it loads.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| chunks | * | — | |
| index | INT | 0 | — |
| one_index | BOOLEAN | true | — |
| seedopt | INT | 0 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| chunk | * | — |
| seed | INT | — |