WSL Path Converter
Paste a Windows Path Into a WSL ComfyUI and It Just Works
- path
- exists
- kind
If you run ComfyUI inside WSL - and plenty of people do, because it's the least-painful way to get CUDA on a Windows box - you know the specific annoyance this node kills. Windows gives you a path like C:\Users\you\videos\clip.mp4. WSL gives you /mnt/c/Users/you/videos/clip.mp4. They're the same file, and no node in your graph will accept both. Every path-based node - Load Video (Path), Load Image From Path, and friends - expects the Linux form, and you end up hand-converting paths or keeping two versions of every workflow.
The WSL Path Converter is the translator. Feed it a Windows path and it returns the path a ComfyUI under WSL can actually open. It's a thin utility, but it's the kind of thin utility that removes an entire class of "why won't this file load" debugging.
How it works
It understands the whole zoo of path formats Windows will hand you:
- UNC paths -
\\wsl.localhost\Ubuntu-24.04\home\...and the legacy\\wsl$\..., which it maps to the actual Linux path on the distro. - Drive letters -
C:\Users\...→/mnt/c/Users/.... Crucially, it reads/etc/wsl.confand honors a custom[automount] root, so if your mount isn't/mnt(a common tweak), the conversion is still right. - file:// URIs and the quoted output of Explorer's "Copy as path" - both stripped automatically.
direction picks the direction: auto (default) outputs the host's native form - Linux paths when you're in WSL, Windows when you're not - and to_windows goes the other way, so one node works in both directions.
Inputs and outputs
- path - the raw path, paste as-is.
- direction -
auto,to_linux, orto_windows. - append (optional) - a filename or subpath to join onto the converted folder, handy for building paths in two pieces.
- Outputs: path (the converted result), exists (does it actually exist?), and kind (
file,dir, ormissing). The exists/kind pair is the killer feature - you can wire it to a check that fails loudly instead of letting a bad path fail silently downstream.
Troubleshooting
The realistic failure modes are all about the environment, not the node. If your WSL has a custom automount root and the conversion comes out wrong, that's the /etc/wsl.conf setting being missed - the node reads it, so check the file exists and the section is right. UNC paths only resolve when the Windows path came from WSL's own network share; a path copied from a genuinely remote \\server\share won't map to anything local, and exists will correctly say so. And remember this node converts strings - it doesn't load files, so pair its path output with the actual load node downstream.
Installing
Part of TrentNodes under Trent/Utilities. ComfyUI Manager → "Trent Nodes" → Install, or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/TrentHunter82/TrentNodes
cd TrentNodes
pip install -r requirements.txt
Restart after. If Manager flags the pack (a day-one repo rename left a registry duplicate it still distrusts), the manual clone is the reliable path.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| path | STRING | — | |
| direction | COMBO | auto | 3 options: auto, to_linux, to_windows |
| appendopt | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| path | STRING | — |
| exists | BOOLEAN | — |
| kind | STRING | — |