ComfyUI Node

LoRA Caption Load

The one input that turns a folder of images into a LoRA dataset

By LarryJane491·Created 3 years ago·Updated 2 years ago· 80
LoRA Caption Load
    • Name list
    • path
    • Image list
    path

    LoRA Caption Load is the front half of the Image-Captioning-in-ComfyUI pack, and its whole job fits in one sentence: you paste a folder path, it hands your images to the WD14 Tagger, and lets you caption a whole dataset without opening a file explorer even once. If you're building a training set for an anime model, this is the shortcut that turns a folder into caption files in one queue.

    The name undersells it. The node itself does zero captioning - the WD 1.4 Tagger node (from pythongosssss's ComfyUI-WD14-Tagger) does the actual work, and this pack's author is upfront that these nodes are just a convenient wrapper around that one. What Load actually gives you is the boring-but-necessary plumbing: it loads every image in a folder as a batch and it extracts the filenames, which is the part nobody wants to do by hand. On its own it's a folder reader. Wired into the tagger, it's the first step of a complete caption pipeline.

    How it works

    The node has exactly one widget, path. Paste the absolute path to your image folder there. Under the hood it globs *.png - and yes, only .png; the README is explicit and the code enforces it. Any other format in the folder is silently ignored. It then does three things with what it finds:

    • Name list (STRING): the filename of every PNG, one per line. This is the clever bit - it's how the Save node knows what to name each caption file.
    • path (STRING): just passes your folder path through, so the Save node knows where to write.
    • Image list (IMAGE): the images themselves, loaded as a batch for the tagger.

    One genuinely nice detail: if your images aren't all the same resolution, the node upscales them to match the first one before batching. That's the kind of thing that quietly saves you from a cryptic tensor-size error at the tagger.

    Wiring it up

    The workflow the README shows is Load → Tagger → Save, and it's worth following literally:

    • Image list → the Tagger's image input
    • Name list → the Save node's namelist
    • path → the Save node's path
    • The Tagger's caption output → the Save node's text

    That's the whole graph. Right-click empty space and search "caption", or look under the LJRE category in the menu - both nodes live there.

    Installing

    Two ways, both trivial:

    # ComfyUI Manager: search "Image-Captioning-in-ComfyUI" and install
    # or manually:
    cd ComfyUI/custom_nodes
    git clone https://github.com/LarryJane491/Image-Captioning-in-ComfyUI
    

    Then restart ComfyUI. There are no extra dependencies - the pack ships with just one Python file and uses only PIL, torch and comfy's own utils, all of which ComfyUI already has. The real requirement is the WD14 Tagger node and its model, which it downloads on first use; that's where the actual captioning happens, and it's a Danbooru-tags machine built for anime models, so don't expect it to shine on photoreal sets.

    Where people get burned

    The one failure mode people actually hit (there's a real r/comfyui thread about it) is the path ... cannot be found. error. It almost always means you pasted a Windows path with stray quotes or a trailing space - the node checks the path verbatim and fails hard. Point the widget at the folder that directly contains the images, no quotes, no trailing whitespace, and it just works.

    The honest verdict: this is a thin, unmaintained convenience node (one commit, 2024 vintage), and the author credits Inspire Pack and YMC Suite as its parents. It works exactly as described. If you'd rather not add another dependency, you can replicate it with a Load Images node and a bit of Python - but you won't get the filename list for free. For a one-queue caption pass, that's worth the install.

    CategoryLJRE/LORA

    Inputs (1)

    NameTypeDefaultDescription
    pathSTRING

    Outputs (3)

    NameTypeDescription
    Name listSTRING
    pathSTRING
    Image listIMAGE