Nodes/ComfyUI-WJNodes/ComfyUI Path Out
ComfyUI Node

ComfyUI Path Out

Read your ComfyUI folder paths at runtime instead of hardcoding them

By 807502278·Created 2 years ago·Updated 11 months ago· 20
ComfyUI Path Out
    • comfy_path
    • output_path
    • input_path
    • custom_node
    • model_path
    • cache_path
    • python_env
    backslashtrue

    A quiet utility node that answers a question you'll eventually need answered: where does this ComfyUI installation actually keep things? Instead of typing C:\Users\you\ComfyUI\output into a string node and hoping it never changes, ComfyUI_Path_Out reads the paths straight from the running instance and hands them out as strings you can wire anywhere.

    Why this matters more than it looks

    ComfyUI installs live in wildly different places depending on the machine - a manual clone on Linux, a portable Windows build, a Docker container, a managed cloud instance. A workflow that hardcodes D:\ComfyUI\models\loras\ breaks the moment someone else opens it, or the moment you move machines yourself. Reading the paths at runtime instead means the same workflow JSON works everywhere without editing a single string node by hand - useful for anyone building shareable workflows, custom save-path logic, or debugging why a node can't find a file it should obviously be able to see.

    How it works

    There's exactly one setting and it's cosmetic: whether the output strings use backslashes or forward slashes. Everything else is read from ComfyUI's own runtime configuration, not computed or guessed.

    The inputs and outputs that matter

    • backslash (BOOLEAN, default true) - toggles path separator style. True gives Windows-style backslashes, false gives forward slashes. Worth flipping to false if your downstream string handling assumes Unix-style paths, regardless of what OS ComfyUI itself is running on.

    Seven STRING outputs, one per common ComfyUI directory:

    • comfy_path - the ComfyUI root.
    • output_path - where generated images/videos land.
    • input_path - where uploaded/loaded inputs live.
    • custom_node - the custom_nodes directory (where this very pack is installed).
    • model_path - the models directory.
    • cache_path - ComfyUI's cache location.
    • python_env - the Python environment ComfyUI is running under.

    Wire any of these into a string-concatenation node (this pack's own Str_Append, or ComfyUI's native string nodes) to build a save path, a lookup path, or anything else that needs to be correct regardless of where the graph runs.

    Installing it

    Via ComfyUI Manager: search ComfyUI-WJNodes, install, restart. Or manually:

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

    No models, no external dependency - it's reading values ComfyUI already tracks internally.

    Common issues & troubleshooting

    Paths look right but a downstream node still can't find a file. Check the backslash setting against what that downstream node or script actually expects - a node built to parse Unix-style paths will mishandle a backslash-separated string (and vice versa) even though the path itself is correct.

    Output paths don't match a custom directory you configured. If you've overridden ComfyUI's default output/input/model locations through its own config rather than the default folder layout, that override is exactly what this node should reflect - it reads from the running instance's actual settings, not from assumed defaults. If it doesn't match, double-check the override actually took effect (a restart after a config change is usually the fix).

    Works locally but not on a different install. That shouldn't happen - the entire point of this node is that it re-reads paths per-instance - but if you've somehow cached the string output of this node into a hardcoded value elsewhere in a saved workflow (rather than keeping the wire live), you've defeated the purpose. Keep the connection live rather than baking the resolved string in.

    CategoryWJNode/Path

    Inputs (1)

    NameTypeDefaultDescription
    backslashBOOLEANtrue

    Outputs (7)

    NameTypeDescription
    comfy_pathSTRING
    output_pathSTRING
    input_pathSTRING
    custom_nodeSTRING
    model_pathSTRING
    cache_pathSTRING
    python_envSTRING