Dynamic Queue Counter
A counter that survives between runs — the heartbeat of loop workflows
- FLOAT
- INT
- Info
Dynamic Queue Counter is the node you wire up when you want a number to tick forward every time you hit queue. ComfyUI's normal nodes are stateless - re-run a graph and everything recomputes identically. This one is deliberately not: it keeps a persistent counter across queue runs, increments it by step each time, and hands you the running total as float, int, and a human-readable string. If you've ever tried to build a "process this folder, one file per run" or "step through styles one generation at a time" workflow, you know this is the missing piece.
The mechanism is a classic counter with a twist. Set start, stop, and step - say 0, 8, and 1 - and the counter runs 0, 1, 2 … 8, then wraps back to start and loops. The reset boolean restarts it to start when you flip it. The node declares ALWAYS_RUN = True, which is the bit that matters: it marks itself as needing to execute every run even when nothing upstream changed, so the counter actually advances when you queue repeatedly with no other changes. That flag is the entire difference between this and a node that just sits there.
The inputs are minimal and all floats: start (0), stop (8), step (1), reset (false). The three outputs: FLOAT and INT (same value, two types - you'll usually grab the int to feed an index), plus Info, a string describing the current state for debugging or display.
The natural partners in this pack: pair it with Load Image Batch (Fun) in single_image mode and the index input becomes "which file to load this run." Pair it with Indexed String Selector and each run pulls the next style from a list. The README's own framing - "create loops" - is right, with one clarification: this is a manual loop driver, not an auto-loop. ComfyUI's built-in batch controls still don't see it, so you're queuing runs yourself (or with an auto-queue tool) and letting the counter walk forward. That's a feature for many workflows - you can inspect each output before the next run - and a limitation if you wanted true unattended batching.
Gotchas worth knowing. The state is in-memory, so it resets on ComfyUI restart or when the node is deleted/recreated - that's the honest "persistent" scope. And reset as a boolean widget is a toggle, not a pulse: flip it true, run, flip it false, run, or the counter behavior will surprise you. Keep stop inclusive: at start=0, stop=8 it counts 0 through 8 inclusive before wrapping.
Install is the pack standard: ComfyUI Manager search "Node Fun", or clone https://github.com/nofunstudio/Node_Fun_ComfyUI into custom_nodes, pip install -r requirements.txt, restart. No keys, no models, no dependencies beyond the pack itself. It's a tiny node, but for anyone building iterating workflows it's the difference between "retype the index every run" and "hit queue and watch it walk."
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| start | FLOAT | 0.00 | — |
| stop | FLOAT | 8.00 | — |
| step | FLOAT | 1.00 | — |
| reset | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | — |
| INT | INT | — |
| Info | STRING | — |