Edit Metadata (Image Saver)
Patch the prompt in a saved image without re-rendering a thing
- metadata
- metadata
You load a good image, upscale it 4x, save it - and the file now claims Size: 512x768 while being 2048×3072. Or you dropped a LoRA for the second pass and the metadata still lists it, so Civitai links a resource that had nothing to do with the final picture. Or you want to append masterpiece, best quality to something already rendered.
Edit Metadata (Image Saver) is the surgical tool for all of that. It takes a METADATA object, changes only what you touched, and passes the rest through byte-for-byte - hashes, Civitai resources, settings you've never heard of. No hashing, no lookups, no re-render.
How it stays so light
Most metadata nodes in this pack build a Metadata object from live graph values, which means hashing checkpoints and LoRAs and maybe asking Civitai what they are. This one does the opposite: it parses the existing A1111 parameter string, rewrites the keys you asked about, and reassembles it. Everything it doesn't recognize survives untouched, so it round-trips settings from extensions it's never seen.
The rewrite is careful text surgery: split the settings line into key/value pairs (JSON and quoted values contain commas, so not a naive split), replace or drop the relevant keys, splice anything new before Version, rejoin. Prompts get the same treatment - peel off the Negative prompt: line, edit both halves, put it back.
It follows A1111's conventions too: denoise at 1.0 removes Denoising strength rather than writing 1.0, same for clip_skip at 0, and sampler plus scheduler collapse into the single Sampler field Civitai expects (dpmpp_2m + karras → DPM++ 2M Karras).
The fields you'll actually touch
One required input, metadata, from Load Image with Metadata (Image Saver) - or from another Edit Metadata, since the output is the same type and they chain. The optional fields behave in two ways:
Text fields use the [original] placeholder. positive, negative and modelname default to [original]: leave it and nothing is rewritten. Write [original], 4k, sharp and the placeholder is substituted for the existing text, so you're appending. Anything else replaces outright, and an empty box removes the value - for negative, that kills the whole Negative prompt: line. It's the best trick in the node: bolt prompt text onto a generation you didn't run this session.
Numbers and sampler/scheduler only change when connected. width, height, seed, steps, cfg, denoise, clip_skip, sampler_name and scheduler_name are input sockets, not widgets, so their defaults can't silently overwrite your file. Unconnected means untouched. To make the metadata tell the truth about an upscale, wire the real values in - the mechanism is ComfyUI's own: an unconnected optional input isn't passed to the node at all, and the code reads that as "keep what you have."
Two string fields handle deletion - this is where the node earns its keep:
remove_settings- comma-separated A1111 keys, e.g.Civitai resources, Hashes, Model hash. Posting somewhere that shouldn't see your resource list? Here's the switch.remove_resources- the surgical version: resources by name (the Civitai name, orEasyNegative), hash, Civitai version ID or AIR, pruned fromHashes,Civitai resources,Lora hashes/TI hashesand the pack'shashesoutput. The model's hash survives.
The single output is metadata, for Image Saver Simple's metadata input or another Edit Metadata.
Installing
Manager: search ComfyUI Image Saver. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/alexopus/ComfyUI-Image-Saver
cd ComfyUI-Image-Saver
pip install -r requirements.txt
Restart ComfyUI and you're done. The dependency list is piexif, nothing else - no models, no CUDA. This is alexopus's maintained fork of the dormant giriss/comfy-image-saver, so check any tutorial you follow points at the alexopus repo.
The traps
modelname changes the label, not the identity. The tooltip says it and people still get caught: rewriting Model: does not update Model hash or Civitai resources. The node isn't hashing anything, so it can't know what a new name hashes to. If you really swapped checkpoints, strip the stale hashes with remove_settings instead of pretending.
No A1111 parameters means nothing to edit. If the file came from ComfyUI's stock save node, the loader reconstructed values from the embedded workflow best-effort and there's no parameter string to rewrite - your edits update the Metadata object, but the saved file gets no parameters block. Likewise, feed it a loader that found nothing and None passes straight through with a console message.
Leave clip_skip alone unless you mean it. It's load-bearing on the SD 1.5 anime lineage, largely a no-op on SDXL, and on LLM-encoder models there's no CLIP to skip at all.
Verdict
Small node, narrow job, and the one I'd reach for before re-running a 60-second generation to fix a typo. [original] appending plus remove_resources covers most real use: clean the resource list after editing a prompt, or make the size line match the file you're shipping.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| metadata | METADATA | metadata to edit | |
| modelnameopt | STRING | [original] | model name shown in the parameters and used by %model in filenames. Doesn't change hashes or Civitai resources (remove them with remove_settings if needed). Supports the [original] placeholder; empty removes it. |
| positiveopt | STRING | [original] | positive prompt. '[original]' keeps it, '[original], more' appends, other text replaces it, empty removes it. |
| negativeopt | STRING | [original] | negative prompt. '[original]' keeps it, '[original], more' appends, other text replaces it, empty removes it. |
| widthopt | INT | 5120–16384 | image width |
| heightopt | INT | 5120–16384 | image height |
| seedopt | INT | 00–18446744073709550000 | seed |
| stepsopt | INT | 201–10000 | number of steps |
| cfgopt | FLOAT | 7.000–100 | CFG value |
| sampler_nameopt | COMBO | sampler name (as string) | |
| scheduler_nameopt | COMBO | normal | scheduler name (as string) |
| denoiseopt | FLOAT | 1.000–1 | denoise value |
| clip_skipopt | INT | 0-24–24 | skip last CLIP layers (positive or negative value, 0 for no skip) |
| remove_settingsopt | STRING | comma-separated A1111 settings to remove, e.g. 'Civitai resources, Hashes, Model hash' or 'Version, Lora hashes' | |
| remove_resourcesopt | STRING | comma-separated resources to remove from Hashes, Civitai resources, Lora/TI hashes and the hashes output: names (e.g. 'EasyNegative' or the Civitai name), hashes, Civitai version IDs or AIRs |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| metadata | METADATA | the edited metadata, for Image Saver Simple or another Edit Metadata |