Nodes/ComfyUI Inspire Pack/Load Image List From Dir (Inspire)
ComfyUI Node Runs on cloud

Load Image List From Dir (Inspire)

Feed a whole folder through your workflow, one image at a time

By ltdrdata·Created 3 years ago·Updated 9 months ago· 805
Load Image List From Dir (Inspire)
    • IMAGE
    • MASK
    • FILE PATH
    directory
    image_load_cap0
    start_index0
    load_alwaysfalse
    sort_method

    Point this at a folder and it loads every image in it as a ComfyUI list, so the rest of your graph runs once per image. That's the key word - list, not batch. It's the node you want when you've got a directory of images to process independently: run each one through the same img2img, upscale, or detailer chain and get a result per file, without wiring up twenty Load Image nodes by hand.

    The distinction from its sibling Load Image Batch From Dir is the whole reason this node exists. The batch version stacks everything into one tensor and forces every image to the size of the first. This one keeps each image at its original size and emits them as a list, which means no distortion and no surprise resizing - each image flows through the workflow on its own terms.

    How it works

    ComfyUI's list mechanism executes the downstream graph once for each item in a list. This node builds that list from a folder: it reads the directory, loads the images, and outputs them as an IMAGE list (plus their masks and paths). Because it's a list rather than a batch, ComfyUI iterates - so a save node at the end writes one file per input image, a sampler samples each one separately, and so on.

    The inputs and outputs that matter

    • directory - the folder to read. This is the one thing you have to set.
    • image_load_cap - max number of images to load (0 = all). Handy for testing on the first few.
    • start_index - skip ahead N files; good for resuming a long run.
    • sort_method - how the files are ordered: alphabetical, numerical, or by datetime, ascending or descending. Numerical matters if your files are named 1, 2, 10 and you don't want 10 landing between 1 and 2.

    Outputs: IMAGE (list), MASK (list, from any alpha channel), and FILE PATH (list) so you can carry each source filename downstream.

    Installing it

    ComfyUI Manager: search "Inspire Pack", install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ltdrdata/ComfyUI-Inspire-Pack
    

    Then restart ComfyUI (run pip install -r requirements.txt first if you cloned by hand). It's part of Dr.Lt.Data's Inspire Pack, so no extra model downloads for this node.

    Where people get tripped up

    The list-vs-batch thing trips almost everyone once. If a downstream node expects a single batched image tensor, feeding it a list makes ComfyUI run that node repeatedly instead of all at once - usually what you want here, occasionally not. If you actually need one stacked tensor (for, say, a batched animation pass), reach for Load Image Batch From Dir instead and accept the size normalization. The other gotcha is paths: directory is a filesystem path relative to where ComfyUI runs, so a folder that exists on your desktop won't exist in the same place on a hosted runner - put the images where the server can see them, or use an absolute path you know is valid there.

    Categoryimage

    Inputs (5)

    NameTypeDefaultDescription
    directorySTRING
    image_load_capoptINT0
    start_indexoptINT00–18446744073709550000
    load_alwaysoptBOOLEANfalse
    sort_methodoptCOMBO7 options: None, Alphabetical (ASC), Alphabetical (DESC), Numerical (ASC), Numerical (DESC), Datetime (ASC), +1

    Outputs (3)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK
    FILE PATHSTRING