Batch Stepper π Just Nodes
Run a batch, then step β the loop node for hands-off prompt rotation
- select
Batch Stepper is the node that automates "run this N times, then move on." It outputs a single INT called select that stays at one value for a run of total_runs queue executions, then increments, all the way up to step_limit, then wraps back to zero. Wire that integer into a Picker's select, a Labeled Index, an Image From Folder's index, or any other index input, and you've got a hands-off rotation loop that ComfyUI's built-in control_after_generate can't express in one shot.
The clever part is that it's front-end driven. The heavy lifting lives in the pack's JavaScript: a display-only run counter (never sent to the backend) counts how many times you've queued, and when the graph finishes, the script bumps run, re-queues, and only when run hits total_runs - 1 does it step the actual step value that the backend outputs. Because the backend node itself is a pure passthrough - it returns step and nothing else - ComfyUI's downstream cache stays intact, so your sampler and VAE decode results aren't recomputed between runs unless their inputs actually changed. That's the real reason this exists: a JS-side counter that doesn't dirty the cache, versus the usual hack of re-queuing everything.
The inputs that matter:
- total_runs - how many queue executions happen at each step value before it increments (default 10).
- step - the current value being output; it's an input so you can inspect and override it.
- step_limit - how many distinct steps to cycle through before wrapping to 0 (default 5).
- mode - a Run/Stop boolean. Flip it off and the loop stops auto-advancing.
So with total_runs=3, step_limit=4, the output goes 0,0,0, 1,1,1, 2,2,2, 3,3,3, then back to 0. Pair that with a Picker x4 and you've rotated through four prompts, three runs each, and walked away from the keyboard.
Installing it
Same as every Just Nodes node: ComfyUI Manager β search "Just Nodes" β install β restart, or cd ComfyUI/custom_nodes && git clone https://github.com/Arroz-11/ComfyUI-Just-Nodes.git. No models, no extra dependencies, MIT licensed.
Gotchas
- It re-queues by itself. The JS watches for a finished run and fires a new queue prompt. If you didn't expect it to keep going, it will.
stepstarts at 0 and the loop only advances it after the full run count - the firsttotal_runsexecutions all output 0.- It's a JS-driven node, which means it depends on the front-end extension loading. ComfyUI's Nodes 2.0 canvas rewrite has a history of breaking front-end-driven custom nodes (rgthree's broke the same way), so if the node ever stops auto-stepping after a ComfyUI update, that's the first thing to suspect.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| total_runs | INT | 101β18446744073709550000 | β |
| step | INT | 00β18446744073709550000 | β |
| step_limit | INT | 51β18446744073709550000 | β |
| mode | BOOLEAN | true | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| select | INT | β |