๐น video PingPong
Make a clip loop by bouncing it back
- images
- IMAGES
You generated a short animation - AnimateDiff, a Wan clip, an interpolated batch - and it looks great until it hits the last frame and snaps back to the start with an ugly jump. Ping Pong is the cheap fix. It takes your frames, plays them forward, then plays them backward, so the clip "bounces" instead of cutting. The end frame flows straight into the reverse, and the reverse flows back to the start, so the whole thing loops forever with no visible seam. It's the boomerang effect, basically.
That's the entire trick, and it's a genuinely good one for social-media loops, background video, or anything you want to autoplay on repeat without a stutter.
How it works
The node reverses your frame sequence and stitches it onto the end of the original. Frame batch goes in, a longer frame batch comes out - roughly double the length, since you're now getting the forward pass plus the return trip. There's no model, no sampling, no VRAM cost worth mentioning; it's just reordering tensors.
You can feed it frames two ways. Either wire an images batch straight in from whatever produced your animation, or hand it a video_path (a string path to a video file) and let it read the frames off disk. Most people use the images route because the frames are already in the graph.
The inputs and outputs that matter
images(IMAGE) - your frame batch. This is the normal input.video_path(STRING) - an alternative source: point it at an existing video file instead of passing frames. Use one or the other, not both.use_python_ffmpeg(boolean, default off) - only relevant when you're reading fromvideo_path. It flips between the python-ffmpeg binding and calling system ffmpeg. Leave it off unless the default errors on your setup.
The single output is IMAGES (IMAGE) - the bounced frame batch. Wire it into a video-save node (this pack's own Images to Video, or VideoHelperSuite's combine) or a preview. Ping Pong itself doesn't write a file; it just hands you frames.
How to install it
Easiest path is ComfyUI Manager: open the Manager, search Bjornulf_custom_nodes, install, restart. Manual install is the usual clone:
cd ComfyUI/custom_nodes
git clone https://github.com/justUmen/Bjornulf_custom_nodes
pip install -r Bjornulf_custom_nodes/requirements.txt
then restart ComfyUI. The requirements pull in ffmpeg-python among others, and the video_path branch of this node leans on ffmpeg being present - if you're only passing an images batch you barely touch that path, but it's good to have installed anyway.
Common issues & troubleshooting
Your clip is now twice as long. That's by design - forward plus reverse. If your saved video runs at the wrong speed, that's your fps setting on the save node, not Ping Pong.
Slight hitch at the turnaround. Depending on how the frames line up, the very first and very last frames can read as a tiny pause. It's usually invisible at 24fps; if it bugs you, trim a frame off either end before feeding it in.
No audio. Ping Pong is frames only - it has no concept of a soundtrack, and a reversed clip wouldn't have sensible audio anyway. Add sound downstream at the video-assembly step.
Reading from video_path fails. That's an ffmpeg problem, not a Ping Pong one. Confirm ffmpeg is installed, and try toggling use_python_ffmpeg. Feeding an images batch sidesteps the whole issue.
One honest caveat about the pack as a whole: it's a big, solo-maintained, "very active development" collection, and the author flags breaking changes between versions fairly often. Ping Pong is simple enough that it rarely gets caught up in that, but pin a version if you're building something you can't afford to have shift under you.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| imagesopt | IMAGE | โ | |
| video_pathopt | STRING | โ | |
| use_python_ffmpegopt | BOOLEAN | false | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGES | IMAGE | โ |