Nodes/comfy-ovum/Backslashes → Forward
ComfyUI Node

Backslashes → Forward

The Windows-path converter your cross-platform workflow needs

By sfinktah·Created about a year ago·Updated 10 months ago· 7
Backslashes → Forward
    • path
    path

    One of these days you'll paste a path from Windows into a Linux box - or export a workflow from a Windows machine and run it on Linux - and a node will silently refuse to touch the file because C:\renders\out.png isn't a path it recognizes. The fix is embarrassingly simple: replace the backslashes with forward slashes. That's this entire node. Backslashes → Forward takes any string and swaps every \ for a /.

    It's from the ovum/path section of comfy-ovum, sfinktah's utility pack - the sibling family to the os.path wrappers. It's the simplest node in either family, and possibly the one that rescues you from the most confusing failure.

    How it works

    Take a string, replace all backslashes with forward slashes, return it. That's it.

    • path (STRING, required): the only input, a widget - type or paste the path.

    One STRING output (path). C:\renders\frame_0072.pngC:/renders/frame_0072.png.

    Note what's not here: unlike the os.path family, there's no path_in link jack. This node takes only the widget value. That's fine for its job - you're usually pasting or cleaning a specific string - but it means you can't feed it directly from another node's path output. If you need to convert a linked path, reach for one of the os.path nodes instead: several of them (join, normpath, relpath, realpath) have their own forward_slashes toggle that does exactly this conversion inline.

    Why it matters

    Windows accepts forward slashes in most contexts, so converting to forward slashes is the safe direction for anything that leaves Windows: paths embedded in prompt text, metadata, JSON payloads, or handed to Python code that's doing its own path handling. It's also the cure for the classic double-escape mess - in some JSON or YAML exports, backslashes come through as \\, and this node (or a quick string replace) collapses the confusion.

    Most people use it once, in a panic, when a workflow breaks across an OS boundary, and then forget it exists. That's fine. It's a five-line node that does exactly one thing.

    Installing it

    Same as every node in this pack - one install, all nodes:

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

    or search "comfy-ovum" in ComfyUI Manager, install, and restart. No models, no dependencies beyond the stdlib.

    Gotchas

    • It's a blind replace. foo\bar becomes foo/bar even if the backslash was meant literally (escapes inside strings, for example). For path cleaning that's what you want; for arbitrary text, double-check the context.
    • The input is widget-only. No link input, so you can't chain it mid-graph directly. If you need backslash conversion on a wired path, use an os.path node's forward_slashes toggle instead - that's the same operation plus a real link socket.
    • Forward slashes aren't always valid. Some Windows-only tools genuinely require backslashes. Convert to forward slashes when leaving Windows; if a tool on Windows is rejecting forward slashes, that's a different (and rarer) problem this node won't fix.

    If your workflows never leave one OS, you'll never need it. If they do - if you ever move a graph between machines, or share one with a friend on a different platform - this is the node that quietly makes those paths legible again.

    Categoryovum/path

    Inputs (1)

    NameTypeDefaultDescription
    pathSTRING

    Outputs (1)

    NameTypeDescription
    pathSTRING