os.path.exists
Does that path actually exist? A boolean check for your graph
- path_in
- exists
Ovum Os Path Exists is the gatekeeper of the pack's path family: it checks whether a path refers to something real on disk and returns a plain BOOLEAN. True if the file or directory exists, False if it doesn't. No fancy options, no modes - just the question "is this path real?" answered mid-graph.
And that question is genuinely useful, because a lot of ComfyUI workflows build paths from strings and then blindly hand them to savers or loaders. Wire an Exists check in front of a branch (IfElseOvum in this pack, or any boolean router) and you can skip a load that would error, fall back to a default path, or surface a warning when an output folder is missing. It's the difference between a workflow that silently fails on the first missing file and one that reacts to it.
How it works
Direct os.path.exists() delegation, via the family's shared base: a path widget plus an optional path_in jack (PATHLIKE,STRING) that wins when connected. It's a real filesystem call, not string math - unlike most of its siblings in this pack, this one actually touches disk. exists returns true for both files and directories, and it follows symlinks (returning the target's existence). It does not tell you which kind of path it is; for that, the pack also has OvumOsPathIsfile and OvumOsPathIsdir.
The inputs and outputs that matter
- path (required, STRING) - the path to check.
- path_in (optional, PATHLIKE,STRING) - wired alternative to the widget.
- exists (output, BOOLEAN) -
Trueif the path exists,Falseotherwise.
Installing it
Part of comfy-ovum (sfinktah). ComfyUI Manager: search "comfy-ovum", install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
Restart after cloning. No models, no heavy dependencies - the pack's requirements are light and Manager installs them.
Common issues
Two subtleties worth knowing. On Windows, exists returns False for broken symlinks (Python's documented behavior) - if you're checking a link that points to a now-missing target, expect False. And since this is a live filesystem check, it's a place where ComfyUI's caching can bite: if the path's existence is what changed between runs, the node's result may be cached as "unchanged." Run-to-run path checks usually work fine because the value itself changes, but if you're polling for a file to appear in a loop, give the input value a real change between iterations. Pair with dirname/combine paths to build the paths worth checking.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| path | STRING | — | |
| path_inopt | PATHLIKE,STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| exists | BOOLEAN | — |