STRING to PATHLIKE (PurePath)
Turn a path string into a pathlib.PurePath for type-safe wiring
- pathlike
ComfyUI speaks path strings - C:\output\batch\file.png, /models/checkpoints/foo.safetensors. Python's pathlib speaks path objects - PurePath values that know how to join, split, and compare themselves. OvumPathToPathLike ("STRING to PATHLIKE (PurePath)") is the little adapter that converts one to the other, so you can wire a plain text path into the pack's os.path-style nodes that expect a PATHLIKE input. It's a one-trick node, but it's the glue that makes the path utilities usable from real workflow data.
How it works
One input, one output, nothing clever:
path(STRING) - the path string, typed or pasted, e.g.C:\output\images.pathlike(PATHLIKE,STRING) - the same path as apathlib.PurePathobject.
Under the hood it just runs PurePath(path) on the string. PurePath is "pure" because it does no filesystem access - it's a syntax-level representation. That means it works on paths for files that don't exist yet (like a future output path) and it's cheap and side-effect free. The output type is dual-typed as PATHLIKE,STRING, so in practice it also passes through as a string where that's what the downstream node expects - which makes it forgiving to wire.
Why you'd reach for it
This node exists to satisfy type expectations. The comfy-ovum pack's ovum/path nodes (os.path.basename, join, splitext, exists, and the rest) accept either a widget string or a link, and some of them accept a PATHLIKE link. When you're driving those from another node's string output rather than typing into the widget, OvumPathToPathLike is how you make the connection type-safe. It also gives you a hook to preview the parsed path in the graph - handy when a string has backslashes and you want to confirm how Python will read it.
Installing it
Ships in comfy-ovum. ComfyUI Manager → search "comfy-ovum", or:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
Restart, find it under ovum/path. No model downloads, no dependencies worth mentioning - pathlib is in the standard library.
The gotcha
Don't overthink it. If your workflow is entirely string-based, you can skip this node and let the path utilities take the widget string directly - the adapter only earns its keep when you're linking values between nodes. And remember PurePath is syntax-only: it won't tell you a file exists (that's os.path.exists in this pack) or normalize a path to the real filesystem (that's realpath). Convert for wiring, not for truth about the disk.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| path | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| pathlike | PATHLIKE,STRING | — |