Nodes/SD Prompt Reader/SD Batch Loader
ComfyUI Node

SD Batch Loader

Feed a whole folder of images into SD Prompt Reader at once

By receyuki·Created 3 years ago·Updated 2 years ago· 463
SD Batch Loader
    • IMAGE
    path./input/
    image_load_limit0
    start_index0

    SDPromptReader is great when you have one image with a prompt you want to steal. But one image at a time gets tedious fast when you've got a folder full of Civitai downloads to catalog. That's the gap SDBatchLoader fills: it hands SD Prompt Reader a whole list of images to read in one go.

    How it works

    The node takes a path and returns a list of image file paths. path accepts a directory (./input/ is the default, absolute paths like C:/Users/you/Pictures work too, and both slash styles are fine), a single file, or even a list of files. In the directory case, it grabs everything in a supported format, sorts them, and - if you set them - honors image_load_limit (how many to read) and start_index (where in the sorted list to begin). If you pass a single file or a list instead of a directory, those two limits are ignored and everything you gave it is returned.

    The output is IMAGE, which is a lie in the best way: it's typed as a wildcard and is actually a list of paths, not tensors. That's why the README is explicit that this node is only for the SD Prompt Reader node. Connect its output to the reader's image input and the reader steps through every file. Try to wire it into a normal Load Image and you'll get nothing but confusion.

    There are two things to expect when you batch. The preview image doesn't update per file, and the text box shows the metadata of only the last image read. The node does stream each file's path to the UI, so you can watch it chew through the list - but the actual per-image results (positive, negative, seed, and so on) still come out of the reader's outputs. If you want per-image records, you'll want to couple this with the pack's SD Parameter Extractor or your own logging rather than staring at the preview.

    When you'd actually use it

    The natural workflow is: point SDBatchLoader at a folder of downloaded images, feed them to SD Prompt Reader, and extract metadata to rebuild prompts or sort images by model. It's also handy for a quick audit - "which of these 200 files were made with that checkpoint?" - since the reader's MODEL_NAME output tries to resolve metadata model names against your installed checkpoints.

    Honestly, if you're just checking a couple of files, don't bother. The built-in Load Image plus the reader is fewer nodes. This earns its place when the folder count goes from "a couple" to "a stack," or when you want it wired into something that runs unattended.

    Installing it

    Same as the whole pack - ComfyUI Manager, search "SD Prompt Reader," or:

    cd ComfyUI/custom_nodes
    git clone --recursive https://github.com/receyuki/comfyui-prompt-reader-node.git
    cd comfyui-prompt-reader-node
    pip install -r requirements.txt
    

    Restart after. The --recursive matters because the pack's metadata-reading engine lives in a submodule. No model downloads, just the single piexif dependency.

    The edge cases

    A path that doesn't exist raises a FileNotFoundError rather than a friendly empty list - check your path before you queue up a big batch. And remember that start_index and image_load_limit silently do nothing when you feed it a file list instead of a directory, which has tripped up more than one person expecting a list to be sliced like a folder.

    CategorySD Prompt Reader

    Inputs (3)

    NameTypeDefaultDescription
    pathSTRING./input/
    image_load_limitoptINT0
    start_indexoptINT0

    Outputs (1)

    NameTypeDescription
    IMAGE*