Nodes/ComfyUI-Apt_Preset/AD_pingpong_vedio
ComfyUI Node

AD_pingpong_vedio

Fake a seamless loop by playing your clip backward

By cardenluo·Created 2 years ago·Updated 21 days ago· 309
AD_pingpong_vedio
  • images
  • images
startOffset0
endOffset0

Note the class name is literally AD_pingpong_vedio - typo and all - so that's exactly what you'll find it under in ComfyUI's node search.

This node does the oldest trick in the video-loop book: take your frame batch, tack the reverse of it onto the end, and now you've got something that plays forward then backward instead of just cutting back to frame one. It's the same "mirrored temporal padding" idea that shows up under the hood in newer video-extension tooling - Kijai's Wan Animate uses ping-pong reflection to pad clips to a valid frame count, for instance - except here it's exposed as a simple, standalone post-processing utility you can slap onto any image batch, no model or generation required.

The honest take

Set your expectations correctly: this is a bounce, not a genuinely seamless loop. AnimateDiff-era users used to get real closed loops out of the model's own temporal training; more recent video models generally can't do that natively, and the community's own verdict on the ping-pong workaround (talking about the equivalent trick on Wan) is that it "morphs visibly rather than cycling" - you can usually see the reversal point if you're looking for it, especially on anything with continuous directional motion like a camera pan. It's a good cheap trick for content that reads fine played backward (an object rotating, a loose fabric flutter, ambient motion) and a bad one for content that obviously shouldn't run in reverse (someone walking, water flowing one direction).

The inputs and outputs that matter

  • images (IMAGE) - your source frame batch, required.
  • startOffset (optional, default 0, range 0–100) - trims frames off the start before building the ping-pong sequence. Useful if the very first frame is a rough one you don't want doubled up at the bounce point.
  • endOffset (optional, default 0, range 0–100) - same idea, trims frames off the end.

Output is a single images (IMAGE) batch - your original sequence plus its reverse appended, offsets applied.

How to install it

Via ComfyUI Manager: search "ComfyUI-Apt_Preset". Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git

Then install.bat (Windows, double-click) or pip install -r requirements.txt (Linux/Mac), and restart ComfyUI. No models, no downloads - this is pure frame reordering, as lightweight as the pack gets.

Common issues & troubleshooting

Obvious "snap" at the bounce point. That's usually the same frame appearing twice in a row at the turnaround (last forward frame = first backward frame). Try endOffset at 1 to drop that duplicate frame before the reverse starts, which softens the visible seam a bit.

Doubled length breaks your downstream frame-count expectations. This node roughly doubles your batch size - if a downstream node needs an exact frame count (an LTX grid, an AnimateDiff window), account for that before this step or adjust after, since this node isn't aware of any target count.

Motion looks wrong played backward. No setting fixes this - it's a content problem, not a node problem. If your source clip has clearly one-directional motion (someone walking forward, liquid pouring), a ping-pong loop is going to look like it's playing in reverse for half the cycle, because it is. Save this trick for content where reversal reads as ambient rather than obviously backward.

Looking for a real seamless loop instead. This node can't do that - a true seamless loop needs either source footage that already starts and ends alike, or a generation-time technique (like a dedicated loop/join tool) rather than a post-hoc reflection trick.

CategoryApt_Preset/AD

Inputs (3)

NameTypeDefaultDescription
imagesIMAGE
startOffsetoptINT00–100
endOffsetoptINT00–100

Outputs (1)

NameTypeDescription
imagesIMAGE