Nodes/Mickmumpitz-Nodes/Image Batch Loader
ComfyUI Node

Image Batch Loader

Your training folder, dumped into a graph

By mickmumpitz·Created 8 months ago·Updated 9 days ago· 47
Image Batch Loader
    • IMAGE
    • IMAGE_PATH
    image_dirC:\path\to\your\images
    batch_size0
    start_from1
    mode

    If you're training a character LoRA, the boring part isn't the training - it's getting a folder of reference images into the graph without hand-wiring thirty Load Image nodes. CCC_ImageBatchLoader is Mickmumpitz's answer: point it at a folder, it hands you every image as a list, plus each one's file path. It's part of the Consistent Character Creator (CCC) group in this pack, which exists to build LoRA training datasets in the graph instead of on disk.

    The name is from Mickmumpitz's own character-sheet workflow - he's a YouTuber whose consistent-character setups are popular and, in the community's words, "definitely a pain" to set up. This loader is one of the easier pieces.

    How it works

    The key detail most people miss: both outputs are lists, not a single batched tensor. Each image comes through as its own [1, H, W, C] tensor inside a Python list, so downstream nodes that iterate per-image (like the captioning Prompt Studio or a captioner that runs on one image at a time) behave the way you expect. The IMAGE_PATH output carries the matching absolute file path for every image, which is how you can later wire captions back to files for AI Toolkit or your trainer.

    Under the hood it lists the folder, filters to png/jpg/jpeg/webp/bmp, sorts by filename, and feeds everything through EXIF transpose so phone photos stop coming in sideways. Only two inputs actually matter:

    • image_dir - the folder. Note the default is a Windows-style C:\path\to\your\images; on Linux or macOS use your real path.
    • mode - sequential loads a range of files; single_image_increment returns exactly one image, which is handy for stepping through a set one render at a time.
    • batch_size - 0 (default) means "everything from start_from onward". Set a positive number to take a slice.
    • start_from - 1-based index into the sorted list where loading begins. In single_image_increment it wraps around the folder, so you can step forever.

    Where it fits

    Wire the IMAGE list into your captioning stack, keep IMAGE_PATH as a side-channel for matching, then feed the pair into CCC_TextBatchLoader-style captions for the Dataset Reviewer or Show Image + Text Pairs. That's the whole dataset-assembly loop this pack is built around: load images, caption them, review them, train.

    Installing it

    This node ships in the Mickmumpitz-Nodes pack, not standalone:

    • ComfyUI Manager - search "Mickmumpitz", install, restart.
    • Manual:
    cd ComfyUI/custom_nodes
    git clone https://github.com/mickmumpitz/ComfyUI-Mickmumpitz-Nodes.git
    

    Then restart ComfyUI. Dependencies are light - numpy, Pillow, opencv-python - and there's nothing to download for this node. The optional ultralytics dependency only matters for the face-area splitter nodes, not here.

    Troubleshooting

    • "Directory '...' does not exist." - the node raises a clear error, so check the path you typed. It does not validate on the widget; the error comes at queue time.
    • "No valid image files found." - the folder exists but nothing it likes is in it. The extensions are hard-coded; TIFFs and AVIFs won't load.
    • Ordering surprises - files are sorted by name, so img10.png sorts before img2.png. If you need strict numeric order, name your files img01, img02, …
    • start_from is 1-based - a common off-by-one. start_from=1 is the first file, not the second.
    CategoryMickmumpitz/ConsistentCharacterCreator

    Inputs (4)

    NameTypeDefaultDescription
    image_dirSTRINGC:\path\to\your\images
    batch_sizeINT00–1000
    start_fromINT1
    modeCOMBO2 options: sequential, single_image_increment

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    IMAGE_PATHSTRING