Nodes/ComfyUI-Apt_Preset/IO_ImageSaveOverwrite
ComfyUI Node

IO_ImageSaveOverwrite

Save an image to the same filename every time

By cardenluo·Created 2 years ago·Updated 22 days ago· 309
IO_ImageSaveOverwrite
  • image
  • status
file_format
file_names_and_path

ComfyUI's default save behavior is to keep appending a counter so nothing ever gets clobbered. Most of the time that's exactly what you want. Sometimes it isn't - you're iterating on a prompt and just want to glance at "the latest one" in a file browser, or a script outside ComfyUI is polling a fixed path for the newest frame. IO_ImageSaveOverwrite is the node for that second case: same filename, every run, no counter.

How it works

You give it a full path plus filename - the README's own examples are ./output/my_image or C:/images/folder/my_image - and the node appends the right extension for whatever file_format you picked and writes there, replacing whatever was there before. If the folder in that path doesn't exist yet, it creates it for you.

Inputs and outputs

Three fields, all optional, and this is genuinely all it needs:

  • image - the picture to write.
  • file_format - png, webp, jpg, or tif.
  • file_names_and_path - the full path and base filename, no extension. The node adds that based on file_format.

One output, status (STRING) - a message you can route into a text display or a debug branch to confirm the write actually happened, since this node has no image passthrough of its own.

How to install it

ComfyUI Manager → search ComfyUI-Apt_Preset, install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git

then run install.bat for dependencies (Windows only - on Linux/macOS open it and run the pip install lines yourself), and restart ComfyUI.

Common issues & troubleshooting

It's destructive by design - don't reach for it when you want a history. This is the trade this node makes for its whole feature: every run replaces the previous file. If you actually want a numbered sequence you can look back through, use the pack's regular IO_save_image instead, which auto-increments; keep this one for the "I only need the latest frame" cases.

Relative paths resolve from wherever ComfyUI's process is running, not from the workflow file or your browser tab. The README's own ./output/my_image example is relative, and on a headless server or a container that's not necessarily the folder you expect. If the file lands somewhere unexpected (or you get a permissions error), switch to an absolute path and confirm it from there.

IMPORT FAILED on startup. There's at least one reported case in the wild of this pack failing to import on a stock install - check that you actually ran the dependency install step, since install.bat is Windows-only and easy to skip on other platforms. Read the actual console error for the missing package name before reinstalling from scratch.

CategoryApt_Preset/IO_Port

Inputs (3)

NameTypeDefaultDescription
imageoptIMAGE
file_formatoptCOMBO4 options: png, webp, jpg, tif
file_names_and_pathoptSTRING

Outputs (1)

NameTypeDescription
statusSTRING