ComfyUI Node

Load Folder

Pull a whole image sequence in as one batch

By Mister-Link·Created 9 months ago·Updated 24 days ago· 0
Load Folder
    • IMAGE
    • MASK
    • frame_count
    directory
    image_load_cap0
    skip_first_images0
    select_every_nth1

    If your workflow is video- or frame-sequence-based, you'll eventually need to pull a whole directory of images into ComfyUI as one batch instead of loading them individually. Load Folder does exactly that: pick a subfolder, and it loads every image in it as a single IMAGE batch, with a few controls for how much of it you actually want.

    How it works

    Point it at a subfolder - it's a dropdown populated from your ComfyUI input directory, so you're picking rather than typing a path - and it reads the images in as a batch in file order. It's the natural counterpart to Batch Image Save elsewhere in this pack: save a numbered sequence out, load it back in later as a batch for a second pass, without hand-managing individual file loads.

    The inputs and outputs that matter

    • directory (enum, required) - the subfolder to load from, selected from a dropdown of what's available under your input directory.
    • image_load_cap (INT, optional, default 0) - cap on how many images to load; 0 means no cap, load everything.
    • skip_first_images (INT, optional, default 0) - skip this many files from the start before loading. Useful if the first few frames of a sequence are junk, or you want to resume partway through a large set.
    • select_every_nth (INT, optional, default 1) - take every Nth image instead of all of them. Set it to 2 or 3 to spot-check a long sequence, or to deliberately downsample a frame rate.

    Three outputs: IMAGE (the batch), MASK, and frame_count (INT) - the count is handed back so downstream nodes (frame calculators, batch-size checks) don't need a separate node just to know how many frames actually loaded.

    How to install it

    Through ComfyUI Manager: search "Link Comfy Nodes," install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Mister-Link/link-comfy-nodes
    pip install -r link-comfy-nodes/requirements.txt
    

    Restart ComfyUI afterward.

    Common issues & troubleshooting

    The folder you want isn't in the dropdown. The directory field is populated from what's already sitting under ComfyUI's input directory - it won't show a folder that doesn't exist there yet. If you're trying to load frames from somewhere else on disk, move or symlink them into the input directory first; there's no free-text path override on this node.

    Frame order isn't what you expected. Batch loaders like this one generally read files in the order the filesystem returns them, which is usually alphabetical/lexicographic rather than creation time. If your files are numbered 1, 2, 3, … 10, 11, make sure they're zero-padded (001, 002, …) - unpadded numeric filenames sort 1, 10, 11, 2, 3… and will scramble your sequence.

    Loading way more than you meant to. image_load_cap defaults to 0, meaning "load everything" - on a folder with thousands of frames that's a lot of VRAM and load time for a quick test. Set a small cap while you're iterating on the rest of the graph, and only lift it once you're ready for the full run.

    Categoryimage/io

    Inputs (4)

    NameTypeDefaultDescription
    directoryCOMBO1 options: 3d
    image_load_capoptINT00–9007199254740991
    skip_first_imagesoptINT00–9007199254740991
    select_every_nthoptINT11–9007199254740991

    Outputs (3)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK
    frame_countINT