🏁 Loop Start (Index)
How 'Queue once' actually knows where it is
- current_loop_index
The whole sales pitch of comfyui-sequential-batcher is that you click Queue Prompt once and the graph renders a long video in chunks, re-queuing itself until it's done. This node is why that's possible. SequentialLoopStart is the state keeper - the thing that holds the current loop index and hands it to every calculator, selector, and stitcher in the graph.
Think of it as the counter at the top of a for loop that never returns. Every cycle, the pack's Loop Trigger node (its sibling in the Loop category) bumps loop_idx, re-queues the whole prompt, and this node starts the next iteration with the updated index. Without it, each chunk would run the exact same math and you'd render the same 12 frames forever.
How it works
It's simpler than the name suggests, with one genuinely clever bit. On execution it checks which loop iteration it's on (loop_idx) and, unless you asked for a reset, stores it as the global loop index. It also resets the pack's global accumulators to zero when loop_idx == 0 or reset_loop is true - so a fresh start actually starts fresh. The clever bit: a port check. Before anything else, it pings ComfyUI's /system_stats endpoint on the port you give it, and if your port input doesn't match the server's real port, it silently forces the system port. That's an SSRF guard from the author - this pack reaches back into its own server to re-queue prompts, and it refuses to trust a spoofed port. If the port is unreachable after three tries, it hard-fails with a clear error.
Inputs and outputs
Three inputs, all with sane defaults:
port- your ComfyUI port, default 8188. Set it to match however you launch ComfyUI (--port 3000etc.), or the node will correct it for you anyway.loop_idx- normally you never touch this; the Loop Trigger writes it each cycle. Manually setting it is how you skip ahead or resume.reset_loop- set true to wipe the loop state back to zero, e.g. when switching to a new video.
Output is a single current_loop_index INT. That one wire goes everywhere: into your Auto Loop Calculator, the Audio Batch Selector, the Session Sender/Receiver pair, the Director, and the Stitcher. If you only remember one thing, it's this - the index drives the timeline.
Installing it
Part of comfyui-sequential-batcher:
cd ComfyUI/custom_nodes
git clone https://github.com/Meisoftcoltd/comfyui-sequential-batcher
or ComfyUI Manager, search "comfyui-sequential-batcher", restart. Nothing extra to download.
Common issues
The classic mistake is forgetting the Loop Trigger at the end of the graph - without it, nothing re-queues and the loop runs exactly once, which looks like a "broken" workflow. The other one: the fatal port error. If you see EL PUERTO ... NO RESPONDE, your ComfyUI is either on a different port or wedged; check how you launched it. And don't set reset_loop true mid-video - you'll blow away the accumulated frame counter and the next chunk will restart from frame zero.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| reset_loop | BOOLEAN | false | — |
| loop_idx | INT | 00–10000 | — |
| port | INT | 81881–65535 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| current_loop_index | INT | — |