Nodes/KJNodes for ComfyUI/Load Videos From Folder
ComfyUI Node Runs on cloud

Load Videos From Folder

Batch-load a whole folder of clips into frames

By kijai·Created 3 years ago·Updated a day ago· 2,908
Load Videos From Folder
    • IMAGE
    videoX://insert/path/
    force_rate0
    custom_width0
    custom_height0
    frame_load_cap0
    skip_first_frames0
    select_every_nth1
    output_typebatch
    grid_max_columns4
    add_labelfalse

    Most video-load nodes take one file. LoadVideosFromFolder takes a whole directory and reads the clips in it into frames for you. Point it at a folder, and it decodes those videos into images your workflow can process - useful when you're batch-processing a set of clips, building a comparison, or feeding a pile of source footage into a video-to-video pipeline without wiring up a loader per file.

    How it works

    You give it a folder path. It finds the videos there and decodes them into image frames, with the usual sampling controls so you're not forced to load every single frame at full rate. It can hand back the result as one long batch of frames, or arrange multiple clips into a grid so you can see them side by side.

    The inputs that matter

    • video - despite the name, this is the folder path (it defaults to a placeholder like X://insert/path/). Put the directory of clips here.
    • frame_load_cap - the ceiling on how many frames to load. 0 means no cap. This is your first line of defense against loading a huge folder and blowing up your RAM - set a sane limit while you're testing.
    • select_every_nth - take every Nth frame instead of all of them. Set it to 2 to halve the frame count, 4 to quarter it. Great for thinning dense footage down to something workable.
    • skip_first_frames - trim off a lead-in.
    • force_rate - resample to a target frame rate, so clips shot at different rates come in consistent.
    • custom_width / custom_height - decode to a fixed size (0 leaves the native size).
    • output_type - batch gives you one continuous stack of frames; grid tiles the clips into a single laid-out image, with grid_max_columns controlling the width and add_label optionally tagging each.

    The output is a single IMAGE batch (or the grid image, depending on output_type).

    Where you'd use it

    Bulk video work. Running the same restoration or style pass over a folder of clips, assembling reference footage, or making a quick contact-sheet grid of several videos to compare them. It's the folder-level companion to the single-file loaders you'd otherwise chain by hand. Kijai builds a lot of the community's video plumbing, and this is the "just load everything in that directory" convenience.

    Installing KJNodes

    ComfyUI Manager: Custom Nodes Manager, search "KJNodes for ComfyUI", install, restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, then pip install -r ComfyUI-KJNodes/requirements.txt (portable: python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ComfyUI-KJNodes\requirements.txt), then restart. Video decoding leans on ffmpeg being available on your system - if clips won't load, that's the first thing to check.

    Watch out for

    Memory is the real hazard. A folder of long clips loaded at full frame rate is an enormous batch, and it's the fastest way to run yourself out of RAM. Use frame_load_cap and select_every_nth aggressively while you dial in a workflow, then loosen them once you know what you're doing.

    The path field being labeled video when it wants a folder confuses people - put a directory there, not a single file. And mixed content in the folder can bite: wildly different resolutions or frame rates across clips can make a grid output look ragged, which is what force_rate and custom_width/custom_height are there to normalize.

    CategoryKJNodes/misc

    Inputs (10)

    NameTypeDefaultDescription
    videoSTRINGX://insert/path/
    force_rateFLOAT00–60
    custom_widthINT00–4096
    custom_heightINT00–4096
    frame_load_capINT00–10000
    skip_first_framesINT00–10000
    select_every_nthINT11–1000
    output_typeCOMBObatch2 options: batch, grid
    grid_max_columnsINT41–16
    add_labelBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE