Nodes/ComfyUI-UtilsCollection/Load Image (Path)
ComfyUI Node

Load Image (Path)

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

By silveroxides·Created 2 months ago·Updated about 7 hours ago· 24
Load Image (Path)
    • IMAGE
    • MASK
    • MASK_INVERTED
    image_path

    Stock ComfyUI's Load Image only browses ComfyUI/input. That's fine for small workflows and actively annoying the moment your source images live elsewhere - a renders folder, a dataset directory, a shared drive, an output folder from a previous run. UC_LoadImagePath loads a single image from an explicit filesystem path, absolute or relative, on any OS. It exists for exactly the situation where the input-folder jail gets in your way.

    It's the single-file companion to UC_LoadImageDirectory in the same pack: that one does folders, this one does one path with the same path-robustness work done properly.

    How it works

    The useful work here is in path handling, and it's done carefully. The image_path input accepts:

    • absolute paths (C:\data\shoot\a.png or /mnt/render/a.png)
    • relative paths (including . / ..)
    • backslashes or forward slashes - it normalizes either
    • paths and filenames with spaces (it strips leading/trailing whitespace but preserves internal spaces)

    Whatever you give it gets normalized to an absolute path and loaded. The outputs mirror Core's loader but better behaved:

    • IMAGE - the pixels.
    • MASK - a mask extracted from the alpha channel. Images without alpha get a full-size zero mask, not the tiny 64×64 placeholder that trips people up with Core's loader.
    • MASK_INVERTED - the inverted alpha mask, handy for inpainting or compositing "keep everything except the cutout" logic.

    When you'd reach for it

    Any time the source image isn't in ComfyUI/input: iterating over your own output directories, feeding a workflow from a dataset on a different disk, scripting batch runs where paths are computed at runtime, or chaining with other path-based tools in this pack (the UC_LoadImageDirectory for whole folders, UC_Krea2InputEmbeds which also takes raw image paths). If your pipeline is a mix of "workflow files" and "my actual files", this node is the bridge.

    Install

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

    Restart (or ComfyUI Manager → search "ComfyUI-UtilsCollection"). Pack deps are opencv-python and typing-extensions.

    Two things to keep straight. First, "any path" means any path on the machine running ComfyUI - if you're using a remote server, C:\... from your laptop won't resolve there. Second, this loads pixels only: unlike Core's loader it's not tied to the workflow-embedded-metadata flow, so drag-a-PNG-back won't magically reconstruct anything through this node. For plain "I have a file path, give me an image", it just works.

    Categoryadvanced/image

    Inputs (1)

    NameTypeDefaultDescription
    image_pathSTRINGPath to the image file. Supports absolute or relative paths with any OS format (backslashes or forward slashes). Whitespaces in paths are supported.

    Outputs (3)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK
    MASK_INVERTEDMASK