Nodes/ComfyUI-QHNodes/🐟Load Image From Folder
ComfyUI Node

🐟Load Image From Folder

Batch-load images with pagination baked in

By liuqianhonga·Created 2 years ago·Updated about a year ago· 5
🐟Load Image From Folder
    • images
    • image_names
    • image_paths
    folder
    start_index0
    load_cap1

    Stock ComfyUI loads one image at a time. The moment you want to run a whole folder of reference images through the same workflow - batch upscaling, batch captioning, running each through the same style transfer - you need something that hands back a batch instead of a single file. LoadImageFromFolder does that, with pagination built in so you're not forced to load an entire folder at once.

    How it works

    Point it at a folder, and it loads images in filename order starting from start_index, up to load_cap of them. That pairing - an index plus a count - means you can walk through a large folder in chunks across multiple runs (load 0-9, then 10-19, and so on) rather than being stuck loading everything or nothing.

    The inputs and outputs that matter

    • folder (STRING) - absolute or ComfyUI-root-relative path to the image folder.
    • start_index (INT, 0–10000, default 0) - where in the sorted file list to start reading.
    • load_cap (INT, 1–100, default 1) - how many images to load starting from that index. Note the minimum is 1, not 0 - there's no "load everything" shortcut here, unlike the pack's LoadPromptsFromFolder sibling, which uses -1 for that. To load a whole folder you need to know (or measure) the count first.

    Outputs: images (a list of IMAGE), image_names (a list of STRING - filenames only, no path), and image_paths (a list of STRING - the full path to each file). Having all three means you can display or log which files actually got loaded, not just process the raw image data blind.

    How to install it

    Search ComfyUI-QHNodes in ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/liuqianhonga/ComfyUI-QHNodes.git
    

    Restart. Main-repo node, no submodules or downloads needed.

    Common issues & troubleshooting

    You don't know how many images are in the folder, so load_cap guessing feels wrong. Pair this with the pack's own ImageCountFromFolder node - feed its INT output into load_cap (right-click the widget and convert it to an input) and you'll always load the whole folder without hardcoding a number, up to the 100-per-run cap.

    Empty output with no error. Per the README, a folder that doesn't exist returns an empty list rather than throwing - if you're getting nothing back, check the path first, keeping in mind relative paths resolve against ComfyUI's root directory, not the folder the node lives in.

    Trying to load more than 100 at once. load_cap tops out at 100. For a bigger folder, you'll need to run the graph multiple times, bumping start_index by 100 each pass - there's no single-call "load everything" option here, so plan pagination into a batch workflow rather than assuming one run covers the whole folder.

    Images loading out of the order you expected. Loading is by filename sort, per the README - if your files aren't zero-padded (img2.png sorting after img10.png instead of before), the order won't match what you'd expect visually. Rename with zero-padded numbers if sequence matters.

    Category🐟QHNodes

    Inputs (3)

    NameTypeDefaultDescription
    folderSTRING
    start_indexINT00–10000
    load_capINT11–100

    Outputs (3)

    NameTypeDescription
    imagesIMAGE
    image_namesSTRING
    image_pathsSTRING