Nodes/comfy-ovum/os.path.isabs
ComfyUI Node

os.path.isabs

'is this path absolute?' depends on where you're standing

By sfinktah·Created about a year ago·Updated 10 months ago· 7
os.path.isabs
  • path_in
  • isabs
path

C:\models\sd15\v2.safetensors is absolute. models/sd15/v2.safetensors is not. On Linux, the first one isn't even a valid path - which is exactly the trap this node exists to make visible. os.path.isabs answers one question: does this path start from the root of the filesystem, or is it relative to wherever the process happens to be?

It's from the ovum/path/os.path family in comfy-ovum, sfinktah's grab-bag of utility nodes. As with every node in that family, it's a direct wrapper over the Python stdlib function - what you get back is precisely os.path.isabs().

How it works

Pure predicate, no side effects. The node inspects the path and returns a BOOLEAN (isabs). The path comes from:

  • path (STRING, required): the widget.
  • path_in (PATHLIKE,STRING, optional): a link-only input; wire a string or PATHLIKE and it takes priority.

One BOOLEAN output. There's no filesystem access involved - this is purely string inspection, so it never raises on a weird or non-existent path. ..\..\models is a fine answer to "is it absolute?" even though nothing's on disk.

Why you'd bother

The real use is portability guards. Say you build output paths from a mix of widgets, environment variables, and previous nodes - some absolute, some relative - and you feed them to a saver or a "open via shell" node. An absolute path behaves identically no matter where ComfyUI was launched from; a relative one silently depends on the current working directory, which in ComfyUI is not always where you think it is. Stick an OvumOsPathIsAbs before the thing that consumes the path, and branch: if it's relative, prefix it or run it through os.path.abspath first.

It's also the right tool for normalizing inputs from other people's workflows. Downloaded graphs often carry absolute paths from the author's machine - Windows drive letters, /home/someone/... - and detecting "this is absolute" is step one of deciding whether to trust it or rebuild it.

Installing it

One-time pack install, same as every node here:

cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum

Or ComfyUI Manager → "comfy-ovum" → Install → restart. No models, no extra pip deps for this one - pure stdlib.

The platform gotcha

Absolute means different things per OS. On Windows, C:\foo and even \foo (drive-relative) count as absolute; on Linux only a leading / does. The node uses the platform ComfyUI is running on, which is usually what you want - but if you're parsing a Windows path string on a Linux box (say, sanitizing a path pasted from a Windows user's workflow), isabs will answer about your OS, not the string's origin. For that job, a plain "does it start with / or a drive letter" check via a regex node is more honest. Keep this node for paths that will actually be used on the machine running the graph.

Categoryovum/path/os.path

Inputs (2)

NameTypeDefaultDescription
pathSTRING
path_inoptPATHLIKE,STRING

Outputs (1)

NameTypeDescription
isabsBOOLEAN