Nodes/ComfyUI Usability/Load Image By Path
ComfyUI Node

Load Image By Path

Load an image from anywhere on disk, not just ComfyUI's input folder

By kappa54m·Created 3 years ago·Updated 2 years ago· 0
Load Image By Path
    • IMAGE
    • MASK
    image

    ComfyUI's stock Load Image node has a blind spot: it only sees files inside ComfyUI/input/. Everything else has to be copied or symlinked in first. Load Image By Path (KLoadImageByPath) skips that entirely - you give it an absolute path and it reads the image straight off the disk, wherever that happens to be. It's one of those small quality-of-life nodes you don't need until you suddenly really need it.

    Who's it for? Anyone whose source images live outside the input folder. The classic case is a remote setup: ComfyUI running on a server with a filesystem mounted from somewhere else, while you edit images locally in Photoshop or GIMP. Instead of manually syncing every file into input/, you just point the node at the path.

    How it works

    The image input is a plain text field, not the usual dropdown - type or paste an absolute path and hit enter. The node reads the file through the same pipeline stock Load Image uses (EXIF-transpose, RGB conversion, alpha-to-mask), then hands you IMAGE and MASK tensors. Two niceties worth knowing:

    • It expands ~, so ~/pics/ref.png works, and it strips a matching pair of surrounding quotes - a path you copied from a file manager pastes straight in.
    • If the path is invalid, validation fails at the node itself with "Invalid input image", not mid-run.

    The genuinely clever part is auto-refresh. If the watchdog package is installed, the node watches the actual file on disk and regenerates its preview when the file changes. Combined with IS_CHANGED being a hash of the file's contents, that means the whole graph re-runs when your source file changes. That's the README's "keep editing an image in another program and exporting it with the same filename" workflow, and it's legitimately handy when iterating on a reference you're still painting over. Preview images land in ComfyUI's temp dir; the "update preview" and "refresh auto preview" buttons on the node nudge that along manually if you'd rather not wait.

    The inputs that matter

    Just the one: image, a string holding the absolute path. Outputs are IMAGE and MASK, wired exactly like stock Load Image - IMAGE into your VAE encode / sampler stack, MASK into anything that takes a mask (the alpha channel becomes the mask, inverted the same way core does it).

    Installing it

    This node ships in kappa54m/ComfyUI_Usability ("ComfyUI Usability"), a small pack containing exactly these three loader nodes and nothing heavy - the only Python dependency is watchdog. Install via ComfyUI Manager (search "ComfyUI Usability"), or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kappa54m/ComfyUI_Usability
    cd ComfyUI_Usability
    pip install -r requirements.txt   # watchdog
    

    Then restart ComfyUI. No model files, no weights, no GPU work - this is pure plumbing.

    Common gotchas

    • It must be an absolute path. Relative paths resolve against ComfyUI's working directory, which is almost never where you think it is. When in doubt, /-prefix it.
    • No watchdog, no auto-refresh. If the import fails, ComfyUI prints a message to the console and auto-refresh silently disables - the node still loads images fine. Manager installs requirements for you; a manual clone forgets pip install -r requirements.txt embarrassingly often.
    • The file must exist when the node runs. It's read at execution time; point it at a path that vanished and the run fails.
    • PSD/XCF previews need ImageMagick. Loading works via PIL, but generating the on-node preview for those formats shells out to magick/convert. Without ImageMagick on the machine, no preview for those files - a niche annoyance, but a real one.
    Categoryimage

    Inputs (1)

    NameTypeDefaultDescription
    imageSTRING

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK