Split Path (Yogurt Nodes)
Turn one file path into six useful pieces
- path
- parent
- name
- stem
- suffix
- no_dot_suffix
Split Path is the filesystem utility you didn't know you needed until you needed it six times: give it a path, and it hands back the directory, the filename, the stem, and the extension as separate strings. In a node graph where you can't just write os.path.basename() inline, that's the difference between a tidy workflow and a pile of hardcoded strings.
The whole node is one multiline string input, path, and six outputs. The naming is self-explanatory but let's walk them, because there's a subtlety in the last one:
- path - the original path, passed through untouched.
- parent - everything up to the final component (
/data/outfrom/data/out/img_001.png). - name - the final component including extension (
img_001.png). - stem - the name without the extension (
img_001). - suffix - the extension including the dot (
.png). - no_dot_suffix - the extension without the dot (
png).
The last output exists because downstream tools are picky about whether they want .png or png, and converting between them inline in ComfyUI is more annoying than you'd think. That's the kind of detail that tells you this pack was written by someone who actually ran these workflows.
Why you'd reach for it
Any time a path comes into your graph from the pack's Load/Glob/file nodes and you need to build a new filename from it. The classic move: take a saved_paths output from a Save Bridge, split it, and construct a sibling path - same stem, different directory, log file alongside the image. Combine it with String Concat (also in this pack) and you can assemble arbitrary paths without a single hardcoded string in your graph. It's glue, not a headline feature, but glue is exactly what big workflows are made of.
Install
The whole Yogurt pack is one install:
cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
cd ComfyUI-YogurtNodes
pip install -r requirements.txt
or ComfyUI Manager → ComfyUI-YogurtNodes → install → restart. It's under Yogurt Nodes → IO.
Gotchas
Keep the dot in mind. suffix includes it, no_dot_suffix doesn't - mix them up and you'll build paths like filepng. And it's a pure string splitter: it doesn't check the path exists, doesn't canonicalize it, doesn't care about your OS's path separators beyond what Python's os.path handles. Feed it garbage and you get garbage split into neat pieces. For the most part that's fine, but if you're splitting paths generated by other systems (Windows-style backslashes in a POSIX environment, say), don't expect it to fix them - just to take them apart.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| path | STRING | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| path | STRING | — |
| parent | STRING | — |
| name | STRING | — |
| stem | STRING | — |
| suffix | STRING | — |
| no_dot_suffix | STRING | — |