Accumulation Head | Deforum
Pop the first item off an accumulation
- accumulation
- ACCUMULATION
- *
Accumulation Head is the dequeue operation for the Deforum pack's ACCUMULATION type: it peels the first item off the front of the list and hands you both the item and everything that's left. Think of it as list.pop(0) in node form - destructive in the sense that the output accumulation no longer contains that item, but non-mutating to the input (nothing in this family edits the bundle you pass in; you get a new one back).
What it gives you
Two outputs from one accumulation input:
ACCUMULATION- the rest of the list, with the first item removed.*- the head item itself, in whatever type you accumulated.
Feed the ACCUMULATION output back into the same node and you've got a consume-one-at-a-time loop: each iteration eats the next item off the front, which is exactly how you process a queue of latents, prompts or seeds in order without knowing the count in advance.
If the accumulation is empty, the node doesn't error - it passes the (empty) accumulation through and outputs None for the head. That None is the useful part: it's the plumbing pattern from the ComfyUI node layer where an optional downstream input reads "nothing connected" and a fallback switch like Any Switch | Deforum skips to its next candidate. You can branch on an exhausted list without crashing the graph.
When head, not item-by-index
The sibling Accumulation Get Item | Deforum jumps straight to an index; this one consumes from the front, so it's the right tool when you're processing a collection rather than peeking at one entry. The first frame's latent, the first prompt, the first seed - if you want the front of the line repeatedly, head is the one.
Installing it
Part of the deforum-comfy-nodes pack (official Deforum project). ComfyUI Manager: search "deforum" (comfyui-deforum), install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/deforum-art/deforum-comfy-nodes
Restart ComfyUI after. No pip install needed and no models to download for this node. If load errors appear later, check for an orphaned deforum pip package and pip uninstall deforum to clear it.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| accumulation | ACCUMULATION | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| ACCUMULATION | ACCUMULATION | — |
| * | * | — |