Boyo Loop Reset
Punch a loop counter back to zero when a workflow section finishes
- trigger
- trigger_out
- reset_signal
- status
Loop counters are great until they aren't. The pack's counters persist in a cache across executions, which is exactly what makes a loop tick - and exactly what makes a completed run leak state into the next one. Boyo Loop Reset is the reset button: when a completion signal arrives, it bumps a reset signal for a named key that the loop system watches, and the counter starts over. It's the difference between "loop once, loop forever" and "loop once per run, cleanly."
The trigger input is the key idea. Wire it from a completion signal - a save node, the end of a workflow section - and the reset happens precisely when your pipeline says it's done, not when you remember to restart ComfyUI.
The inputs
- trigger - any completion signal. The reset fires when this runs.
- reset_key - the named reset channel, default
default. Loops wired to this key's reset signal get zeroed. - increment - how much the reset signal advances each trigger, default 1. Leave it unless you're deliberately sequencing multiple resets.
Outputs: trigger_out (your trigger, passed through so the chain continues), reset_signal (INT - the new reset signal value), and status (STRING, a human-readable confirmation).
Install
Part of Boyonodes. ComfyUI Manager → search "Boyonodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/DragonDiffusionbyBoyo/Boyonodes
Restart. No extra dependencies.
The mental model
Reset here doesn't mean "delete a value" - it means "tell loops on this key that they should start counting from zero again." The reset signal itself increments each time. So the practical rule is: match the reset_key to the loops you want reset, and trigger it exactly once per run. If counters come back stale between runs, it's almost always a missing reset node or a mismatched key. Slap it at the end of the workflow, feed it a signal from your final saver, and the state problem stops existing.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| trigger | * | — | |
| reset_key | STRING | default | — |
| incrementopt | INT | 11–100 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| trigger_out | * | — |
| reset_signal | INT | — |
| status | STRING | — |