Image Saver
The save node that writes the A1111 metadata CivitAI actually wants
- images
- hashes
- a1111_params
ComfyUI's built-in SaveImage embeds the workflow graph, which is great for rebuilding a canvas but not what CivitAI's uploader keys on when it auto-links your model and LoRAs. That auto-linking wants a flat, A1111-style parameters string plus resource hashes. This node writes both - and it does it from the actual parameters your workflow ran, not a guess. If you post generations anywhere that parses metadata, this is the output node you want at the end of the pipe.
Where it comes from
It's an adaptation of alexopus's ComfyUI-Image-Saver (a name with a real footprint in the community - people swap it in specifically for CivitAI uploads), reworked to fit this pack. The file-naming and raster/EXIF behavior are lifted from that project under MIT; the metadata side is the pack's own, schema-tagged so it can round-trip with the rest of the 4A nodes.
How it works
Give it images and it writes PNG, JPEG, or WebP into a subfolder of ComfyUI's output/ directory. The interesting part is what it records alongside the pixels:
- Exact generation parameters. Connect the pack's Input Parameters / Double Sample Parameters
parameters_json(or a scheduler'sprompt_json) and it extracts seed, steps, sampler, CFG, size, denoise from those schema-tagged blobs and writes them into A1111-compatible metadata (Steps:,Sampler:,CFG scale:,Seed:,Size:,Denoising strength:). - Resource hashes. Give it
model_nameand it resolves the file's SHA256 automatically (by name match across checkpoint/UNet folders); give it Lora Manager'sloaded_lorasoutput and it hashes the active LoRAs; embedding hashes too. Hashes are computed once and cached by file size + mtime, and a.sha256sidecar next to a model is reused instead of re-hashing. These land in thehashesoutput and inside the metadata - the exact payload CivitAI's auto-detection wants. - The workflow chunk.
embed_workflowis on by default, so dragging the saved PNG back into ComfyUI still rebuilds the graph. Unlike the flat-parameters-only savers, you get both dialects.
Inputs that matter
images(IMAGE) - the required one, straight from VAE Decode.filename- defaults to%time_%seed, using the same variables as Image Saver Simple (%time,%seed,%counter<N>with zero-padding, custom%time_format<...>). Good default; you'll usually leave it.path- subfolder underoutput/; blank saves to the root.extension(png/jpeg/jpg/webp) and the format controls (lossless_webp,quality_jpeg_or_webp,optimize_png).prompt_json- wire the Prompt Scheduler'sprompt_jsonhere and prompts come along automatically. If it's not connected,positive/negativefall back to direct entries.parameters_json- concatenated Input + Double Sample JSON from the two parameter nodes.custom- arbitrary text appended to the A1111 metadata.show_preview- on by default; flip it off for headless runs.
Outputs: hashes (resolved model/LoRA/embedding hashes as a string) and a1111_params (the parameter string written into the image). Both handy if you want to log or reuse them.
Installing it
Ships with the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/tsukino4a/ComfyUI-4A-Prompt-Manager.git
cd ComfyUI-4A-Prompt-Manager
python install.py # or: pip install -r requirements.txt
Restart after. ComfyUI Manager users: search 4A Prompt Manager. Note the one real dependency: piexif (in requirements.txt) is required for JPEG/WebP metadata. PNG works without it.
Troubleshooting
- JPEG/WebP save errors - that's
piexifmissing.pip install piexifor re-runinstall.py. PNG is unaffected. - No model hash in the metadata - the node needs
model_nameconnected (or resolvable) to hash the checkpoint; it can't infer a hash from nothing. - LoRA hashes absent -
loaded_lorascomes from willmiao's Lora Manager node'sloaded_lorasoutput. Without Lora Manager installed, LoRA info simply won't be there. - First save is slow - hashing a multi-GB checkpoint takes a moment; subsequent runs hit the cache.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | image(s) to save | |
| filename | STRING | %time_%seed | Same filename variables as Image Saver Simple |
| path | STRING | path under ComfyUI's output directory | |
| extension | COMBO | 4 options: png, jpeg, jpg, webp | |
| lossless_webp | BOOLEAN | true | — |
| quality_jpeg_or_webp | INT | 1001–100 | — |
| optimize_png | BOOLEAN | false | — |
| embed_workflow | BOOLEAN | false | — |
| save_workflow_as_json | BOOLEAN | false | — |
| model_nameopt | STRING | checkpoint or UNet filename; its SHA256 is resolved automatically | |
| loaded_lorasopt | STRING | Lora Manager loaded_loras output | |
| prompt_jsonopt | STRING | Prompt Scheduler prompt_json | |
| positiveopt | STRING | Positive prompt when Prompt Scheduler is not connected; ignored when prompt_json provides prompts | |
| negativeopt | STRING | Negative prompt when Prompt Scheduler is not connected; ignored when prompt_json provides prompts | |
| parameters_jsonopt | STRING | Concatenated Input Parameters and Double Sample Parameters JSON | |
| customopt | STRING | custom text appended to A1111 metadata | |
| counteropt | INT | 00–18446744073709550000 | — |
| time_formatopt | STRING | %Y-%m-%d-%H%M%S | — |
| show_previewopt | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| hashes | STRING | Resolved model, LoRA and embedding hashes |
| a1111_params | STRING | A1111-compatible parameters written to the image |