Nodes/Y7Nodes for ComfyUI/Y7 Load Image (subfolders)
ComfyUI Node

Y7 Load Image (subfolders)

Load Image, but it actually sees your subfolders

By yushan777·Created about a year ago·Updated 4 days ago· 8
Y7 Load Image (subfolders)
    • image
    • mask
    image

    The built-in Load Image node only shows files that live directly in ComfyUI's input folder. Start organizing your images into subdirectories - input/refs/, input/datasets/cats/, whatever - and they vanish from the dropdown. Y7 Load Image fixes exactly that one thing: it walks the entire input directory tree, so images in subfolders show up, with their relative paths in the dropdown.

    It's from the Y7Nodes pack, and it's a straight clone of the built-in node's behavior with the folder-walking added. If your input folder is a flat pile, this node does nothing for you. If it's a organized tree, this is a tiny quality-of-life win.

    How it works

    Under the hood it does a recursive walk of the input directory (os.walk), filters out junk (Thumbs.db, .DS_Store, desktop.ini, lock files, and the clipspace and dot-folder directories), and lists every image with its path relative to the input folder. Files in subdirectories appear as subfolder/name.png, and ComfyUI's upload button still works for dropping in a fresh image.

    The execution path mirrors the built-in node: EXIF-transpose the image, convert to RGB float32, and produce the same two outputs:

    • image - the IMAGE tensor.
    • mask - a MASK tensor. For images with an alpha channel, it's the inverted alpha as a mask; for images without one, it's a zeroed 64×64 mask.

    It also implements IS_CHANGED hashing and VALIDATE_INPUTS the same way the built-in node does, so caching and error reporting behave identically.

    When it's the right tool

    Two situations. First, the obvious one: you keep reference images or source photos organized in subfolders and are tired of shuffling files into the input root to use them. Second, batch workflows where a Load Image in a template needs to point at a specific organized folder - this node's dropdown reflects the real folder structure, so the path you see is the path that loads.

    Honest caveat: it only reads from the ComfyUI input directory. If you want to load images from an arbitrary folder elsewhere on disk, this isn't that - for arbitrary paths you'd want something like Y7 Image Batch Path (which takes a directory path directly) or a folder-path loader from another pack. Y7 Load Image is strictly "the input folder, but recursive."

    Installing it

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

    Restart ComfyUI, or install via ComfyUI Manager → search "Y7Nodes". No extra dependencies beyond the pack standard - it's plain PIL/torch under the hood.

    Gotchas

    Not much to trip on. The dropdown reflects the tree at the time the menu was built, so if you add files to a subfolder while ComfyUI is running, refresh the node list (reload the UI) to see them. And because it walks recursively, a deeply nested or enormous input folder makes the dropdown population a little slower - nothing that'll hurt, just a beat. Otherwise it behaves exactly like Load Image, which is the entire point.

    CategoryY7Nodes/Image

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png

    Outputs (2)

    NameTypeDescription
    imageIMAGE
    maskMASK