Nodes/comfyui_LLM_party/FilePathExists To Bool🐶
ComfyUI Node

FilePathExists To Bool🐶

Check before you re-download or re-generate something

By heshengtao·Created 2 years ago·Updated 11 days ago· 2,328
FilePathExists To Bool🐶
    • file_exists
    • path_hold
    file_path
    is_enabletrue

    A small, obviously-named node that solves a real, boring problem: you want part of a workflow to run differently depending on whether a file already exists on disk - skip a re-download, skip regenerating something already cached, branch on whether a previous step actually produced output. This node is the check step.

    What it does

    file_path is the path to check, is_enable is the pack's usual bypass toggle. Two outputs come back: file_exists, a plain boolean - true or false, nothing fancier - and path_hold, which is just the same path you gave it, passed straight through unchanged.

    path_hold existing at all is a small but genuinely convenient detail: without it, if you need both the exists/doesn't-exist boolean and the original path further downstream (say, feeding the boolean into a branch condition while also needing the path itself in whichever branch actually runs), you'd normally need a separate Reroute node just to carry the path alongside the check. This node hands both back from the same place.

    Where it fits

    Use this ahead of anything expensive or slow that you'd rather skip if it's already been done - a model download, a generated cache file, an output from an earlier run of the same workflow. Feed file_exists into whatever conditional/branch node this pack or ComfyUI core gives you, and let path_hold carry the actual path into whichever branch needs it, instead of recomputing the path a second time or wiring a separate pass-through.

    Installing it

    Ships with the pack:

    • ComfyUI Manager: search "comfyui_LLM_party", install, restart.
    • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/heshengtao/comfyui_LLM_party, then pip install -r requirements.txt from inside the pack folder using ComfyUI's Python, then restart.

    No external dependency beyond the pack - this is a plain filesystem check.

    Common issues & troubleshooting

    Returns false for a file you know exists. The most common cause is a path that's correct relative to one working directory but wrong relative to the process ComfyUI is actually running from - if your file_path is relative rather than absolute, double-check it against wherever ComfyUI was launched from, not wherever you were looking at the file yourself.

    Windows path issues. Backslashes in a hand-typed Windows path can behave unexpectedly depending on how the string gets passed around - using forward slashes, or a raw/escaped path string, tends to avoid the class of bug where a path looks right printed out but fails to resolve.

    Checking a path on a network mount or a location that changes mid-run. This node checks at the moment it runs, once - if the file's existence can change between when this node checks and when a later node in the same workflow actually tries to use it (a race with another process, a slow network filesystem), that's a timing gap this node can't close on its own; it reports what was true when it ran, not a guarantee for the rest of the workflow's duration.

    Category大模型派对(llm_party)/转换器(converter)

    Inputs (2)

    NameTypeDefaultDescription
    file_pathSTRING
    is_enableBOOLEANtrue

    Outputs (2)

    NameTypeDescription
    file_existsBOOLEAN
    path_holdSTRING