ComfyUI Node

Load Image Folder

Point it at a directory, get every image back as one batch

By thalismind·Created about a year ago·Updated about a year ago· 8
Load Image Folder
    • image
    • mask
    • filenames
    folder_path

    "Load images from folder" is one of the more common asks on r/comfyui - people build a batch pipeline and immediately need a way to point at a directory and pull everything in, instead of manually adding a Load Image node per file. WAS Node Suite, Impact Pack and KJNodes all have their own take on this with extra knobs (load caps, increment modes, sort order). LoadImageFolder is this pack's version, and it's deliberately the simple one: give it a path, get back everything in it as a single batch, plus the filenames that went with each image.

    How it works

    You give it one string - a folder path. It loads every image file it finds inside, skipping anything that isn't a recognized image format, and concatenates the whole set into one image batch tensor. Alongside that you get a list of the filenames it loaded, in the same order as the images - so index n of the filenames list corresponds to index n of the image batch. That pairing is the whole reason to reach for this node over just dragging in a folder of Load Image nodes by hand.

    It's forgiving about bad files: corrupted or unsupported images get skipped rather than crashing the whole load, and it prints an error to the console for anything that failed rather than silently pretending nothing happened. If the folder turns out to have no valid images at all, you get empty tensors back instead of a hard error.

    The input and outputs

    There's exactly one required field:

    • folder_path (STRING) - the path to the folder you want loaded. No default, no dropdown - you type or wire in the actual path.

    Three outputs:

    • image (IMAGE) - every loaded image concatenated into one batch.
    • mask (MASK) - the corresponding masks, concatenated the same way.
    • filenames (STRING) - the list of filenames that were loaded, same order as the image batch.

    Installing it

    • ComfyUI Manager - search ComfyUI LoadImageWithFilename, install, restart.
    • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/thalismind/ComfyUI-LoadImageWithFilename, restart ComfyUI.

    One file, no separate install step, no models to fetch - it needs PIL, PyTorch and NumPy, which is table stakes for any working ComfyUI setup. It lands in the image category once ComfyUI restarts.

    Common issues

    Mismatched image dimensions is the one that'll actually bite you. The README is explicit about this: all images in a folder need to be the same size for the concatenation into a single batch tensor to work. If your folder has a mix of resolutions, either resize them first or expect this to error or misbehave. This is the single most likely reason a run of this node fails.

    No batch-size cap, no sort control, no increment mode. Unlike the WAS/Impact/KJ folder loaders people are used to, this one has no load_cap to limit how many images it pulls at once and no setting to process a folder one image at a time. Point it at a folder of 3,000 images and it tries to load all 3,000 into one batch tensor in one shot - which is a great way to run out of VRAM or RAM fast. If you need controlled, incremental loading of a huge folder, this isn't the tool; a folder loader with an increment/index mode from a bigger pack is the better fit for that job.

    Failures are console-only. If some files in your folder silently didn't make it into the batch, the message telling you why is printed to the ComfyUI server console/log, not surfaced anywhere in the UI. If your filenames list looks shorter than expected, check the terminal before assuming the node is broken.

    Categoryimage

    Inputs (1)

    NameTypeDefaultDescription
    folder_pathSTRING

    Outputs (3)

    NameTypeDescription
    imageIMAGE
    maskMASK
    filenamesSTRING