Nodes/ComfyUI-Image-Tools/BatchImagePathLoader
ComfyUI Node

BatchImagePathLoader

Load a whole folder of images without touching ComfyUI's input dir

By knuknX·Created 3 years ago·Updated 2 years ago· 3
BatchImagePathLoader
    • IMAGE
    path

    You've got a folder full of images - reference shots, frames you ripped with ffmpeg, an upscale queue - and you want ComfyUI to chew through all of them. The built-in LoadImage makes you copy everything into ComfyUI/input and then click each one by hand. BatchImagePathLoader takes a folder path and hands you every image in it as a list. That's the whole pitch, and it's a good one.

    It's one of the eight utilities in the ComfyUI-Image-Tools pack, and the sibling of SingleImagePathLoader - same loading mechanism, but looped over a directory. It's the kind of node that quietly turns a manual "open file, run, save, next" routine into a single queue.

    How it works

    You give it a directory path. It scans that folder for .jpg, .jpeg, .png, .gif and .webp files, loads each with OpenCV, converts BGR→RGB, and returns the whole set as one list. The node is marked as a list output (OUTPUT_IS_LIST), which matters: in ComfyUI, that means a node downstream expecting a single IMAGE will be executed once per image. Wire the list into a save node or a sampler and the graph just runs for each file in turn. That's the batch behavior you're actually buying.

    Inputs and outputs

    • path (STRING) - the only input. An absolute path to a folder on the machine running ComfyUI, e.g. /home/user/frames/ or C:\work\refs.
    • Output: IMAGE (list) - every found image, expanded per-file into downstream nodes.

    Install

    It ships in a pack, so install the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/knuknX/ComfyUI-Image-Tools
    

    Restart ComfyUI, or install Image Tools via ComfyUI Manager. It only needs OpenCV plus the usual torch/numpy stack, so no special setup.

    Where people get burned

    • No existence check, and an empty folder is silent. A wrong path just produces zero images. You'll see an empty list (or a downstream node doing nothing) with no error to explain why. There's no "did you mean this directory?" - it's on you.
    • No recursion. Files in subfolders are ignored. It's a flat scan of the one directory you point at.
    • No sorting guarantee. glob doesn't return files in a guaranteed order, and this node doesn't sort for you. If you need frame order to matter - say frames of a video for img2img or a temporal pass - you'll want zero-padded filenames and even then you can't fully rely on order here.
    • Transparency carries through. Images load with alpha intact, so RGBA PNGs arrive as 4-channel tensors, and some downstream nodes choke on that fourth channel. Route through a flatten-to-RGB node if you hit it.
    • It's read-only plumbing. No preview, no mask output, no filtering, no per-file names exposed. If you need to know which file you're processing, the console log (which prints each path as it loads) is your only witness.

    For one file by path, use SingleImagePathLoader; for a whole directory as a batch, this is the one. It's not the most polished node you'll ever install, but it fills a hole the built-in LoadImage leaves open.

    CategoryTools

    Inputs (1)

    NameTypeDefaultDescription
    pathSTRING

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE