ComfyUI Node

Load Image

The stock Load Image node, plus the filename you wanted all along

By acgc99·Created 26 days ago·Updated a day ago· 0
Load Image
    • image
    • mask
    • filename
    • foldername
    • caption
    image

    The one thing the built-in loader won't tell you

    ComfyUI's core Load Image is fine - you pick a file from the input/ dropdown, you get an image and a mask, done. But it silently throws away the one piece of information you often need downstream: what is this file called? Load Image (with Filename) is a drop-in replacement that hands you that answer as a proper wire.

    What it does

    It subclasses the core LoadImage node, so the single input is the same image dropdown listing the files in your ComfyUI/input/ folder - same picker, same behavior, subfolder paths included. The outputs are where it differs. Besides image and mask you get two strings:

    • filename - just the basename, e.g. photo_023.png. Not the path.
    • foldername - the absolute path of the folder containing the file, e.g. /home/you/ComfyUI/input/subdir.

    Both come from resolving the annotated filepath the core node already computed, so they're the ground truth of what actually loaded, not a guess.

    Why you'd bother

    Automation. Name outputs after inputs. Wire filename into a Save Image node's filename_prefix and every generated file carries its source name - no more guessing which ComfyUI_00007_.png came from which input. Feed it to a text node so a captioning workflow can track what it's captioning, or into a logic node that branches on the filename.

    It's also a small debugging gift: when a workflow produces garbage, seeing filename and foldername in a preview tells you exactly what image you actually ran, which is less obvious than it should be once graphs get long.

    The caveat: still chained to input/

    Because it inherits from the core loader, this node reads only from ComfyUI/input/. The filename output doesn't buy you the ability to point at arbitrary absolute paths - that's the whole job of the sibling Load Image (from Any Folder). Think of them as different tools: this one is "stock loader, more info," the other is "any path on disk."

    The basename-only filename also means two input/ subfolders each containing a photo.png will report the same name. The foldername output disambiguates; if you need a unique key per file, wire both together.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/acgc99/ComfyUI-acgc99-pack.git
    

    or via ComfyUI Manager (search ComfyUI-acgc99-pack), then restart ComfyUI and reload the browser tab. Like the rest of the pack, there are no extra Python dependencies and no models to fetch.

    The pack is honest about its own ambitions - the author describes it as "vibe coded" - and this node is the most conservative member of the family: it changes nothing about how loading works, it just hands you the filename you were going to reconstruct by hand anyway. If you've ever written a script just to get a source filename into your save path, you know why that's worth having.

    Categoryacgc99

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png

    Outputs (5)

    NameTypeDescription
    imageIMAGE
    maskMASK
    filenameSTRING
    foldernameSTRING
    captionSTRING