Nodes/Nodes for use with real-time applications of ComfyUI/Load Image From Path πŸ•’πŸ…‘πŸ…£πŸ…
ComfyUI Node

Load Image From Path πŸ•’πŸ…‘πŸ…£πŸ…

Load Any Image From an Absolute Path, No Input-Folder Tetris Required

By ryanontheinsideΒ·Created 2 years agoΒ·Updated about a year agoΒ· 82
Load Image From Path πŸ•’πŸ…‘πŸ…£πŸ…
    • IMAGE
    • MASK
    β—„image_pathβ–Ί

    The stock Load Image node only sees files inside ComfyUI's input folder, and getting a file in there from another program is a chore - drag, drop, refresh, pray. Load Image From Path skips the folder entirely. You type an absolute path and it loads that image, wherever it lives on disk. It's the image-loading equivalent of "just give me the file."

    Which matters more than you'd think in real-time workflows. The whole point of this pack is that things change per execution, and here that extends to the input: because image_path is a plain string input, you can drive it from another node. A sequence control cycling through paths, a control node swapping between two files, a script writing frames to disk - any of those can decide which image the loader pulls next, and the graph follows along.

    Under the hood it's a thin wrapper over PIL: Image.open, an exif_transpose (so phone photos don't come in sideways), and a convert to RGB. The mask output is the interesting bit - if the file has an alpha channel, the mask is 1 - alpha, i.e. it encodes where the image is transparent. No alpha? You get a dummy 64Γ—64 zero mask, which is ComfyUI's standard "no mask here" shape. So a transparent PNG loads with a ready-made cut-out mask, which is handy for compositing sprites onto a live frame.

    The inputs that matter

    There's basically one: image_path - the full path to the file, like /home/you/pics/thing.png. The tooltip says it plainly: "Full path to the image file to load." That's the entire configuration surface.

    Outputs: IMAGE and MASK. If the file has an alpha channel, the mask is the transparency cut-out; if not, it's a harmless dummy.

    Install

    Standard for this pack - ryanontheinside/ComfyUI_RealtimeNodes via ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ryanontheinside/ComfyUI_RealtimeNodes
    cd ComfyUI_RealtimeNodes
    pip install -r requirements.txt
    

    Restart and it'll be in the Image category.

    Common issues

    The failure mode here is boring and predictable: a wrong or empty path throws a Python exception right in the node. There's no path picker, so typos are on you - check for trailing spaces. Relative paths can work but only relative to wherever ComfyUI happens to be running from, so make it a habit to use absolute paths. And a couple of image formats (16-bit modes especially) get coerced to RGB in ways that flatten their range - the code handles the I mode case, but if you're loading HDR or 16-bit files, this isn't the node you want; it's built for ordinary photos and PNGs. For everything else, it's just a faster way to get a file off the disk and into your graph.

    Categoryimage

    Inputs (1)

    NameTypeDefaultDescription
    image_pathSTRINGFull path to the image file to load

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGEβ€”
    MASKMASKβ€”