Nodes/Champdev Custom Nodes/Champdev Save Image
ComfyUI Node

Champdev Save Image

Core Save Image won't clean up after itself — this one will

By rohit267·Created 6 months ago·Updated 8 days ago· 1
Champdev Save Image
  • images
    filename_prefixComfyUI
    save_to_comfy_temp_dirfalse
    overwrite_existingfalse
    fixed_filename_no_incrementfalse
    auto_delete_after_seconds0

    ComfyUI's built-in Save Image is fine - until it isn't. It embeds the workflow, writes to output, done. But run any batch or unattended queue and you hit the three things it flat-out won't do: it can't write to a scratch location, it can't reuse a fixed filename, and it never deletes anything. That last one is the kicker. Leave a queue running overnight and you come back to a folder stuffed with images you'll never look at again. Champdev Save Image is the same node with those problems actually solved.

    It's a drop-in replacement, by the way. Same IMAGE input, same filename_prefix, same "drag the PNG back into ComfyUI and the graph reconstructs" metadata behavior. The whole point of the pack's save nodes is that you can swap one in without touching the rest of your workflow.

    How it works

    Mechanically it's the core save path wearing extra clothes: folder_paths.get_save_image_path handles the counter and subfolders, the prompt and workflow metadata get baked into the PNG via PngInfo (so the "workflow included" sharing culture still works), images are converted from the tensor and written at the same compress_level core uses. Then the added controls sit on top and decide where the file goes and whether it survives.

    The inputs that matter

    There are no outputs - it's an output node, you wire images in and it reports the result to ComfyUI's preview panel. The fields you'll actually set:

    • filename_prefix - folder and base name, default ComfyUI. Subfolders work (batch/pass1), just like core.
    • fixed_filename_no_increment - drop the counter suffix and save under a deterministic name.
    • overwrite_existing - when fixed-filename mode is on, overwrite an existing file instead of bumping to a fallback name.
    • save_to_comfy_temp_dir - write to ComfyUI's temp directory instead of output.
    • auto_delete_after_seconds - the headline feature: delete the file N seconds after saving. 0 disables it; the cap is 86400 (24 hours).

    Where people get burned

    • "Fixed" isn't fixed unless you also enable overwrite. With fixed_filename_no_increment on and overwrite_existing off, a name collision silently becomes name_00001.png instead of a hard error. I got a full run of mysteriously numbered files before I noticed. Flip both, or accept the fallback.
    • Auto-delete is fire-and-forget. It spawns a daemon thread that sleeps then removes the file. Close ComfyUI before the timer fires and the file stays forever. Not a bug - just don't treat it as a guarantee.
    • Batches get suffixes in fixed mode. If images carries more than one frame and you haven't put %batch_num% in the prefix, each frame gets _{batch_number:05} appended so they don't collide.
    • Temp saves vanish on restart. ComfyUI cleans its temp dir at startup. That's the point of the option - it's for scratch, previews, and throwaway outputs, not files you intend to keep.

    Install

    Easiest via ComfyUI Manager - search for Champdev Custom Nodes and it installs dependencies for you. Or manually:

    cd /path/to/ComfyUI/custom_nodes
    git clone https://github.com/rohit267/champdev-comfyui-nodes
    cd champdev-comfyui-nodes
    python -m pip install -r requirements.txt   # portable build: use python_embeded\python.exe
    

    Restart ComfyUI. No model files to download. On Linux/macOS there are no extra dependencies at all; on Windows the only one is pywinpty for the pack's terminal node, and Manager or the pip line above handles it. One heads-up: the README's clone URL drops a letter (chamdev vs champdev) and 404s if you copy-paste it - use the one above.

    Reach for this node when you're automating, batching, or any time the thought "I'll clean up the output folder later" has ever lied to you.

    Categorychamdev-nodes/image

    Inputs (6)

    NameTypeDefaultDescription
    imagesIMAGE
    filename_prefixSTRINGComfyUI
    save_to_comfy_temp_dirBOOLEANfalse
    overwrite_existingBOOLEANfalse
    fixed_filename_no_incrementBOOLEANfalse
    auto_delete_after_secondsINT00–86400

    Outputs (0)

    No outputs