ComfyUI Node

Ares Loop Control

Run the same H3 graph eight times without clicking Queue eight times

By SuperWJ062·Created 2 months ago·Updated about a month ago· 1
Ares Loop Control
    • iterations_text
    ◄iterations1►

    ComfyUI has no while loop. That's not a gap anybody's about to fix, because the graph is a DAG: there's no edge that runs backwards, and the queue runs a workflow once, top to bottom. So if you want a long video assembled from a dozen 5-second H3 generations, you either click Queue a dozen times or you cheat.

    Ares Loop Control is the cheat, and it's honest about being one: it's a widget with a number, plus some JavaScript in the frontend that re-queues your graph whenever a run finishes successfully.

    How it works

    Set iterations to how many rounds you want. When the run completes, the pack's frontend extension catches the execution_success event, finds every Ares Loop Control node in the graph, decrements its widget by one, and - as long as there's still count left - grabs a fresh prompt snapshot out of the canvas and shoves it back into the queue. That's it. There's a re-entrancy guard so a fast double-fire doesn't queue two rounds at once, and that's the entire feature.

    Which means: the loop lives in your browser, not in your ComfyUI server. Nothing on the backend knows it's looping. If you close the tab, the next round never gets queued. If you reload the page mid-loop, you've stopped it. The countdown is real state inside the live graph too - the widget genuinely decrements, so if you hit Ctrl+S after a 6-round run, you've saved the drained value, not the nice 6 you typed.

    iterations counts the current run, not the extra ones. Set it to 5 and you get 5 total generations - the one you queued by hand plus four automatic re-queues. It's clamped between 1 and 100, which is a sensible ceiling; remember that a 12-second H3 clip takes a while, so 100 rounds is an overnight job, not a coffee break.

    Inputs and outputs

    One input: iterations, an INT from 1 to 100, default 1.

    One output: iterations_text, the current round count as a STRING. That's not decoration - it's how you label the round. Feed it into a text concatenation ahead of Ares Save Video's filename_prefix, or into your prompt, and each round's file and prompt says which round it is. Without it, every round writes to the same prefix and you're left identifying clips by timestamps.

    The node also declares itself an output node, so it's always part of the executed set even if its output is unconnected. That's deliberate: a loop controller that gets pruned from the graph would never fire.

    Pulling the parts together

    The loop only means something when it's wired to the other three nodes:

    [Ares Load Last Video] → [Ares Trim Video] → ref_image_0 / ref_video_0
                                                 ↑
            [MiniMax H3 Reference to Video] → [VAE Decode] → [Ares Save Video]
                                                 ↑
                                          [Ares Loop Control]
    

    Round one loads your initial_video (or whatever's newest in output), trims a tail, and uses it as H3's reference. The result decodes, gets saved. The round ends, Ares Loop Control decrements and re-queues, and now Ares Load Last Video sees a newer file and loads that instead. Clip two continues clip one. Repeat until the counter hits 1.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/SuperWJ062/ComfyUI-ares_MiniMaxH3_IntelligentPrompt
    

    Restart ComfyUI. No requirements.txt - the backend uses only torch and folder_paths. The catch is on the other side: because the auto-rerun is frontend code (js/loop.js, registered as a normal ComfyUI extension), you need a reasonably current ComfyUI frontend, and the pack expects the newer io.ComfyNode backend API too. On an old install the nodes won't even register.

    Standard model caveat for everything in this pack: no weights are included. H3 is ~42.5GB, and its community licence excludes the US, EU, UK and South Korea.

    The traps

    Nothing loops and no error appears. Almost always: the run failed somewhere, so execution_success never fired and the frontend never re-queued. A failed mid-loop round looks exactly like a finished job - check the log, not the canvas.

    It loops but every clip is identical. That's ComfyUI's cache, not the loop. If nothing downstream of your sampler actually changed between rounds, the engine replays the previous outputs. Ares Load Last Video fights this with a file modification fingerprint, but it can only help if its output is genuinely feeding the sampler. Wire the reference through and the loop will produce real new video.

    Six rounds become two. You closed the tab, or browsed away and let the page sleep. Keep the ComfyUI window visible until the counter drains.

    The countdown is at 1 when you reopen the workflow. Working as intended - the widget is live state. Set iterations again before each loop run.

    CategoryAres

    Inputs (1)

    NameTypeDefaultDescription
    iterationsINT11–100Number of loop rounds (including the current one).

    Outputs (1)

    NameTypeDescription
    iterations_textSTRINGText value of the current round count.