Nodes/MKRShift_Nodes/Video PingPong
ComfyUI Node

Video PingPong

Forward, then backward, repeat

By criskb·Created 7 months ago·Updated 5 months ago· 0
Video PingPong
  • video
  • video
  • output_path
  • summary
loop_count2
include_end_framesfalse
fallback_fps24.0
output_formatauto
filename_prefixMKR_pingpong_video
subfolder
overwritefalse
filename_label

MKRVideoPingPong turns a clip into a loop by playing it forward and then backward, over and over. This is the cheapest seamless loop there is: because the motion reverses at each turn instead of jumping to frame zero, there's no seam to hide - the turnaround is the effect. If you've ever looped a clip with a hard cut and watched the jump, pingpong is the fix that needs no crossfade and no care.

Mechanically it's simple: decode the clip, append the reversed frames, repeat that forward-backward pair loop_count times (default 2, up to 64), and write it out. The one input worth thinking about is include_end_frames. It defaults to false, meaning the turnaround frame is shared between the forward and backward passes - so the motion reaches the end and immediately heads back with no repeated frame. Flip it true and the boundary frame plays twice, which reads as a brief pause at each turn. For most footage the default is right: false gives you the smooth bounce. For footage where the pause reads as intentional (a beat, a held moment), flip it on.

The inputs that matter

  • video - any resolvable video (path string, dict with path, MKR_VIDEO payload, VHS-style dict).
  • loop_count - pairs of forward-backward. 2 is plenty to judge the bounce.
  • include_end_frames - false (default) shares the turnaround frame; true duplicates it. See above.
  • fallback_fps, output_format, filename_prefix, subfolder, overwrite - the standard pack quartet.

Outputs: video (MKR_VIDEO payload), output_path, summary.

Install

Part of MKRShift Nodes - install the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes

or ComfyUI Manager → search MKRShift_Nodes → restart. mp4/mov/webm needs system ffmpeg on PATH; gif/webp work without it. No pip dependencies.

Where people get burned

The usual surprise is the pause at the turns - and if that's happening with include_end_frames off, the cause is actually the reverse: the turnaround frame is shared, so the turn is smooth by construction. A visible pause usually means the source has a hold or a slow section at its end, and pingpong faithfully replays it. Second: no audio. Frame-based processing means the output is silent; mux sound back on if the clip had any. And pingpong doubles effective length per pair - a 5-second clip at loop_count 4 is a 40-second video (minus the shared frame), so don't be confused when the output is much longer than the source.

CategoryMKRShift Nodes/Media/Video/Edit

Inputs (9)

NameTypeDefaultDescription
video*
loop_countINT21–64
include_end_framesBOOLEANfalse
fallback_fpsFLOAT24.01–240
output_formatCOMBOauto6 options: auto, gif, webp, mp4, mov, webm
filename_prefixSTRINGMKR_pingpong_video
subfolderSTRING
overwriteBOOLEANfalse
filename_labeloptSTRING

Outputs (3)

NameTypeDescription
videoMKR_VIDEO
output_pathSTRING
summarySTRING