ComfyUI Node

Image Loader

Point it at a folder, get back a list of image paths

By mediocreatmybest·Created about a year ago·Updated 12 months ago· 3
Image Loader
    • image_paths
    • image_directories
    directory_path./images
    skip_existing_captionsfalse

    Every other node in this pack works on lists of image paths - Batch Processor slices them, Caption Generator captions them, EXIF Metadata Extractor reads camera data off them, Caption Export writes files next to them. None of that has anything to work with until something actually scans a folder and produces that list. That's the entire job of Image Loader: it's the entry point of the pipeline.

    How it works

    Point it at a directory and it walks the folder, collecting image files, and hands back their paths as a list. That's it - no captioning, no model loading, nothing GPU-related happens here. It's the fastest, cheapest node in the whole pack to run.

    The inputs and outputs that matter

    • directory_path (STRING, default "./images") - the folder to scan. That default is a relative path, which is the most common trap: it resolves relative to wherever the ComfyUI process's working directory is, not relative to your workflow file or where your images actually live. If nothing loads and there's no obvious error, switch to an absolute path first.
    • skip_existing_captions (optional, BOOLEAN, default false) - when enabled, images that already have a matching caption file sitting next to them get excluded from the output. This is the resume switch: caption a folder, get interrupted or add new images later, re-run with this on, and only the images still missing a caption go through the (often expensive) captioning step again.

    Two outputs: image_paths (LIST) - the flat list every downstream node consumes - and image_directories (DICT), which reads as a mapping between images and the folder(s) they came from. That second output is the practical reason to use this node over just hand-building a path list yourself: if directory_path contains subfolders, image_directories is what lets Caption Export and similar nodes figure out where each image actually lives, rather than assuming everything sits flat in one directory.

    Installing it

    Through ComfyUI Manager: search ComfyUI-Transformers-Pipeline, install, restart. By hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/mediocreatmybest/ComfyUI-Transformers-Pipeline
    

    then restart. Nothing to download for this node itself - it only touches your local filesystem.

    Common issues & troubleshooting

    image_paths comes back empty. Almost always the directory_path default. ./images is relative, and if the process's working directory isn't what you assumed, the folder it's actually looking in doesn't exist or is empty. Switch to a full absolute path and confirm it loads before troubleshooting anything further downstream.

    skip_existing_captions isn't skipping anything. This depends on caption files actually existing where the node expects to find them, matched to how Caption Export names its output files. If you changed file_extension on Caption Export away from the default txt, or ran a different tool to produce your existing captions, the naming might not line up - check that a caption file for a given image is actually sitting next to it with the extension this pack expects.

    Re-running the whole workflow re-captions everything, even images you already did. That's skip_existing_captions defaulting to off - turn it on if you're deliberately trying to resume rather than redo a captioning pass from scratch.

    CategoryTransformers Pipeline

    Inputs (2)

    NameTypeDefaultDescription
    directory_pathSTRING./images
    skip_existing_captionsoptBOOLEANfalse

    Outputs (2)

    NameTypeDescription
    image_pathsLIST
    image_directoriesDICT