Nodes/ComfyUI_AITECCAFE_Toolkit/🖼️ AITEC Image Loader
ComfyUI Node

🖼️ AITEC Image Loader

The Image Loader that walks through a folder one image at a time

By AI-TEC·Created about a year ago·Updated about a month ago· 4
🖼️ AITEC Image Loader
    • image
    • mask
    folder_pathD:/ComfyUI/input
    seed0
    include_subfoldersfalse

    If you've ever wanted to batch-process a folder of images and wished the Load Image node would just move on to the next file, this is the node for you. AITEC Image Loader reads a whole folder, and uses a seed as an index into that folder's alphabetically-sorted file list - so bump the seed and you get the next image in the folder, every time.

    The trick that makes it feel like magic is a detail in the source: the node returns a hidden seed + 1 back to ComfyUI, so the widget auto-increments on every run. That means you queue the workflow, it processes image 1, and the next queue run automatically picks image 2. No seed scrambling, no manual poking - the node is effectively an iterator over a folder. That's the entire reason it exists, and it's genuinely handy for img2img passes, captioning, or any "same workflow, N different inputs" loop.

    Three inputs, and they're all self-explanatory:

    • folder_path - absolute path to your images. (The default D:/ComfyUI/input is a leftover from the author's Windows machine - change it or it'll error.)
    • seed - the index into the sorted file list. The node does seed % len(files), so out-of-range seeds just wrap around.
    • include_subfolders - on, it walks subdirectories with os.walk; off, it only reads the top level.

    It accepts .jpg, .jpeg, .png, .bmp, .tiff - note there's no .webp here, unlike the pack's Media Loader. If the folder has no valid images it raises a clear error instead of failing silently.

    Outputs are image and mask. Here's the gotcha: that mask isn't an alpha channel - it's the grayscale (luminance) version of the image, produced by converting to 'L' mode. So don't wire it into a compositing workflow expecting a transparent-mask load. It's just a luminance map, and for most img2img and VAE workflows you'll ignore it entirely.

    Installation is the pack-wide route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AI-TEC/ComfyUI-AITECCAFE-Toolkit
    pip install -r ComfyUI-AITECCAFE-Toolkit/requirements.txt
    

    or search "AITECCAFE" in ComfyUI Manager. The heavy tensorflow/opennsfw2 dependencies get pulled in for the pack's other nodes even though this one is pure Pillow+torch - a bit of a shame for such a lightweight node, but it installs and works.

    Real-world usage: drop it in front of anything that takes an IMAGE input, load a folder of raw renders, and queue. Because the seed increments each run, a batch job just keeps chewing through the folder in filename order until you stop it. If you need to jump to a specific image, type the exact index into the seed. If you want videos instead, the sibling AITEC Media Loader does the same folder-stepping with video frame control on top.

    CategoryAITECCAFE-Toolkit

    Inputs (3)

    NameTypeDefaultDescription
    folder_pathSTRINGD:/ComfyUI/input
    seedINT00–18446744073709550000
    include_subfoldersBOOLEANfalse

    Outputs (2)

    NameTypeDescription
    imageIMAGE
    maskMASK