Nodes/Image with Metadata/Save Image with Metadata
ComfyUI Node

Save Image with Metadata

A Save Image that keeps your notes with the picture

By shin131002·Created 7 months ago·Updated 6 days ago· 6
Save Image with Metadata
  • images
  • sampler_name
  • scheduler
  • image
positive_prompt
negative_prompt
filename_prefix%date:yyMM%/%date:yyMMdd-hhmmss%
image_format
metadata_save
text_format
model_name
vae_name
seed0
steps20
cfg7.00
memo
save_modeltrue
save_vaetrue
save_seedtrue
save_samplertrue
save_schedulertrue
save_stepstrue
save_cfgtrue
overlay_textfalse
overlay_content
overlay_position
overlay_font_size24

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 _metadata attribute somewhere upstream - any node that clones, cats, or rebuilds the tensor drops it silently. Fix: pass metadata_text explicitly instead of relying on the attribute.
  • You passed a JSON array and it saved as one Metadata chunk. The node only expands JSON objects; arrays and numbers get stashed whole. Pass a dict.
  • The workflow still saves regardless. The prompt and workflow chunks are always written, so this node is strictly a superset of Save Image - you can't accidentally strip the workflow by switching to it.
Categoryimage

Inputs (26)

NameTypeDefaultDescription
imagesIMAGE
positive_promptSTRING
negative_promptSTRING
filename_prefixSTRING%date:yyMM%/%date:yyMMdd-hhmmss%
image_formatCOMBO3 options: png, webp, jpg
metadata_saveCOMBO3 options: png_metadata_only, text_file_only, both
text_formatCOMBO2 options: json, plain_text
model_nameoptSTRING
vae_nameoptSTRING
seedoptINT00–18446744073709550000
sampler_nameopt*
scheduleropt*
stepsoptINT201–10000
cfgoptFLOAT7.000–100
memooptSTRING
save_modeloptBOOLEANtrue
save_vaeoptBOOLEANtrue
save_seedoptBOOLEANtrue
save_sampleroptBOOLEANtrue
save_scheduleroptBOOLEANtrue
save_stepsoptBOOLEANtrue
save_cfgoptBOOLEANtrue
overlay_textoptBOOLEANfalse
overlay_contentoptSTRING
overlay_positionoptCOMBO4 options: bottom_left, bottom_right, top_left, top_right
overlay_font_sizeoptINT248–200

Outputs (1)

NameTypeDescription
imageIMAGE