Video Loop Builder
Loop a clip N times, with an optional crossfade to hide the seam
- video
- video
- output_path
- summary
MKRVideoLoopBuilder repeats a clip a set number of times and writes out one longer video. On the surface that's trivial - but the reason this node exists is the crossfade_sec input, because a hard loop of most footage is jarring, and a tiny crossfade at the seam is the classic trick for making it read as a loop instead of a copy-paste.
It works the way you'd hope: decode the clip to frames, stack the sequence loop_count times, and if crossfade_sec is above zero, blend the end of the clip back into the beginning over that window so the turnaround is a dissolve rather than a jump. loop_count defaults to 2 (play it twice) and goes up to 64; crossfade_sec defaults to 0 (a plain hard loop) and up to 10.
The inputs that matter
video- any resolvable video (path string, dict withpath, anMKR_VIDEOfrom a sibling node).loop_count- how many times to repeat. 2 is usually enough to see if the seam works.crossfade_sec- the seam smoother. Start at 0.1–0.5s, not 3. Too big and the loop starts eating real content on both sides and the whole thing turns to mush. This is the input that separates "looped" from "a loop."fallback_fps,output_format,filename_prefix,subfolder,overwrite- the standard pack inputs.
Outputs: video (MKR_VIDEO payload), output_path, summary.
Install
Ships in 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 output needs system ffmpeg on PATH (README is explicit); gif/webp work without it. No pip dependencies.
Where people get burned
Two things. First, audio: frame-based repeat means the output is silent - a looped clip with its soundtrack still attached is not what this gives you, so mux audio back on if you need it (the pack's MKRMuxVideoAudio covers that). Second, don't crossfade a clip that isn't long enough: if crossfade_sec approaches the clip's own duration you're blending almost everything into everything and the "loop" becomes a wash. Keep the crossfade a small fraction of the clip length. And if your source was designed to loop (a texture tile, a seamless render), leave crossfade_sec at 0 - a perfect loop needs no seam hiding, and a hard cut stays cleaner than an artificial dissolve.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| video | * | — | |
| loop_count | INT | 21–64 | — |
| crossfade_sec | FLOAT | 0.000–10 | — |
| fallback_fps | FLOAT | 24.01–240 | — |
| output_format | COMBO | auto | 6 options: auto, gif, webp, mp4, mov, webm |
| filename_prefix | STRING | MKR_loop_video | — |
| subfolder | STRING | — | |
| overwrite | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| video | MKR_VIDEO | — |
| output_path | STRING | — |
| summary | STRING | — |