Nodes/ComfyUI Prompt Warehouse/Save Image with Delete
ComfyUI Node

Save Image with Delete

CivitAI links your model, your prompt stays yours

By D33MO·Created 2 months ago·Updated 8 days ago· 0
Save Image with Delete
  • images
  • images
◄filename_prefixComfyUI►

What it is

A drop-in replacement for ComfyUI's built-in Save Image that adds two things, both aimed at a specific annoyance rather than at generating anything.

First: it writes an A1111-style parameters block into the PNG containing the checkpoint and LoRA hashes, which is what CivitAI's uploader matches against to auto-link the resources behind an image. ComfyUI's stock save node writes the workflow and prompt chunks but not that flat parameters string, so resources behind a custom loader have to be re-entered by hand on upload - enough of a nuisance that a whole genre of save nodes exists around it.

Second: after saving, the node shows a delete latest output button. Click it, confirm, and the source files it just wrote are removed from ComfyUI's output directory. If you've watched output/ fill up with the 40 throwaway takes it took to get one good image, you know why. The KB's file convention is that Preview Image writes to temp/ precisely so scratch renders don't pile up in output/ - this is the alternative for people who want the permanent save and the cleanup.

The part that's actually interesting

Most metadata save nodes bolt on everything: prompt text, negative prompt, <lora:name:strength> tags, the lot. This one deliberately writes only what CivitAI matches on - Model hash/Model for the checkpoint, a Lora hashes map for the LoRAs - plus the sampler settings. No prompt text, no LoRA strengths. The module's own comment says it plainly: an upload says which resources made the image, not how you prompted or weighted it.

That's the opposite default from most of the ecosystem, where posting a PNG hands over your prompt, your negative and your seed. So this is the node for when your prompting is the part you consider your edge. Be precise about the promise, though: the guarantee is about the parameters string. The node still writes the native prompt and workflow PNG chunks like any Save Image, and those contain your prompt text. If you truly don't want that public, use ComfyUI's --disable-metadata - and note that flag also switches this node's parameters block off, since it inherits that setting.

How the hashes work

The hash is the first 10 characters of the file's SHA256 - CivitAI's AutoV2 value, specifically not 12. A 12-character SHA256 prefix is none of CivitAI's hash types and matched nothing until a separate SHA256_12 type existed, which is why 10 is the length written. Hashes are cached in data/lora_hashes.json keyed by file path, size and modification time, so each model is hashed once rather than on every save.

Resources are read straight out of the execution graph rather than from your wiring. Checkpoint loaders and the common LoRA loaders are recognised - including this pack's own Multi LoRA Loader, so a stack loaded through it is picked up with no extra setup. Only the first checkpoint in the graph wins, matching what A1111 records. If the graph references no checkpoint and no LoRA at all, the parameters field is simply omitted.

And if anything in that path throws, it falls back to ComfyUI's plain save behaviour. A metadata nicety should never be the reason your run fails, and this one isn't.

Inputs and output

  • images (IMAGE) - "The images to save."
  • filename_prefix (STRING, default ComfyUI) - the same templating the native node takes: %date:yyyy-MM-dd%, or %Empty Latent Image.width% to pull a live value out of another node. Subfolders work via a slash in the prefix.

Output: images (IMAGE), and the node is an output node, so it always runs and everything upstream of it is kept alive by it.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/D33MO/ComfyUI-Prompt-Warehouse.git

Or ComfyUI Manager, searching Prompt Warehouse. No extra dependencies. Restart and reload the page.

Common issues

The delete button does nothing from another machine. Deleting goes through the pack's own endpoint, which only accepts requests from the local machine, demands Content-Type: application/json and a per-session token the UI fetches on demand, and confines every target to the output directory by resolved real path - no directories, max 100 files per request. Working as designed for a file-deleting endpoint on a server with no authentication. The consequence: it's a UI button, not an API call, so a headless run can't use it.

Resource links don't show up on CivitAI. The hash comes from the file's bytes, so a re-downloaded, renamed, re-quantised or re-encoded copy of "the same" model is a different hash and won't match. A LoRA loaded by a node the pack doesn't recognise also won't appear in the Lora hashes map - the recognised set is this pack's own loader plus ComfyUI's standard LoRA loaders.

Behind a reverse proxy, the loopback restriction stops applying. Lock down /prompt-warehouse/ at the proxy if the instance is reachable from anywhere you don't fully control.

CategoryPrompt Warehouse

Inputs (2)

NameTypeDefaultDescription
imagesIMAGEThe images to save.
filename_prefixSTRINGComfyUIThe prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes.

Outputs (1)

NameTypeDescription
imagesIMAGE—