Accumulation Get Length | Deforum
How many things did the loop actually produce?
- accumulation
- INT
This is the boring node every list system needs and nobody gets excited about: it tells you how many items are in an ACCUMULATION. One input, one integer output. len() with a wire on it.
In a Deforum animation you're usually accumulating inside a loop, and the whole point is that you don't know the count in advance - you set remaining on the For Loop Open and trust the loop to run that many times. Length is your verification. Hook it to Debug Print | Deforum and you can see at a glance whether the loop ran the number of iterations you expected, or whether an early exit (a blocking condition, an error path) silently produced a shorter list than the frame count you asked for.
It also earns its keep feeding bounds into things. Accumulation Get Item | Deforum will hard-crash on an out-of-range index, so wiring Get Length (or a derived length - 1) into a clamp or a comparison keeps your indexing honest. If you're building a For Loop whose iteration count depends on how much you accumulated in a previous pass, this is the node that hands the loop its upper bound.
Inputs and output
accumulation- theACCUMULATIONbundle.- Output:
INT- the number of items currently in it. Zero on an empty accumulation, which is a legitimate result you can branch on rather than an error.
That's the whole spec. If you're doing more than reading this number and feeding it somewhere, you're probably overcomplicating a count node.
Installing it
Ships in deforum-comfy-nodes, the official Deforum project's ComfyUI pack. Install via ComfyUI Manager (search "deforum", listed as comfyui-deforum) and restart, or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/deforum-art/deforum-comfy-nodes
Restart ComfyUI after cloning. No extra dependencies, no model downloads - the pack runs on what ComfyUI already ships. Known install hiccup, if you ever see load errors: an orphaned deforum pip package shadowing the pack. pip uninstall deforum and restart sorts it.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| accumulation | ACCUMULATION | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |