Nodes/Simple Video Effects/Video Overlay (File Input)
ComfyUI Node

Video Overlay (File Input)

Animate a PNG sequence over a whole clip

By scofano·Created 10 months ago·Updated 20 days ago· 0
Video Overlay (File Input)
    • output_path
    video_path
    overlay_folder_path
    modeloop
    prefixvideo_overlay
    use_gputrue

    The in-graph Video Overlay node composites a video file over your frames. This one is the file-out sibling: it takes a video file and a folder of PNG overlay frames, composites the overlay animation onto the whole video with ffmpeg, and writes out a new file - original audio preserved. It's the "burn the watermark/animated overlay into the final export" node.

    Where it shines: you've rendered an overlay animation as a PNG sequence (scanlines, a blinking lower-third, a light-leak loop, an animated logo) and you want it baked into the final video without re-rendering anything in the graph. Point it at the clip and the folder, pick an animation mode, and it encodes the composited result with NVENC (GPU, on by default) or libx264.

    How it works

    The node probes the input video (duration, FPS, resolution, audio codec), scans the overlay folder for PNGs and sorts them alphabetically, and builds an ffmpeg filter graph. The overlay stream gets timestamp-normalized with setpts=PTS-STARTPTS and composited with overlay=0:0:format=auto; in hold mode it uses tpad to freeze the last frame. The output is encoded at the video's original FPS with H.264, and the original audio is copied over losslessly.

    The mode dropdown decides the animation behavior over the clip's length:

    • loop - overlay sequence repeats for the whole video
    • run_once - plays once, then the base video shows clean
    • run_once_and_hold - plays once, then holds the final overlay frame
    • ping_pong - plays forward then backward, looped

    Inputs and output

    • video_path - the video to overlay onto.
    • overlay_folder_path - folder of PNG overlay frames. For directly used files they should be numbered 000001.png, 000002.png…; the node can also fall back to alphabetical ordering for unnumbered files.
    • mode - one of the four above.
    • prefix - output filename prefix, default video_overlay.
    • use_gpu - NVENC encoding, default true (falls back to CPU automatically).

    Output is output_path, the new composited video file.

    Installing it

    One of ~25 nodes in the Simple Video Effects pack:

    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 install via ComfyUI Manager (search "Simple Video Effects"). No model downloads - but this is a hard ffmpeg user, so the binaries need to be on your PATH.

    Common issues

    The overlay files must be PNGs with real transparency - a flattened image covers the frame like a poster. And order is alphabetical filename order, so zero-pad your sequence (000001, 000002, …) or 000010.png will sort before 000002.png and the animation will stutter. Check the FPS math too: your overlay sequence has its own implicit rate (one PNG per video frame), so if your overlays were authored at 24fps but the video is 30fps, the animation runs slightly fast. Finally, this is a re-encode of the whole video - expect a small generation loss and a bit of time; that's the price of baking overlays in permanently.

    CategorySimple Video Effects

    Inputs (5)

    NameTypeDefaultDescription
    video_pathSTRING
    overlay_folder_pathSTRING
    modeCOMBOloop4 options: loop, run_once, run_once_and_hold, ping_pong
    prefixSTRINGvideo_overlay
    use_gpuBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    output_pathSTRING