Split Path
Pull the drive, folder, filename, and extension out of a path string
- drive
- path
- file_name
- file_ext
- file_str
- is_file
- is_path
- is_file_or_path
Split Path takes one path string and hands you back every piece of it, separately, as clean outputs you can wire wherever you need. Feed it something like D:\comfyui\output\render_042.png and out comes the drive letter, the folder path, the filename, the extension, the filename-plus-extension together, and three booleans telling you whether that path currently points to a file, a folder, or either one at all on disk.
The inputs and outputs that matter
That last part is the detail worth sitting with: is_file, is_path, and is_file_or_path aren't just parsing the string - they check the actual filesystem at the moment the node runs. So this node does double duty as a path splitter and a lightweight existence check, which is exactly what you want when a workflow needs to branch on "does this file already exist" before deciding whether to regenerate something, or needs to validate a user-supplied path before trying to load from it.
The full output list: drive, path, file_name, file_ext, file_str (name plus extension together), is_file, is_path, is_file_or_path. One input: Path, a plain string field. Wire in a full path - from a Save Image node's output, a Split_Path earlier in the graph, or just typed - and grab whichever piece you need downstream.
One thing worth clearing up if the tooltip confuses you: the description text attached to this node mentions deleting files if a "Deletes" toggle is enabled. Ignore that - there's no delete option in this node's actual input list, just the single Path field. That text appears to be carried over from a different node in the same pack, del_file, which genuinely does check-and-optionally-delete a file. Split_Path itself only looks; it never touches anything on disk.
Installing it
One pack, one install, every WJNode node comes with it. ComfyUI Manager: search "ComfyUI-WJNodes," install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/807502278/ComfyUI-WJNodes.git
It's under WJNode → Path in the search after restart. Nothing to download, nothing extra to pip install for this one - it's pure Python path handling plus a filesystem check, both things a stock ComfyUI environment already covers.
Where it's genuinely useful
Pair it with Save_Image_To_Path from the same pack: that node writes to a fixed location and hands you the PATH string back, and Split_Path is the natural next node if you want to log just the filename, branch on the extension, or confirm the write landed before continuing. It's also a nice sanity check in front of anything that reads from a user-typed path - run it through Split_Path first, check is_file before you try to load it, and you turn a confusing "file not found" crash three nodes downstream into a clear signal right where the path enters your graph.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| Path | STRING | — |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| drive | STRING | — |
| path | STRING | — |
| file_name | STRING | — |
| file_ext | STRING | — |
| file_str | STRING | — |
| is_file | BOOLEAN | — |
| is_path | BOOLEAN | — |
| is_file_or_path | BOOLEAN | — |