Nodes/ComfyUI_yanc/๐Ÿ˜ผ> Load Image
ComfyUI Node

๐Ÿ˜ผ> Load Image

The vanilla loader, plus the filename output ComfyUI forgot to ship

By ALatentPlaceยทCreated 2 years agoยทUpdated 2 years agoยท 80
๐Ÿ˜ผ> Load Image
    • IMAGE
    • MASK
    • FILENAME
    โ—„imageโ–พโ–บ
    โ—„strip_extensiontrueโ–บ

    This is deliberately not a reinvention. The author's own description in the README is blunt about it: "Basically the same like the ComfyUI vanilla node, but with a filename output." If you've ever needed to know the name of the file you just loaded - to reuse it in an output filename, log it, or match it against something else in the workflow - the built-in Load Image simply doesn't tell you, and this is the drop-in replacement that does.

    It's a small enough addition that it's shown up on Reddit as the answer to "why can't I find a filename option on Load Image" threads - someone pointed a confused user at this exact node as a stand-in when they thought a filename output should've been part of vanilla ComfyUI.

    How it works

    Functionally identical to the built-in loader: pick an image from your input directory via the dropdown, it loads the IMAGE and its alpha-channel MASK the same way vanilla does. The addition is a third output carrying the filename, with a toggle for whether the file extension comes along for the ride.

    The inputs and outputs that matter

    • image - a dropdown of files in your ComfyUI input directory, same selection UI as the vanilla node.
    • strip_extension (BOOLEAN, default true) - when on, the filename output drops the .png/.jpg suffix (example.png becomes example). Turn it off if you want the extension preserved, say for logging exactly what file was loaded.

    Three outputs: IMAGE, MASK (the standard alpha/transparency mask vanilla Load Image also provides), and FILENAME (STRING) - feed that last one into Text Combine to build a matching output filename in Save Image, so a batch of processed images keeps traceable names instead of a generic auto-incrementing counter.

    How to install it

    Via ComfyUI Manager: search "yanc" or "YANC - Yet Another Node Collection," install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ALatentPlace/ComfyUI_yanc
    

    then restart. No extra dependencies or model downloads - it wraps the same image-loading path ComfyUI's own loader uses.

    Common issues & troubleshooting

    You only need this for the filename output, and it feels like overkill for one feature. Fair - if all you need is a filename to string, this is still the lightest way to get it without writing a custom node yourself; the alternative of parsing a filename out of a full path via a text/regex node elsewhere is more moving parts for the same result.

    Extension shows up when you didn't want it (or vice versa). That's strip_extension - default is true (extension stripped), so if you're seeing .png in your filename output, someone (possibly a saved workflow you didn't build) flipped it to false.

    Dropdown doesn't show a newly added image. Same limitation as vanilla Load Image - the dropdown is populated from what's in the input directory at the time the ComfyUI page loaded or was last refreshed. Drop a new file in and it won't appear until you refresh the browser tab or restart, same as the built-in node.

    You actually wanted to load from a subfolder or iterate through a batch. This node is single-file-at-a-time, same as vanilla. For folder-based loading (random pick or index-driven iteration), use YANC's separate Load Image From Folder node instead.

    CategoryYANC/๐Ÿ˜ผ Image

    Inputs (2)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png
    strip_extensionBOOLEANtrueโ€”

    Outputs (3)

    NameTypeDescription
    IMAGEIMAGEโ€”
    MASKMASKโ€”
    FILENAMESTRINGโ€”