CreatePaths
Make the folders your workflow needs exist, before your Save node silently fails
- output_paths
ComfyUI will happily let you point a Save node at a directory that doesn't exist, and then it fails - or worse, writes somewhere you didn't expect. CreatePaths is the boring, useful fix: give it a list of paths, and it makes sure they exist on disk, creating any that are missing. It's the least glamorous node in ComfyUI-ToolBox and the one you'll actually be glad is in the graph.
How it works
The mechanism is dead simple, and that's the point. It takes your input, splits it on newlines, trims each line, and calls os.makedirs() on every path that isn't already there. Existing directories are left alone. Then it returns the same paths back to you, newline-joined, as its output.
So it does two jobs in one pass: ensure the folders exist and hand you back the confirmed paths. The console prints which ones it created and which already existed, which is handy when you're debugging why a save silently went nowhere.
One important detail that separates this node from the pack's other file tools: there's no /root prefixing here. input_paths is treated as absolute paths, exactly as you type them. That makes CreatePaths the one node in this pack that behaves the same on an AutoDL box, a local Linux rig, or a Windows install. It's portable.
The input that matters
- input_paths - one absolute path per line. It's declared with
forceInput: true, which means you don't have to type it: you can wire aSTRINGin from another node. And that's the combo that makes this node shine.
The combo that's actually good
Pair it with PathOutput, the other FileManager node in this pack. PathOutput builds absolute paths from a dropdown base + subpaths; feed its output straight into CreatePaths' input_paths, and every folder your workflow saves into is guaranteed to exist before the Save node runs. Paths → exist → save. No silent failures.
Installing it
Standard pack install, no special sauce:
# via ComfyUI Manager: search "ComfyUI-ToolBox", install, restart
cd ComfyUI/custom_nodes
git clone https://github.com/hben35096/ComfyUI-ToolBox
It lives in file_manager.py alongside PathOutput, so no extra Python packages beyond the pack's single dependency (codewithgpu, which Manager pulls in automatically). No model files.
Where people trip up
- Empty input throws. If
input_pathscomes through empty (a blank line, or a wire that didn't connect), the node raises an error and your run stops. That's intentional - it's a "you forgot to give me a path" tripwire, but it can be confusing when it fires mid-workflow. - It's
makedirs, so it creates parent directories too. Paths like/tmp/a/b/cwill happily create all three. Usually what you want, occasionally not. - It does not verify you can write there. If the path is on a read-only mount or you lack permission,
os.makedirsfails and the error surfaces in the console.
If all you need is a guaranteed folder before a save, this is a fine pick. It won't change your images - it just removes a whole class of "why didn't my output show up" moments from your life.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| input_paths | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output_paths | STRING | — |