Save Image with Metadata
A Save Image that keeps your notes with the picture
- images
- sampler_name
- scheduler
- image
The built-in Save Image already embeds your workflow in the PNG - that part is automatic and it's the whole basis of ComfyUI's sharing culture. What it won't do is save anything you want to say beyond that. Save Image (Metadata) is a drop-in replacement that writes your own custom metadata into the file, alongside the usual prompt and workflow chunks.
Reach for it when you want the output to carry extra baggage: which model and sampler you used, LoRA names, a CivitAI-style "parameters" string, or a note to your future self about what worked. Because it lands in the PNG's text chunks, it survives sharing - whoever downloads the image can read it back with this same pack or any PNG-info viewer.
How it works
It takes the image tensor and a metadata text, then writes the PNG with PngImagePlugin.PngInfo: the normal ComfyUI prompt and workflow chunks from the hidden prompt/extra_pnginfo inputs, plus your custom metadata as its own chunks. If you pass valid JSON, each key/value becomes a chunk and non-string values get JSON-serialized. If the text isn't valid JSON, the whole thing lands under a single UserMetadata key - so plain text works fine, it just gets a generic label.
The neat bit: leave metadata_text empty and it looks for the _metadata attribute riding on the tensor, set by Load Image (Metadata) or Set Image Metadata. That's the pack's headline feature - set it upstream, save it here, never type the same string twice.
Inputs that matter
images- what to save. Accepts a batch.metadata_text- optional. A JSON object or plain text to embed. Empty means "inherit from the tensor."filename_prefix- default "ComfyUI", same counter/numbering behavior as core Save Image.
No outputs - it's an output node, and it reports the saved files back to the UI.
Installing
ComfyUI Manager, search "Metadata Tools", install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/0nikod/ComfyUI-Metadata-Tools
Restart afterwards (plus pip install -r requirements.txt if the environment insists). Two notes: the README's own clone URL is typo'd - it reads dniko0/ but the repo is 0nikod/ - and the only declared dependency is Pillow, which ComfyUI already ships. No models, no heavy deps.
Troubleshooting
- Your custom metadata didn't appear. The usual cause is the tensor losing its
_metadataattribute somewhere upstream - any node that clones, cats, or rebuilds the tensor drops it silently. Fix: passmetadata_textexplicitly instead of relying on the attribute. - You passed a JSON array and it saved as one
Metadatachunk. The node only expands JSON objects; arrays and numbers get stashed whole. Pass a dict. - The workflow still saves regardless. The
promptandworkflowchunks are always written, so this node is strictly a superset of Save Image - you can't accidentally strip the workflow by switching to it.
Inputs (26)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| positive_prompt | STRING | — | |
| negative_prompt | STRING | — | |
| filename_prefix | STRING | %date:yyMM%/%date:yyMMdd-hhmmss% | — |
| image_format | COMBO | 3 options: png, webp, jpg | |
| metadata_save | COMBO | 3 options: png_metadata_only, text_file_only, both | |
| text_format | COMBO | 2 options: json, plain_text | |
| model_nameopt | STRING | — | |
| vae_nameopt | STRING | — | |
| seedopt | INT | 00–18446744073709550000 | — |
| sampler_nameopt | * | — | |
| scheduleropt | * | — | |
| stepsopt | INT | 201–10000 | — |
| cfgopt | FLOAT | 7.000–100 | — |
| memoopt | STRING | — | |
| save_modelopt | BOOLEAN | true | — |
| save_vaeopt | BOOLEAN | true | — |
| save_seedopt | BOOLEAN | true | — |
| save_sampleropt | BOOLEAN | true | — |
| save_scheduleropt | BOOLEAN | true | — |
| save_stepsopt | BOOLEAN | true | — |
| save_cfgopt | BOOLEAN | true | — |
| overlay_textopt | BOOLEAN | false | — |
| overlay_contentopt | STRING | — | |
| overlay_positionopt | COMBO | 4 options: bottom_left, bottom_right, top_left, top_right | |
| overlay_font_sizeopt | INT | 248–200 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |