os.path.splitdrive
Separating the drive letter from the path
- path_in
- drive
- tail
If you've ever rebuilt a path only to watch it land on the wrong drive on Windows, you know why this node exists. os.path.splitdrive separates the drive/volume part of a path from everything after it: C:\models\v1.safetensors → drive C: and tail \models\v1.safetensors. On Linux it's a formality (there are no drive letters, so the drive is always empty), but on Windows it's the piece that keeps multi-drive setups sane.
It's from the ovum/path/os.path family in comfy-ovum, a wrapper over Python's os.path.splitdrive().
How it works
Splits a path into two STRING outputs:
- drive: the drive spec -
C:on Windows,//server/sharefor UNC paths, or''where there's no drive (all of Linux/macOS). - tail: everything after the drive.
Path from:
- path (STRING, required): the widget.
- path_in (PATHLIKE,STRING, optional): link-only; overrides the widget when connected.
Pure string parsing - no disk access, safe on any string that looks like a path. drive + tail reconstructs the original.
Where you'd use it
- Multi-drive workflows. When your models live on
D:but outputs go toE:, being able to strip and swap the drive component is how you retarget a path without re-typing the rest. Split off the drive, substitute a new one,os.path.join(or concatenate) back. - UNC-aware logic. On Windows, network shares come back as
\\server\sharein the drive slot. If a path comes from a network location,splitdriveis how you detect and handle it separately from local paths. - Normalizing mixed-origin paths. Downloaded workflows frequently carry the author's drive letters; splitting drive from tail lets you discard the foreign drive and rebuild against your own layout.
Installing it
Standard, once per pack:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
Or ComfyUI Manager → "comfy-ovum" → Install → restart. No models, no extra deps.
Gotchas
- On Linux/macOS the drive output is always empty. The node does exactly what the stdlib does, and the stdlib on POSIX has no drives. If you're parsing Windows-style paths on a Linux box,
splitdrivewon't split them - you'd need a manual regex (the pack has regex nodes for exactly that). - Not the same split as
os.path.split. The plainsplitnode separates folder from filename;splitdriveonly ever peels the volume off the front. Use them together if you want both: drive, then the folder/file split of the tail. - UNC paths behave differently than drive letters. On Windows,
\\server\share\folderputs\\server\sharein the drive slot, so the tail starts with a backslash. If you rebuild by appending to the drive, keep the separator handling straight.
Most workflows never touch this node - on a single-drive Linux box it's a no-op that returns ('', path). But if you juggle drive letters, network shares, or downloaded Windows workflows, splitdrive is the quiet node that keeps your paths from landing somewhere surprising.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| path | STRING | — | |
| path_inopt | PATHLIKE,STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| drive | STRING | — |
| tail | STRING | — |