Nodes/ComfyUI-WJNodes/Save Image To Path
ComfyUI Node

Save Image To Path

Writing to an exact file, not ComfyUI's numbered output folder

By 807502278·Created 2 years ago·Updated 11 months ago· 20
Save Image To Path
  • images
  • IMAGE
  • PATH
file_path

If you've used ComfyUI's stock Save Image node, you know the drill: your file lands in output/, gets an auto-incrementing prefix like ComfyUI_00042_.png, and that's that. Save Image To Path throws that convention out. You hand it an exact file path - filename and extension included - and it writes there directly, overwriting whatever was already at that location. No counter, no prefix, no surprises about where the file ended up.

That's the trade: you give up ComfyUI's auto-numbering safety net for a predictable, fixed location every run. That's exactly what you want when something else in your pipeline expects the file to always be at the same path - a folder being watched by another script, a fixed filename an external tool polls for, or an iterative-preview workflow where you genuinely want each pass to overwrite the last instead of piling up a thousand near-identical PNGs.

The inputs and outputs that matter

Two inputs, and that's the whole node: images, the batch you want written, and file_path, a multiline string field where you type or wire in the destination. There's no separate "directory" and "filename" split - file_path is the whole thing, so /workflow_output/render.png or C:\out\final.png both work depending on your OS.

It hands back two outputs: IMAGE, your input passed straight through so you can keep chaining nodes after the save, and PATH, a string of the path you just wrote - handy for logging, or for feeding into something like Split_Path downstream to pull the filename or extension back out. It's flagged as an output node, so it actually writes to disk even if you leave both outputs unwired.

Installing it

ComfyUI-WJNodes ships as one pack with roughly 90 nodes under the WJNode/ category, so you install it once and every node in this family comes along, this one included. Easiest path is ComfyUI Manager: search "ComfyUI-WJNodes," install, restart. By hand it's just as fast:

cd ComfyUI/custom_nodes
git clone https://github.com/807502278/ComfyUI-WJNodes.git

Restart ComfyUI and it's in the node list under WJNode → ImageFile. The author notes most of the pack's dependencies already ship with ComfyUI, so for a plain save-to-path node like this one you generally don't need to touch requirements.txt - that file mostly covers the pack's optional, modified integrations elsewhere (OCR, torchvision similarity, and so on).

Where people get burned

The folder in your path needs to actually exist and be writable - this node writes a file, it doesn't build out a directory tree for you, so a typo'd or missing parent folder is the first thing to check if nothing shows up. Because it overwrites silently, if you're iterating on a workflow and wondering why your "history" of outputs is just one file, that's not a bug - that's the node doing exactly what it says. If you want a run archive, keep a regular Save Image node running in parallel and use this one only for the fixed-path case.

One more thing worth knowing if you're running this on a hosted service like comfy.icu: the run's output gallery is typically built from whatever lands in the workflow's normal save path, so a file written straight to an arbitrary file_path here may not show up in your results panel the way a standard Save Image output would. Treat it as an internal write for automation, not your primary output node, unless you've confirmed otherwise on your setup.

CategoryWJNode/ImageFile

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
file_pathSTRING

Outputs (2)

NameTypeDescription
IMAGEIMAGE
PATHSTRING