Nodes/comfyui-mask-util/Load Image With Name
ComfyUI Node

Load Image With Name

Load an Image by Filename Instead of a Dropdown

By longgui0318·Created 3 years ago·Updated about a year ago· 8
Load Image With Name
    • IMAGE
    • MASK
    image

    ComfyUI's built-in Load Image node makes you click through a dropdown or an upload dialog to pick a file. That's fine for one-off manual work, but it falls apart the moment you want to drive the choice programmatically - from an API call, a script, or another node that computed a filename at runtime. Load Image With Name fixes that by swapping the dropdown for a plain text field: give it a filename as a string, and it loads that file, full stop.

    The single required input is image, a plain string (empty by default, single-line). Type or wire in a filename - how ComfyUI resolves that path depends on your setup, but the point of the node is that it's a string input rather than a picker, so anything that can produce text can feed it: a manually typed name, a value computed upstream, or another node's string output. It gives you two outputs in return, IMAGE and MASK, matching the behavior of ComfyUI's own Load Image node - the mask comes from the image's alpha channel if it has one.

    The natural partner here, from the same pack, is Output Image To Input - that node lists files sitting in your ComfyUI output folder and hands back a filename string, which is exactly the shape of input this node wants. Chain them and you get a clean "pick a previously generated image, load it back in as a real IMAGE + MASK pair" workflow without touching your OS file browser. It's also the node you'd reach for in any setup where the filename to load isn't known until the graph is already running - batch processing a folder, or an API-driven pipeline where the caller supplies the filename as a parameter.

    Installing it: comfyui-mask-util is a small utility pack from longgui0318, the same author behind comfyui-magic-clothing, a virtual-try-on node wrapper that had a brief spike of attention on Reddit in 2024 and has been quiet since. This pack reads like the general glue split out of that project - plumbing nodes rather than anything with a following of its own, which matters mainly because there's no real documentation to lean on: the GitHub README is just the repo's title, nothing else.

    Install through ComfyUI Manager (search "comfyui-mask-util") or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/longgui0318/comfyui-mask-util
    

    Restart ComfyUI afterward. No model downloads - this is a file-load node, same category of work ComfyUI already does natively, just with a text field instead of a picker.

    Where it bites: because image is free text with no dropdown to guide you, a typo or a wrong subfolder gets you a load failure instead of a helpful autocomplete - there's no validation until the graph actually runs. Whether you can point it at an arbitrary path outside ComfyUI's normal input directory or need to stick to files already in the expected folder is a real distinction that matters for automated pipelines, and it's exactly the kind of detail this pack's blank README doesn't cover - test with a known-good filename first before wiring anything dynamic into it. And remember the mask output is only meaningful if your source image actually carries alpha; a plain JPEG will hand you back an empty or fully-opaque mask, not an error.

    Categoryimage

    Inputs (1)

    NameTypeDefaultDescription
    imageSTRING

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK