ComfyUI Node

Video Loader

It Loads a Video Path — Not the Video. Read This Before Wiring It Up

By 5agado·Created 12 months ago·Updated 17 days ago· 1
Video Loader
    • image
    • mask
    • video_path
    folder_path
    video_idx0
    random_idxfalse
    sort_bydate
    reversefalse
    seed42

    Here's the honest review up front: the Video Loader in this pack doesn't actually decode video into frames. Not yet. The source code literally contains a # TODO load videos comment sitting above the frame-loading call that was never written. What the node does do - reliably - is scan a folder, pick a video file by index or random, and hand you its path. If your workflow needs the path (to hand to a file-based tool, a ffmpeg wrapper, or a node that loads lazily), it's fine. If you expected image frames on the other end, adjust expectations.

    What it actually does

    It's the same machinery as the pack's Image Loader, pointed at video extensions instead: mp4, mov, avi, mkv. Given a folder_path it lists matching files, sorts by name or creation date or shuffles, optionally reverses, and selects one by video_idx - or at random with random_idx and a seed. Then it returns:

    • image - always None (not implemented)
    • mask - always None (not implemented)
    • video_path - the STRING path of the selected file, the one output that works

    That's the entire contract. The image and mask sockets exist, but they're wired to return nothing.

    Inputs

    • folder_path (STRING) - absolute path to the folder of videos.
    • Optional: video_idx (INT, default 0), random_idx (BOOLEAN), sort_by (STRING: name / date / shuffle), reverse (BOOLEAN), seed (INT, default 42).

    Install

    Pack standard: ComfyUI Manager → "Sagado Nodes for ComfyUI", or

    cd ComfyUI/custom_nodes
    git clone https://github.com/5agado/ComfyUI-Sagado-Nodes
    pip install -r ComfyUI-Sagado-Nodes/requirements.txt
    

    Restart. No extra video libraries in the pack's requirements - which is why frames aren't loaded; decoding video needs a real dependency (PyAV, imageio-ffmpeg, or opencv) and this pack deliberately keeps its requirements to torch, pillow, numpy, and ollama.

    How to actually use it today

    If you're grabbing a video for img2vid or frame extraction, pair this node with a proper frame extractor downstream - feed video_path into a Load Video / VHS-style node or an ffmpeg call and you've got a working "pick a random video from this folder" pipeline. That's a legitimately useful pattern: iterate a folder of source clips, feed each path to a real loader. Just know that the image and mask sockets are decorative as of this version, and don't build a workflow that expects frames to flow straight out of it.

    CategorySagado-Nodes

    Inputs (6)

    NameTypeDefaultDescription
    folder_pathSTRING
    video_idxoptINT0
    random_idxoptBOOLEANfalse
    sort_byoptSTRINGdate
    reverseoptBOOLEANfalse
    seedoptINT42

    Outputs (3)

    NameTypeDescription
    imageIMAGE
    maskMASK
    video_pathSTRING