Nodes/comfyUI-tool-2lab/Load Image By Path (2lab)
ComfyUI Node

Load Image By Path (2lab)

Load an image from anywhere on disk, not just the input folder

By AI2lab·Created 2 years ago·Updated 2 years ago· 23
Load Image By Path (2lab)
    • IMAGE
    • MASK
    image_path

    Core ComfyUI's image loader has a rule: your images have to live in the input folder. LoadImageByPath (2lab) is the node that says "nah, give me a path." Instead of a dropdown of files in ComfyUI/input, it takes an absolute filesystem path and loads whatever image is there - IMAGE and MASK out, exactly like the core loader.

    This is a quiet lifesaver for anyone whose images don't conveniently live inside the ComfyUI directory. You've got a dataset in D:/projects/reference/, or outputs being written by another tool to an arbitrary folder, or a network share - anywhere outside the sandboxed input folder. Rather than copying files in (and re-copying every time they change), you point this node at the real location and it reads them live. For batch processing pipelines that loop over a folder of reference images, that's the difference between a workflow and a chore.

    How it works

    One required input:

    • image_path - the file path, a plain string. Use an absolute path (or one relative to where the ComfyUI process runs). This is where most people trip: ComfyUI's current working directory isn't always what you think, so when in doubt, use the full path. On Windows, both backslash and forward-slash forms generally work, but forward slashes avoid a whole class of escape-character headaches.

    Outputs:

    • IMAGE - the image tensor, for VAE Encode, img2img, upscaling, any downstream consumer.
    • MASK - the alpha channel as a mask, for images with transparency.

    The one thing to keep in mind is a security note, not a bug: this node reads arbitrary paths from a string, which is exactly why ComfyUI's default loader restricts you to the input folder in the first place. On your own machine with local files, it's harmless and convenient. If you're running a shared or internet-exposed ComfyUI instance (and the ecosystem has had bad experiences with that), any node that reads a caller-supplied path widens the attack surface - don't expose unauthenticated instances, and don't hand this node untrusted paths.

    Installing it

    From AI2lab/comfyUI-tool-2lab. ComfyUI Manager → search comfyUI-tool-2lab → Install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AI2lab/comfyUI-tool-2lab
    

    Restart ComfyUI after. No models, no dependency drama - the whole pack is lightweight utilities from a Chinese dev, README one word long, nodes labeled in 中文. If all your images live in the input folder, skip it. If any of them don't, this is the node that lets your workflow read the files where they actually are.

    Category☁️2lab/image

    Inputs (1)

    NameTypeDefaultDescription
    image_pathSTRING

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK