Nodes/deforum-comfy-nodes/Accumulation Get Item | Deforum
ComfyUI Node

Accumulation Get Item | Deforum

Pluck one value out of an accumulation

By deforum·Created about a year ago·Updated 3 months ago· 29
Accumulation Get Item | Deforum
  • accumulation
  • *
index0

An ACCUMULATION is this pack's growable list - the thing Accumulate | Deforum builds up as a loop runs. But a bundle of ten latents is only useful if you can pull individual ones out again. That's this node: it's list[index] for the Deforum accumulation type, and nothing more.

You'll reach for it after a For Loop has finished and you want one specific result out of the pile - the fifth frame's latent for a preview, the seed from frame 30 so you can reproduce it, a single prompt out of a hundred. The alternative to indexing is unrolling the whole accumulation, which wastes memory and is the kind of thing that makes a graph unreadable. Indexing is the clean way.

Inputs and output

  • accumulation - the ACCUMULATION bundle you collected earlier.
  • index - an INT, default 0, stepping by 1. Standard zero-based indexing, so frame one is 0.

The single * output hands you the item at that position, whatever type it was when you accumulated it - latent in, latent out.

The one real gotcha

Go out of bounds and you get a hard Python IndexError that kills the whole run, not a graceful "nothing here." If your index is computed (say, frame count minus something), guard it: check the size first with Accumulation Get Length | Deforum, or clamp the index with a math node. And remember the zero-based thing - it bites everyone exactly once, usually by returning the previous frame than the one they wanted.

Otherwise there's not much to this node, and that's a compliment. It's the read accessor the accumulation family would feel broken without.

Installing it

Part of the deforum-comfy-nodes pack. ComfyUI Manager: search "deforum" (listed as comfyui-deforum), install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/deforum-art/deforum-comfy-nodes

Then restart ComfyUI. No extra Python dependencies and no model files - the pack is plain Python over torch/numpy/Pillow, which ComfyUI already provides. If you ever hit load errors after upgrading, an orphaned deforum pip package is the usual culprit; pip uninstall deforum fixes it.

CategoryDeforum/Lists

Inputs (2)

NameTypeDefaultDescription
accumulationACCUMULATION
indexINT0

Outputs (1)

NameTypeDescription
**