Nodes/Simple Video Effects/Video Overlay (Video Path)
ComfyUI Node

Video Overlay (Video Path)

Overlay one video onto another without touching a single tensor

By scofano·Created 10 months ago·Updated 20 days ago· 0
Video Overlay (Video Path)
    • video_output_path
    base_video_path
    overlay_video_path
    prefixoverlay_
    opacity0.75
    delete_originalfalse
    use_gputrue

    If you've ever wanted to composite one clip over another and found yourself mentally mapping ComfyUI image tensors onto a timeline, this is the shortcut you've been looking for. Video Overlay (Video Path) - class VideoOverlayBatch - takes two file paths and hands back a new file path. No VHS loading nodes, no batched-image juggling, no re-running your latent pipeline. You give it a base video and an overlay video, pick an opacity, and it composites them with ffmpeg while keeping the base video's audio.

    Why you'd reach for it

    It's part of scofano's Simple Video Effects pack, the grab-bag of lightweight video utilities that do the boring finishing work around generation - zooms, shakes, transitions, and this, the compositing job. Reaching for it makes sense any time your "video" is really an edited assembly of clips: a talking-head over footage, a logo animation over a render, an effect pass blended onto the clean version. The whole pack is built on the idea that you shouldn't have to round-trip video through image tensors when a file path will do.

    How it works

    Under the hood it's one ffmpeg invocation, built from scratch by the node. It probes the base video's dimensions and duration, then builds a filter graph that scales both streams to the base canvas - keeping aspect ratio and letterboxing via centered padding - converts both to RGBA, and uses colorchannelmixer to scale the overlay's alpha to your opacity. Then it blends.

    The part that's actually nice: duration mismatch is handled for you. If the overlay is shorter than the base, the node loops it until it fills the gap. If it's longer, it trims it down. You don't have to pre-edit anything. The result lands in ComfyUI's output folder as {prefix}{base_name}_overlay.mp4, with a live progress bar instead of a frozen queue.

    The inputs that matter

    • base_video_path / overlay_video_path - absolute paths to the two files. It won't run until both exist.
    • opacity - default 0.75, range 0–1. Uniform alpha for the whole overlay; there's no keyframing here.
    • use_gpu - defaults on, uses h264_nvenc if your ffmpeg has it, falls back to libx264 if not. Safe to leave on even without an NVIDIA card.
    • delete_original - this one's a footgun. If you toggle it, the base video gets deleted after the composite succeeds. I'd leave it off unless you're grinding through a batch and are sure.

    The single output is video_output_path, a STRING holding the absolute path to the finished MP4. Feed it into any node that takes a video path, or just copy it out.

    Installing it

    Same story as every node in this pack - no models to download, no heavy dependencies beyond what ComfyUI already has:

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

    Then restart ComfyUI. Or just search "Simple Video Effects" in ComfyUI Manager and hit install. The requirements are ffmpeg-python, soundfile, numpy, Pillow and torch - all lightweight, nothing that'll fight your existing environment.

    Where people get burned

    First and most important: this node shells out to the system ffmpeg via shutil.which("ffmpeg") - if ffmpeg isn't on your PATH, the node refuses to even load with a "not found on PATH" error. That's a pip install ffmpeg-python can't fix; the Python package is just bindings. Install real ffmpeg and make sure it's in your shell's PATH before restarting ComfyUI.

    Second, this is a full-frame blend, not a picture-in-picture tool. There's no position or scale control - the overlay is scaled and centered to cover the whole base canvas. For a corner bug or a sized sub-window, you want the tensor-based Video Overlay node in the same pack (which has position/scale/auto-fit), or to pre-compose your PNG elsewhere.

    And third, remember every frame gets re-encoded. It's fine for a final pass, but if you're going to keep editing, keep the originals - this is a destructive, lossy step.

    One light aside: if both your videos are already the same resolution and length, this node is almost embarrassingly simple for what it does - but "almost embarrassingly simple" is exactly what you want in a finishing step.

    CategorySimple Video Effects/Video Processing

    Inputs (6)

    NameTypeDefaultDescription
    base_video_pathSTRING
    overlay_video_pathSTRING
    prefixSTRINGoverlay_
    opacityFLOAT0.750–1
    delete_originalBOOLEANfalse
    use_gpuBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    video_output_pathSTRING