Boyo Loop Counter
A no-fuss counter for loop logic that doesn't need the heavy loop nodes
- trigger
- count
- is_complete
- trigger_out
Sometimes you don't need a full loop architecture. You just need a number that ticks up every time the workflow runs, so you can make decisions on it. Boyo Loop Counter is that number. Give it a trigger, and every execution it reads the current count from the pack's cache, bumps it by the increment, and hands you the new value, a "are we done yet?" boolean, and your trigger passed through.
It's deliberately simpler than the pack's While/For loop nodes - the README pitches it as an alternative when "you just need a basic counter." The counter state lives in a named slot (counter_id), which is what makes it persistent across executions and what lets Boyo Loop Reset zero it from elsewhere in the graph.
The inputs that matter
- trigger - anything. Wiring it ensures the counter runs after whatever feeds it (e.g. after a sampler), so the count only advances when you expect it to.
- counter_id - the named counter slot, default
counter_1. Different IDs count independently; same ID, same running total. - increment - how much to add per execution, default 1.
- max_count - the threshold that flips
is_complete, default 6. - reset_to_zero - when true, resets the counter to 0 on this execution instead of incrementing. Handy as an explicit reset without a separate node.
Outputs: count (INT, the new value), is_complete (BOOLEAN, true once count reaches max_count), and trigger_out (your trigger, unchanged - chain it onward).
Install
Part of Boyonodes. ComfyUI Manager → search "Boyonodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/DragonDiffusionbyBoyo/Boyonodes
Restart. No extra dependencies.
Where it fits
The obvious wiring: counter → Boyo Frame Counter for frame math, and is_complete into a Compare or gate node to decide whether to keep looping or stop. Because it's cache-backed, a stuck or surprising count almost always means the same counter_id is being used in two places, or a Boyo Loop Reset fired when you didn't expect it. Keep IDs unique and the numbers behave.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| trigger | * | — | |
| counter_id | STRING | counter_1 | — |
| increment | INT | 10–100 | — |
| max_count | INT | 61–1000 | — |
| reset_to_zeroopt | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| count | INT | — |
| is_complete | BOOLEAN | — |
| trigger_out | * | — |