Get Comfy Directory
Output the ComfyUI root path for building file paths
- comfy_dir
This node answers one question: "where is ComfyUI installed?" It outputs the absolute path to your ComfyUI root directory as a string, so you can build paths off it without hardcoding. If you're assembling a file path in your graph - say you want to point a save or load node at ComfyUI/output/my_project/ - you start from this node's output and append from there, and your workflow stays portable across machines where ComfyUI lives in a different folder.
That portability is the whole reason it exists. The alternative is typing an absolute path like /home/you/ComfyUI into a widget, which breaks the instant you move the workflow to another computer, a friend's setup, or a cloud runner. Get Comfy Directory makes the base path dynamic, so the graph figures out where it's running instead of assuming.
How it works
No inputs, one output. When it runs, it reports the base directory ComfyUI is executing from - the same root that holds models/, input/, output/, custom_nodes/. You then combine that string with a subpath (using a string-join or search-and-replace node) to construct whatever full path you need. It's a lookup, not a computation: it just tells you where "here" is.
The inputs and outputs that matter
There are no inputs - the node needs nothing to do its job.
The output is a single comfy_dir STRING: the absolute path to the ComfyUI root. Feed it into a path-building node, then on to whatever save or load node needs the full path.
How to install it
ComfyUI Manager, search JNodes, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/JaredTherriault/ComfyUI-JNodes
pip install -r ComfyUI-JNodes/requirements.txt
No models.
Common issues & troubleshooting
The path isn't what I expected. It reports wherever ComfyUI is actually running from, which on some launchers or portable builds isn't the folder you think of as "the ComfyUI folder." If a downstream path comes out wrong, print or preview this node's output first to see the real root before assuming the node is broken.
On a cloud / serverless ComfyUI. The root here is the container's ComfyUI directory, and on an ephemeral runner that filesystem doesn't persist between runs. This is fine for building a path within a single job (e.g. to a temp or output location that exists for that run), but don't expect a path you build off it to still be there next session - persist real outputs to storage the platform actually keeps.
I hardcoded a subfolder anyway. If you append a folder that doesn't exist under the root, the save node downstream may fail to write. Make sure the subpath you're building is one your save node will create or one that already exists.
Inputs (0)
No inputs
Outputs (1)
| Name | Type | Description |
|---|---|---|
| comfy_dir | STRING | — |