Nodes/Simple Video Effects/Video Loop Extender
ComfyUI Node

Video Loop Extender

Loop any clip N times without opening a video editor

By scofano·Created 10 months ago·Updated 19 days ago· 0
Video Loop Extender
    • output_path
    video_path
    extend_factor1
    use_gputrue
    delete_originalfalse

    The Video Loop Extender is the "make it longer" button you're missing. You render a 2-second perfect loop out of a video model, or you have a 4-second clip of b-roll, and you need a 30-second version for the edit. This node takes a video file path, duplicates the clip N times, and concatenates the copies into one longer file - audio included. No re-timing, no keyframes, no cutting.

    It's part of the file-based half of the Simple Video Effects pack. Like the other "Video File" nodes here, it doesn't hand you frames in the graph. It gives you a string: the path to the new video on disk. That's the pattern to get comfortable with - you point it at a file, it writes a file, and the output_path wire just carries the location.

    How it works

    Under the hood it's ffmpeg doing what ffmpeg is good at. The node validates the file, builds one input stream per copy, feeds them all into the concat filter (v=1, a=1 so video and audio both concatenate), and encodes the result as H.264 with AAC audio. The audio track gets duplicated right along with the frames, so a looped clip with sound stays in sync.

    Two details worth knowing:

    • extend_factor - how many times to duplicate, not the final multiplier of length in every sense. Set it to 5 and you get five copies of the clip chained end to end. It's a FLOAT input but behaves like an integer (step 1, min 1, max 100). 1 is effectively a re-encode.
    • use_gpu - defaults to true and tries NVIDIA's NVENC encoder for a 5–10x speedup. If NVENC isn't available or fails, it falls back to libx264 automatically. Leave it on unless you're on a machine without an NVIDIA GPU.

    You probably want delete_original to stay off. Yes, the option exists - and yes, if you flip it, the node deletes your source file after a successful run. That's the only footgun on this node, and it's an easy one to trip if you treat it like "delete after render."

    Wiring it in

    Inputs you'll actually touch: video_path (the file you want looped), extend_factor, and maybe delete_original. The output output_path is a STRING - wire it to any node that accepts a path, or just read it from the console.

    Installing it

    It ships in the Simple Video Effects pack, so install the pack once and every node in it comes along:

    cd ComfyUI/custom_nodes
    git clone https://github.com/scofano/ComfyUI-Simple-video-effects
    cd ComfyUI-Simple-video-effects
    pip install -r requirements.txt
    

    Restart ComfyUI. (Or search "Simple Video Effects" in ComfyUI Manager and click install.) Dependencies are light - torch, ffmpeg-python, numpy, Pillow, soundfile - and there are no model downloads for this node.

    Common issues

    The big one: ffmpeg and ffprobe must be on your system PATH. The code calls them as external binaries (shutil.which("ffmpeg")) and throws a "not found on PATH" error if they aren't there. Installing the ffmpeg-python pip package is not enough - you need the actual ffmpeg binary. On Windows, winget install Gyan.FFmpeg and reopen your terminal; on Linux, your distro's ffmpeg package.

    If the output looks identical to the input, check extend_factor - a value of 1 re-encodes the file rather than looping it. And if a run dies mid-encode, the culprit is almost always a path with weird characters or a file ffmpeg can't parse; the node supports MP4, AVI, MOV, MKV and WebM, so anything exotic should be converted first.

    CategorySimple Video Effects

    Inputs (4)

    NameTypeDefaultDescription
    video_pathSTRING
    extend_factorFLOAT11–100
    use_gpuoptBOOLEANtrue
    delete_originaloptBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    output_pathSTRING