Nodes/VACE Automation/VACE Clip Loop End
ComfyUI Node

VACE Clip Loop End

Close the loop — this is where the recursion actually happens

By EnviralDesign·Created 6 months ago·Updated 3 months ago· 0
VACE Clip Loop End
  • flow
  • joined_clip
  • images
  • fps
next_index
is_last
fps

Every loop needs a head and a tail. VACE Clip Loop Start hands you the current clip pair; VACE Clip Loop End is what actually closes the loop and decides whether to run the whole seam pipeline again. When you wire up a looping VACE join, this is the node sitting at the bottom of the graph, and it's doing a lot more work than its input list suggests.

How it works

Loop End receives the loop state from Loop Start (flow, next_index, is_last), the accumulated joined_clip, and the shared fps. Then it makes one simple decision:

  • is_last is true → done. It returns joined_clip and fps straight out, and that's your final video.
  • is_last is false → it needs to run the seam one more time. This is where the magic happens: the node uses ComfyUI's GraphBuilder to clone the loop body into a new iteration, bumps next_index by one, and feeds the current joined_clip back in as the accumulator_clip. The graph effectively re-expands and re-executes the seam with the joined result carried forward.

That "expand" step is the whole trick behind in-memory looping - ComfyUI has no native loop construct, so the node synthesizes one by rebuilding the subgraph with updated inputs. It's the reason this pack can promise "loops across an ordered in-memory clip list without saving intermediate videos."

Inputs and outputs

All five inputs are wired from VACE Clip Loop Start: flow, next_index, is_last, joined_clip, and fps. The joined_clip needs to be a valid IMAGE frame batch (the assembled output of your seam), and flow uses the special FLOW_CONTROL type with a raw link, so just drag from the matching output.

The two outputs are images and fps. The images output is the one you run to your VAE decode, video save, or preview - after the final iteration, that's the complete joined clip.

Installing it

Part of the comfy-vace-automation pack, no extra pip dependencies:

cd ComfyUI/custom_nodes
git clone https://github.com/EnviralDesign/comfy-vace-automation

Restart ComfyUI, or use ComfyUI Manager and search "comfy-vace-automation".

When it bites you

  • "GraphBuilder is unavailable" - this is the big one. Loop End depends on comfy_execution internals, which only exist in a reasonably recent ComfyUI. If you see this error, update ComfyUI itself, not just the pack. Old installs simply can't do in-memory graph expansion.
  • joined_clip must be a proper [frames, H, W, C] tensor. If you feed it something a shape check rejects, the error says so plainly - check what your seam assemble actually output before chasing Loop End.
  • A stale is_last. Because Loop End trusts the boolean it's handed, make sure it's actually connected to Loop Start's is_last and not to some manually-wired value, or the loop will stop one seam early (or one seam late) and you'll get a mysteriously short video.

If you're comfortable with the concept, Loop End is also the node to point at when someone asks "how does this pack do loops without saving files?" The answer lives in that expand call - it's hand-rolled recursion on top of ComfyUI's execution graph.

Categoryvideo/VACE

Inputs (5)

NameTypeDefaultDescription
flowFLOW_CONTROL
next_indexINT
is_lastBOOLEAN
joined_clipIMAGE
fpsFLOAT

Outputs (2)

NameTypeDescription
imagesIMAGE
fpsFLOAT