get current working directory
What folder is ComfyUI actually running in?
- current directory
Basic data handling: PathGetCwd ("get current working directory") answers a question that causes way more confusion than it should: where is ComfyUI looking when you give it a relative path? No inputs, one STRING output. Run it once, and the node tells you the absolute path of the current working directory - the folder the ComfyUI process was launched from.
That sounds trivial until you've spent twenty minutes debugging a relative path that "should" work. ComfyUI's current working directory is not necessarily the folder where ComfyUI lives. Launch it with a double-click and it's often the install folder; launch it from a terminal in ~/Documents and suddenly every relative path in your workflow resolves against that. When a path exists on disk but your workflow insists it doesn't, this node is how you find out what "here" actually means.
How it works
It's a direct call to Python's os.getcwd() - the same call any script makes. No cache, no config, no inputs at all. Wire the output into a debug display or string node and you'll see the resolved working directory. It's the anchor you need when you're reasoning about every other relative path in the graph.
Inputs and outputs
- No inputs. It just runs.
- current directory (STRING) - the absolute path of ComfyUI's working directory.
Installing it
Part of the Basic data handling pack. Zero extra dependencies - this is one of the rare ComfyUI extensions that adds nothing beyond the nodes themselves. Easiest: ComfyUI Manager → search "Basic data handling" → install → restart. Manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
Restart ComfyUI afterward. No models, no pip steps.
Common gotchas
- Cwd ≠ install folder. The most common source of confusion. The node reports the launch directory, not the directory of
main.py. If you want ComfyUI's own folders, that's whatPathInputDir(and the core nodes) are for - they use ComfyUI's registered paths, which are more stable than cwd. - It changes depending on how you launch. Same ComfyUI install, different launch method, different answer. So don't build a workflow around cwd expecting it to be fixed across setups - use it for diagnosis and prefer absolute paths or
PathInputDirfor anything you want to survive a move. - It's absolute. The output is always a full path, so you can safely join it with
PathJoinwithout worrying about relative/absolute mismatch.
Honestly, you'll mostly use this node once, go "oh, there's the problem," and never look at it again. That's fine. It's a debug tool that earns its place in the pack, and a handy one to have on the canvas when a mystery path refuses to resolve.
Inputs (0)
No inputs
Outputs (1)
| Name | Type | Description |
|---|---|---|
| current directory | STRING | — |