ComfyUI Node

Image Loader

Load Image, but with a filename you can actually use in your prompt

By loz2754·Created 8 months ago·Updated a day ago· 5
Image Loader
    • IMAGE
    • MASK
    • image name
    • cleaned filename
    image
    max_num_words0

    ComfyUI's stock Load Image is fine until you want to do anything with the name of the image you loaded. Want the filename in your prompt, in a save path, in a caption? Stock Load Image hands you pixels and a mask and nothing else. AUNImgLoader is that node with the filename problem solved: it loads an image and also gives you the original filename and a cleaned-up version that's safe to drop into prompts, filenames, or any text output.

    How it works

    Nothing mysterious under the hood. It's the standard image loader path - open the file from your input folder, apply EXIF transpose so phone photos aren't sideways, convert to RGB, expose the alpha channel as a mask - plus a small filename utility bolted on. Two strings come out: image name (the raw filename) and cleaned filename.

    The difference between them is what makes this node worth reaching for. image name is whatever the file is called. cleaned filename strips the extension and does the cleanup that matters when you're building prompts or output paths - no stray separators, nothing that'll break a filename. There's a max_num_words input (0 to 32, default 0) that caps how many words survive, which is genuinely handy when your image is named something like saturday_portrait_golden_hour_candid_0082.png and you only want the first two words in your prompt.

    The inputs and outputs

    Inputs are exactly two: image (the dropdown of files in your input folder) and max_num_words. That's the whole widget surface - a beginner can't really misconfigure it.

    Outputs:

    • IMAGE - the pixels, wired into anything that takes an image.
    • MASK - the alpha channel as a mask, or an all-ones mask if the image has no alpha. Wire it into mask-aware nodes if you need it; ignore it otherwise.
    • image name - the original filename.
    • cleaned filename - the cleaned version, your best friend for prompts and file outputs.

    Installing it

    AUNImgLoader ships in the AUN pack, so it's one install for all the nodes:

    • ComfyUI Manager: search "AUN ComfyUI Nodes", install, restart.
    • Manual: cd custom_nodes && git clone https://github.com/loz2754/AUN-ComfyUI-Nodes, then restart.

    If you cloned manually and see ModuleNotFoundError: cv2 or piexif, install the pack's deps: pip install -r custom_nodes/AUN-ComfyUI-Nodes/requirements.txt.

    Common issues

    Honestly, not much to go wrong here. The classic gotcha is that cleaned filename is designed for use in prompts and filenames, so it strips things a raw path might need - don't try to reconstruct a full path from it. And remember the image dropdown only lists files in ComfyUI's input folder; if your file isn't showing, that's where it needs to live.

    CategoryAUN Nodes/Image

    Inputs (2)

    NameTypeDefaultDescription
    imageCOMBOSelect the image to load.
    max_num_wordsINT00–32Maximum number of words to keep for both filename outputs. Set to 0 for no limit.

    Outputs (4)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK
    image nameSTRING
    cleaned filenameSTRING