Nodes/ComfyUI-Brekel/Brekel Load Image (with Filename & Caption)
ComfyUI Node

Brekel Load Image (with Filename & Caption)

A Load Image that hands you the filename

By Brekel·Created about a year ago·Updated 8 days ago· 19
Brekel Load Image (with Filename & Caption)
    • image
    • mask
    • filename
    • caption
    image

    This is the stock ComfyUI Load Image node, plus one output you didn't know you wanted: the filename. It loads an image from your ComfyUI/input folder exactly like the built-in node, but alongside the image tensor and alpha mask it also hands you the file's base name (extension stripped) as a string. That's it. That's the entire difference, and it's genuinely useful.

    It's an odd fit for a pack that's otherwise all about prompt generation - you're installing four prompt tools to get one image-loading convenience - but the author clearly got tired of the same problem you're about to hit: your image goes in as cat.png and you'd like your output to come out named after it.

    How it works

    Under the hood it's the same code path as ComfyUI's own Load Image - it lists image files in the input directory (upload widget included), runs EXIF-transpose, handles multi-frame and alpha channels, and produces the standard IMAGE + MASK pair. The third output is where it earns its keep: os.path.splitext(image)[0] on the filename, so my_picture.jpg comes out as the string my_picture. No extension, no directory, just the name.

    The inputs

    • image - a dropdown of everything in your input folder, with the usual upload button to add a new one. Nothing else to configure.

    The outputs that matter

    • IMAGE - the loaded image tensor, wired into your img2img / ControlNet / reference pipeline like any Load Image.
    • MASK - the alpha channel as a mask, same as the stock node.
    • STRING - the filename without extension. This is the new bit.

    That string is the whole point. The obvious wiring is into the filename_prefix of a Save Image / Save Animated WEBP / VHS node, so a batch of inpainting jobs names each output after its source image instead of dumping everything under one prefix. You can also pump it into a prompt, a metadata node, or anything that eats a string. Want the full name including extension? Not available - you get the base name, on purpose, since extensions and file prefixes don't mix well.

    Installing it

    It ships in the ComfyUI-Brekel pack. ComfyUI Manager → search "Brekel" → install → restart, or:

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

    No extra Python dependencies - the pack's requirements.txt (bitsandbytes, accelerate) exists for the LLM Prompt Enhancer, and this node doesn't touch any of it. It lives in the image category alongside the stock loaders, not under Brekel, so don't go hunting for it in the wrong menu.

    Where people get burned

    Not many places, honestly - this node is boring on purpose, and that's a compliment. The one trap: if you're on a workflow that relies on the stock Load Image node's exact behavior, this is a drop-in replacement for it (same IMAGE and MASK outputs), but a workflow that saved BrekelLoadImage in its JSON will flag the stock node as "missing" for someone who only has base ComfyUI - and vice versa. Standard custom-node sharing friction.

    One genuine limitation: the filename output only exists after you've picked a file, so there's no way to name outputs after a file that hasn't been loaded yet. You can't reference a folder path or a glob. Pick your image, wire the string, done. For a "same-named output per input" workflow it saves you a Regex or a hand-typed prefix every single time, which is exactly what it was made for.

    Categoryimage

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png

    Outputs (4)

    NameTypeDescription
    imageIMAGE
    maskMASK
    filenameSTRING
    captionSTRING