Nodes/BSS WD14 Batch Tagger/BSS Load Images from Folder 📂
ComfyUI Node

BSS Load Images from Folder 📂

The dumb little node that kicks off a captioning run

By BlackSnowSkill·Created 10 months ago·Updated 7 months ago· 6
BSS Load Images from Folder 📂
    • images
    • filenames
    • folder_path
    folder_path

    The whole job of this node is one sentence: point it at a folder, get every image back as a ComfyUI-native IMAGE plus the file names. That sounds trivial until you're staring down fifty reference images that need captions for a LoRA and you realize ComfyUI's built-in Load Image only does one file at a time. This is the loader half of the BSS WD14 Batch Tagger pack, and its only real purpose is to feed a WD14 tagger so you can auto-caption a dataset.

    What it does

    One input, three outputs. You give it folder_path - an absolute path, not a relative one, because a relative path resolves against wherever you launched ComfyUI and will quietly load nothing. It scans the folder, keeps only .jpg, .jpeg, .png, and .webp files (case-insensitive), sorts them alphabetically, and converts each to an RGB tensor in the standard float 0–1 range. Then it hands you:

    • images - a list of IMAGE tensors, in sorted order
    • filenames - the bare file names, e.g. 024.png, not the full path
    • folder_path - the path you fed in, echoed back for convenience

    That's it. There are no settings, no resolution options, no filters beyond the four extensions. The sorting matters more than you'd think: the filenames line up 1:1 with the images, so the tagger downstream can pair each image with the right name and write its caption file.

    Where it fits

    The intended flow is loader → tagger. Wire images into the tagger's image input, and pass filenames and folder_path along so the tagger knows what to call the output - the pack's usual trick is to set the output folder to the same directory as the images, so each .txt caption lands right next to its picture. That's exactly the folder-of-image-plus-txt layout kohya and friends expect for training, and why WD14-style Danbooru tags matter here at all: models like Illustrious and NoobAI were trained on that tag vocabulary, so it's the format their training data wants. See the danbooru-tags knowledge panel for the full "why tags, not sentences" story.

    Gotchas worth knowing

    • It's not recursive. Subfolders are ignored - only files directly in the folder get loaded. Flatten your dataset first.
    • It always re-runs. The node reports "changed" on every execution, so it picks up newly dropped files each run - but it also never caches, so pointing it at a huge folder on every queue is slow.
    • A bad path is silent. If the folder doesn't exist or is empty, you get empty lists back and the tagger downstream just produces nothing. Check the console for the logged error.

    Install

    This node ships in the BSS WD14 Batch Tagger pack, so you install the whole thing: ComfyUI Manager → search BSS WD14 Batch Tagger → Install → restart. Manual, from the pack root:

    cd ComfyUI/custom_nodes
    git clone https://github.com/BlackSnowSkill/wd14_batch_tagger
    cd wd14_batch_tagger
    pip install -r requirements.txt
    

    The pack pulls in onnxruntime, numpy, pillow, and huggingface-hub - overkill for a folder reader alone, but you're getting it because the tagger needs the runtime. The loader itself just reads files; the heavy stuff happens when you actually tag.

    CategoryBSS/Image Processing

    Inputs (1)

    NameTypeDefaultDescription
    folder_pathSTRING

    Outputs (3)

    NameTypeDescription
    imagesIMAGE
    filenamesSTRING
    folder_pathSTRING