VACE Final Loop Prep
Turn one clip into a seamless loop
- video
- control_video
- control_mask
- loop_body
- width
- height
- length
- context_frames
- replace_frames
- new_frames
Making a seamless loop used to be the one thing AnimateDiff held over Wan. It isn't anymore - you generate a tail-to-head transition and stitch it into a loop, and VACE Final Loop Prep is the node that builds the control window for that transition from a single clip. It's the "loop a clip back on itself" version of VACE Join Prep, which is the two-clip version.
How it works
Give it one IMAGE clip (your video as frames). It takes the tail of the clip and the head of the clip, packs them around a gray filler block, and hands you a control_video + control_mask that tells VACE "regenerate this middle stretch, using the tail on one side and the head on the other as guidance." The model effectively has to produce a transition from the clip's last moments back into its first moments - which, stitched together, is a loop.
The layout mirrors VACE Join Prep: control_video = tail context + gray filler + head context, and the control_mask is ones only across the filler (the area to regenerate). Three numbers shape it:
context_frames(default 8) - how many real frames on each side anchor the transitionreplace_frames(default 8) - how many frames at the tail/head get replaced by generated contentnew_frames(default 0) - extra generated frames on top, if you want the loop to breathe
The node also carves out loop_body - the middle of the clip with context + replace frames trimmed off each end - which becomes the "original" part of the loop.
Inputs and outputs that matter
Inputs: video (IMAGE), the three numbers above, and debug. Outputs: control_video + control_mask (into your VACE control nodes), loop_body (into VACE Final Loop Assemble), plus width, height, length and echoed copies of the three frame-count params for wiring into samplers and other bookkeeping.
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 install via ComfyUI Manager (search "comfy-vace-automation").
When it bites you
- Clip too short. The node requires at least
2 × (context_frames + replace_frames) + 1frames - it needs enough real footage to anchor both sides and leave a middle. A 33-frame clip with default settings will error. Use a longer source clip or shrink the context/replace numbers. - Dimensions not divisible by 16. Same rule as every Wan pipeline: VACE control wants multiples of 16. Resize before you get here.
- A "loop" that's mostly transition. If
context_framesandreplace_framesare large relative to the clip,loop_bodyshrinks toward nothing and the result is a transition pretending to be a loop. Keep context + replace comfortably smaller than half the clip.
The final-loop path in this pack is meant to be the last pass of a longer join - the README describes it as "one final tail-to-head loop pass after the last normal seam." So don't read this as a standalone loop maker so much as the capstone that closes a multi-clip project back into itself.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| video | IMAGE | — | |
| context_frames | INT | 81–4096 | — |
| replace_frames | INT | 80–4096 | — |
| new_frames | INT | 00–4096 | — |
| debug | BOOLEAN | false | — |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| control_video | IMAGE | — |
| control_mask | MASK | — |
| loop_body | IMAGE | — |
| width | INT | — |
| height | INT | — |
| length | INT | — |
| context_frames | INT | — |
| replace_frames | INT | — |
| new_frames | INT | — |