os.path.islink
Spotting the symlinks in your model directory
- path_in
- islink
If you keep your models on a second drive and symlink them into models/ - and a lot of people do, to dodge disk-space pain - you've probably discovered the weird failure mode where ComfyUI shows a model in the menu but the loader can't read it. Symlinks are invisible to most nodes because they follow them automatically. os.path.islink is the node that asks the different question: is this directory entry itself a link, regardless of what it points at?
It's part of the ovum/path/os.path family in comfy-ovum, sfinktah's utility pack - another thin wrapper over the matching stdlib function, os.path.islink().
How it works
Checks whether the given path is a symbolic link and returns a BOOLEAN (islink). Path from:
- path (STRING, required): the widget.
- path_in (PATHLIKE,STRING, optional): link-only; overrides the widget when connected.
Safe on missing or broken paths - returns False rather than raising. One BOOLEAN out.
The key distinction: isfile and isdir follow symlinks to report on the target, so a symlink to a folder reads as a directory. islink ignores the target entirely and reports on the link itself. That makes it the diagnostic tool when things resolve "wrong."
Where you'd use it
- Diagnosing model loaders. Path shows in the list but loading fails? Check if it's a link whose target is gone or permission-blocked.
islinkis step one of "is this a broken symlink" debugging, andos.path.lexistsis step two. - Canonicalization. Combined with
os.path.realpath, you can detect "this path is a symlink into the other drive" and rewrite to the real location - useful when a downstream tool refuses to traverse links. - Deduplication. If you're inventorying a model directory and want to count real files vs. links, run every entry through
islinkand branch.
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.
Honest limitations
This node is genuinely niche. On Windows, islink detection is mostly reliable but historically spotty for junction points - Windows "junctions" are a different kind of link that the stdlib handles inconsistently across Python versions. If you're on Windows and checking junctions, don't be shocked if it doesn't report what a dir /AL listing shows. On Linux and macOS, where real symlinks live, it's exact.
The other thing to know: a symlink to a non-existent target returns True from islink (the entry is still a link) but False from isfile/isdir - which is precisely the "broken symlink" signature. So islink == True and isfile == False together means: there's a link here, and its target is missing or is a special file. That combination is the useful diagnostic. For most everyday path logic you don't need it; for "why can't ComfyUI see my second-drive model" it's suddenly the most interesting node on the screen.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| path | STRING | — | |
| path_inopt | PATHLIKE,STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| islink | BOOLEAN | — |