WanVideo Loop Args
Seamless looping Wan clips via latent shift
- loop_args
Seamless loops were the one thing AnimateDiff did that Wan couldn't. If you wanted a clip that cycles forever with no visible cut, the old advice was "go back to AnimateDiff." WanVideoLoopArgs is one of the answers to that - it makes Wan generate a clip whose end flows back into its beginning, by looping through a latent shift during sampling. The technique comes from the Mobius project (YisuiTT/Mobius).
This is a genuinely nice-to-have for anything ambient: a flickering candle, drifting clouds, a subtle idle animation, a cinemagraph-style background. Instead of generating a clip and hoping the ends match, or ping-ponging it (play forward, play reverse - which always looks a bit off), you bake the loop into the generation itself.
How it works
Latent shift is the mechanism. During denoising, the node cyclically shifts the latent frames so the model is effectively sampling on a loop rather than a straight timeline - the last frames are conditioned to resolve into something continuous with the first. Because it operates in latent space across the sampling process, the seam is dissolved by the model, not stitched afterward. The node emits a LOOPARGS bundle that the sampler picks up to do this.
The inputs that matter
shift_skip(INT, default 6) - how far the latent shift steps each time. This is the main knob controlling the loop behavior; the default is a sensible start, and you'll adjust it if the loop feels too tight or the motion doesn't come back around cleanly.start_percent(default 0) andend_percent(default 1) - the fraction of the sampling schedule over which the looping is applied. Defaults run it across the whole schedule. Narrowing the window (say, applying it later) is a power-user move if you find the loop is fighting composition in the early steps.
The output is loop_args (LOOPARGS) - wire it into the sampler.
How to install it
ComfyUI Manager: search ComfyUI-WanVideoWrapper, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-WanVideoWrapper
pip install -r ComfyUI-WanVideoWrapper/requirements.txt
then restart. No extra download - the loop is a sampling behavior, not a model.
Common issues & troubleshooting
The loop still has a visible hitch. Looping works best on continuous, ambient motion. Big directional action - someone walking across frame, a camera pan - doesn't want to return to its start, so the "loop" fights the content and you see it. Keep the motion cyclical or subtle, and tune shift_skip.
It's not the only way to loop anymore. If you're assembling longer footage rather than making one perfect cycle, the ComfyUI VACE Video Joiner added a "Make Loop" toggle that generates a transition from your final clip back to your first - a morph-style join rather than a true cycle, but useful for stitched sequences. Different tool, different job: WanVideoLoopArgs bakes the loop into a single generation; the Joiner welds separate clips into a loop. Test both against your footage.
Frame count math. The Wan VAE compresses time roughly 4x, so your frame count wants to land on a valid 4n+1 value (81 is the community default). A loop that comes back a couple frames short is usually this - pick a frame count that divides cleanly rather than fighting the loop node.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| shift_skip | INT | 6 | Skip step of latent shift |
| start_percent | FLOAT | 0.000–1 | Start percent of the looping effect |
| end_percent | FLOAT | 1.000–1 | End percent of the looping effect |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| loop_args | LOOPARGS | — |