Nodes/Quality of Life Nodes for ComfyUI/Load Image From Filepath (Soze)
ComfyUI Node

Load Image From Filepath (Soze)

Load by a path string, not a dropdown

By SozeInc·Created 2 years ago·Updated 5 days ago· 10
Load Image From Filepath (Soze)
    • Image
    • Mask
    • Input_Path
    • Image_Filename_Path
    • Image_Filename
    • Image_Filename_No_Ext
    • Image_Changed
    • status
    Image_Filepath
    Return_None_If_Not_Foundfalse

    The stock Load Image node - and even the pack's own Load Image (Soze) - both make you pick a file from a dropdown tied to ComfyUI's input directory. That's fine for manual work, but it breaks down the moment the file path is coming from somewhere else in your graph: a string built by another node, a value from an API call, a path computed at runtime. Load Image From Filepath takes a plain string path instead of a dropdown selection, which is what makes it usable in any automated or scripted pipeline.

    How it works

    Give it a filepath string - absolute or relative to wherever ComfyUI is running - and it loads the image at that location directly, no picker involved. The one behavioral option it exposes is what happens when the path is wrong: fail loudly, or degrade gracefully.

    The inputs and outputs that matter

    • Image_Filepath - required, a plain string. Wire this from any upstream node that produces a path - a folder loader's filename output, a string built from a prefix and an index, whatever your pipeline generates.
    • Return_None_If_Not_Found - required, boolean, default false. Per the node's own tooltip: "If enabled, will return empty outputs instead of erroring if the file is not found." Leave it false while you're debugging (you want the error, it tells you the path is wrong); turn it true once the workflow is in production and you'd rather have a graceful skip than a crashed run when one file in a large batch is missing.
    • Output: Image, Mask - the loaded image and its mask.
    • Output: Input_Path - echoes the path you gave it.
    • Output: Image_Filename_Path, Image_Filename, Image_Filename_No_Ext - the filename derived from that path, in three forms.
    • Output: Image_Changed - BOOL, same change-detection behavior as the pack's other Load Image node.
    • Output: status - a status string.

    How to install it

    Through ComfyUI Manager (search "Quality of Life Nodes for ComfyUI" or "Soze") or manually:

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

    Restart. No models or GPU dependency beyond standard image loading.

    Common issues & troubleshooting

    "File not found" even though you're sure the path is right. Relative paths resolve against wherever ComfyUI's process is currently running from, which is often not the folder you expect - especially on a hosted instance, inside a Docker container, or when the workflow is triggered by something other than the desktop app. Switch to an absolute path to rule this out first.

    A batch run stops dead on one missing file. That's Return_None_If_Not_Found left at its default false - the node is erroring intentionally rather than silently pushing empty data downstream. Flip it to true if you'd rather have that one item skip cleanly and the rest of the batch continue.

    Empty outputs when Return_None_If_Not_Found is enabled, and downstream nodes choke on them. That's the trade-off of the graceful-skip mode - something downstream still has to be able to handle an empty image gracefully (a conditional branch, a filter node), or you'll just move the crash one node further down the graph instead of fixing it.

    Categoryimage

    Inputs (2)

    NameTypeDefaultDescription
    Image_FilepathSTRING
    Return_None_If_Not_FoundBOOLEANfalseIf enabled, will return empty outputs instead of erroring if the file is not found.

    Outputs (8)

    NameTypeDescription
    ImageIMAGE
    MaskMASK
    Input_PathSTRING
    Image_Filename_PathSTRING
    Image_FilenameSTRING
    Image_Filename_No_ExtSTRING
    Image_ChangedBOOL
    statusSTRING