Nodes/ComfyUI-EditUtils/EditUtils: Load Image With Filename lrzjason
ComfyUI Node

EditUtils: Load Image With Filename lrzjason

Stock LoadImage, plus a filename output — so you can actually do something with it

By lrzjason·Created 7 months ago·Updated 16 days ago· 207
EditUtils: Load Image With Filename lrzjason
    • image
    • mask
    • filename
    image

    ComfyUI's built-in LoadImage has a quiet gap: it loads the image and the alpha mask, but the filename is gone the moment the pixels enter the graph. LoadImageWithFilename_EditUtils is the same loader with the name preserved - a third filename output (a STRING, without the extension) alongside the usual image and mask.

    That one extra string unlocks a surprisingly common pattern in edit workflows: filename-conditioned logic. Save the edited image using the source's name. Feed the filename into a text node to build a caption. Route on which file was loaded. In a batch of reference images you suddenly know which one you're looking at, which matters when the whole point of a multi-image configs chain is keeping track of what's where.

    Under the hood it's stock ComfyUI loading code, so all the built-in conveniences carry over: image_upload support so you can drag files into the widget, multi-frame GIF/WebP handling (frames get stacked on the batch dimension), EXIF rotation via exif_transpose, and alpha channels converted to a mask output. The filename output is just os.path.basename minus the extension - no path, no dot. If the file is photo.png, you get photo.

    The one difference worth knowing versus core: the image input here is a file-picker enum, same as stock LoadImage. And because this pack's category is image rather than advanced/conditioning, it's not in the same menu cluster as the rest of EditUtils - look for it under the image category. Small thing, but it trips people up the first time they go hunting.

    Honestly? If you never touch the filename, use stock LoadImage. This node's reason to exist is entirely that string output. But for anyone building a real editing pipeline - save results named after sources, batch-process with per-file tracking - the name is the piece that makes it feel finished instead of bolted together.

    Install

    Part of lrzjason/ComfyUI-EditUtils. Install via ComfyUI Manager (search "ComfyUI-EditUtils") or cd ComfyUI/custom_nodes && git clone https://github.com/lrzjason/ComfyUI-EditUtils, then restart. No pip dependencies, no model downloads.

    Troubleshooting

    The usual file-loading complaints apply: if your image doesn't appear in the dropdown, it needs to be in ComfyUI's input directory (or drag-and-dropped). The filename output is basename-only by design - if you want the full path, this node won't give it to you. Multi-frame images produce a batched image output, and the filename is the same for every frame, which is expected, not a bug.

    Categoryimage

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png

    Outputs (3)

    NameTypeDescription
    imageIMAGE
    maskMASK
    filenameSTRING