ComfyUI Node

Batch Load Image

Load a whole folder of images into ComfyUI in one go

By TheBill2001·Created 2 years ago·Updated about a year ago· 8
Batch Load Image
    • images
    • masks
    path
    recursivefalse

    ComfyUI's built-in Load Image is strictly one-at-a-time: pick a file, get one image. That's the right tool for a single generation and the wrong tool for almost anything batch-shaped. This node, Batch Load Image (class CFICLS_LoadImageBatch), is the folder-shaped version. Point it at a directory and it hands you every image in there as a list, with a matching list of masks. That's the whole job, and honestly that's the point - most of ComfyUI already works on batches, so the missing piece was just getting a folder's worth of files into the graph without dragging them in one by one.

    Where you actually reach for it

    Dataset prep, mostly. The classic loop is: load your training images, run them through a captioner, export. This is the first step of that loop - feed a whole reference folder through a WD14 tagger or JoyCaption without a hundred manual loads.

    Second use: review. Generated a folder of outputs and want to eyeball them through a preview node, or check that a background-removal pass actually cut out the subject? The mask output makes that easy - each image comes with its alpha channel as a MASK, so you can see at a glance which ones came back with proper transparency.

    The inputs and outputs

    Only two inputs, and one of them is off by default:

    • path - the folder to load. A directory, not a file. Pointing this at a file is the single most common way to get nothing back.
    • recursive (default off) - descend into subfolders. Turn it on for a nested dataset; leave it off if you don't want to accidentally swallow a whole tree of files.

    Outputs:

    • images - a list of IMAGE tensors, one per file in the folder.
    • masks - a matching list of MASKS, built from each image's alpha channel. Images without transparency come back with a mask that's effectively empty.

    One thing to know before you go hunting: there's no caption output on this node. The pack's name is about saving captions; the load half just gets images into the graph. You add the captions downstream with a tagger or captioner.

    Installing it

    The pack is ComfyUI-Save-Image-Caption, titled "Save Images with Captions." Easiest path: ComfyUI Manager → Install Custom Nodes → search "Save Images with Captions." Or clone by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TheBill2001/ComfyUI-Save-Image-Caption
    

    Then restart ComfyUI. That's the entire install - no model downloads, no pip requirements to speak of, nothing heavy. The README is literally one sentence, so the installation is the only thing the author bothered documenting.

    Common gotchas

    • Folder, not file. The path field wants a directory. Feed it a file and you'll get an empty image list.
    • Empty output, right path. Check recursive. If your images are one level down and you left it off, the loader finds nothing.
    • Blank masks. Images with no alpha channel give you no useful mask. That's not a bug, it's just what "no transparency" looks like.
    • Order isn't guaranteed alphabetical. Folder loaders generally hand files back in filesystem order, which may not match how you sorted things elsewhere. If you're pairing images to something positionally, verify the first couple before trusting the whole batch.

    There's no documentation to save you if you hit something genuinely weird - the README is one line and the node has essentially zero community footprint. For a folder loader that's survivable: the inputs are simple enough to debug by experiment, which is exactly what the author clearly expects you to do.

    Categoryimage/batch

    Inputs (2)

    NameTypeDefaultDescription
    pathSTRING
    recursiveBOOLEANfalse

    Outputs (2)

    NameTypeDescription
    imagesIMAGEBatch loading images from a path.
    masksMASK