Nodes/DJZ-Nodes/Load Video Directory
ComfyUI Node

Load Video Directory

The simpler video batch loader — frames out, done

By MushroomFleet·Created 2 years ago·Updated 5 months ago· 78
Load Video Directory
    • frames
    • filename_text
    mode
    seed0
    index0
    skip_frames0
    max_frames0
    labelVideo Batch 001
    path
    pattern*

    This is the original LoadVideoDirectory from DJZ-Nodes, and honestly, it's the version you want if you just need frames out of a folder of clips without any of the V2 ceremony. It scans a directory for videos, picks one according to your mode, and hands you an IMAGE batch plus the source filename. Two outputs, eight inputs, zero audio, zero batch-manager integration. Sometimes that's exactly the right amount.

    What it does

    You give it a path to a folder and it globs for video files (.mp4, .avi, .mov, .mkv), sorts them, and then:

    • mode = single_video - loads the video at index (a number, not a path).
    • mode = incremental_video - treats index as the position in the sorted list and steps through the folder as you bump it.
    • mode = random - picks a file using the seed input.

    For whichever video it lands on, skip_frames trims the beginning and max_frames caps how many frames come out (0 = the whole clip). Frames are read with OpenCV, converted BGR→RGB, normalized to 0-1 float tensors, and stacked into one batch. Outputs are frames (IMAGE) and filename_text (STRING) - the latter is the actual file name, which you can route into save/path nodes so your outputs keep their source name.

    Why you'd pick this over V2

    The V2 sibling adds frame_count, audio, video_info, memory limits, and VHS_BatchManager integration. That's real power, but it's also a heavier node with more that can trip you up. If your pipeline just needs "every video in this folder, as frames, one at a time," this one is leaner to wire up and easier to reason about. The pattern field (default *) lets you grab only some files, and it's sanitized against .. traversal so a hostile path string can't escape the folder.

    Installing

    Standard DJZ-Nodes install - this is one node in the pack from Drift Johnson (MushroomFleet):

    cd ComfyUI/custom_nodes
    git clone https://github.com/MushroomFleet/DJZ-Nodes
    cd DJZ-Nodes
    pip install -r requirements.txt
    

    Or search "DJZ-Nodes" in ComfyUI Manager. It needs opencv-python, which is in the pack's requirements.

    Gotchas

    • The path must exist or it raises a ValueError - the error message tells you the path, so that's at least debuggable.
    • The label input (default "Video Batch 001") doesn't show up in the outputs; it's bookkeeping. Some people expect it to prefix the filename and it doesn't.
    • incremental_video uses index as your pointer - if you set index beyond the file count it silently wraps around to the start, so keep an eye on it for long batch jobs.
    • There's no frame count output, so if you're feeding this into a video pipeline that needs to know how many frames it got, count them downstream or use V2.

    For most people doing batch video-to-video work on a folder of clips, this is the node you reach for first - and it's genuinely the one I'd reach for when V2's extra outputs would just be dangling wires.

    Categoryimage/video

    Inputs (8)

    NameTypeDefaultDescription
    modeCOMBO3 options: single_video, incremental_video, random
    seedINT00–18446744073709550000
    indexINT00–150000
    skip_framesINT00–999999
    max_framesINT00–999999
    labelSTRINGVideo Batch 001
    pathSTRING
    patternSTRING*

    Outputs (2)

    NameTypeDescription
    framesIMAGE
    filename_textSTRING