DP Video Looper
Force a clip to loop, restart-cut or ping-pong
- video
- output_video
Getting a clip to loop cleanly out of most local video models is genuinely hard - it's specifically the one thing AnimateDiff held onto longer than anything else, and people are still asking, well into the Wan era, for a workflow that gets "a perfect loop using a reference start image without the 'ping-pong' effect." That last part is the tell: ping-ponging (playing forward, then reversing) is both a known trick people reach for and something people actively try to avoid when it's not what they actually want. This node gives you both, deliberately, so you pick the trade-off instead of getting stuck with whatever your source clip happened to do.
It's part of the animation set in DesertPixelAi's Desert Pixel pack.
How it works
Feed a frame batch into video, set Total_Frames (1–9999, default 100) for how long you want the final looped output to run, and pick mode:
StartOver_Mode- plays your clip through, then cuts straight back to the first frame and repeats, until it hitsTotal_Frames. Simple, but if your source clip's start and end frames don't already roughly match, there's a visible hitch at every loop point.BackAndForth- plays forward, reverses, plays backward, then forward again - the classic ping-pong/boomerang move. Because the frame right before the reversal is the next frame played, there's no hard cut, which is how it fakes a seamless loop out of a clip that was never actually designed to loop.
The output is output_video (IMAGE), the looped batch - hand it to a video-combine node, whose fps setting turns the frame count into actual playback duration.
One thing worth flagging: the pack's own README bills this node as having "crossfade transitions," but the actual interface is just these two modes - there's no blend-length or blend-mode input here. If you want a real crossfade rather than a hard cut or a reversal, that's this pack's separate DP Video Transition node, not something built into this one.
The inputs and outputs that matter
Total_Frames (how long you want the output) and mode (restart-cut vs. ping-pong) are the entire interface, on top of wiring your source clip into video.
How to install it
ComfyUI Manager: search Desert Pixel, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/DesertPixelAi/ComfyUI-Desert-Pixel-Nodes
Restart ComfyUI. No downloads. Under the DP category.
Common issues & troubleshooting
StartOver_Mode has a visible jump at the loop point. Expected, unless your source clip already starts and ends on near-identical frames. Either switch to BackAndForth, which never actually cuts, or generate your source with looping in mind from the start - some models are just naturally better at this than others (Hunyuan Video tends to produce natural loops around 201 frames, and it's the whole reason AnimateDiff held onto a niche this long).
BackAndForth looks obviously like it's reversing, not truly looping. That's the inherent trade-off of a ping-pong - motion visibly changes direction, which reads differently than a clip that genuinely continues forward. It's exactly the effect people are asking how to avoid when they want a "perfect loop." Reach for it when a hitch-free result matters more than the motion feeling continuous; skip it when it doesn't.
I wanted a real crossfade, not a hard cut or a reversal. This node doesn't do that - see the README/schema mismatch above. Chain in DP Video Transition between the clip's end and its restart if you want an actual dissolve.
The output is shorter or longer than my source clip. Total_Frames sets the output length, not a passthrough of your input length - the node fills that count by repeating or ping-ponging your source, not by trimming or padding it silently to match.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| video | IMAGE | — | |
| Total_Frames | INT | 1001–9999 | — |
| mode | COMBO | 2 options: StartOver_Mode, BackAndForth |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output_video | IMAGE | — |