Set Metadata (All)
The node that stamps A1111-style settings onto every ComfyUI PNG
ComfyUI already buries a treasure trove in every PNG it saves: the full workflow JSON, the prompt graph, everything you'd need to rebuild the image from scratch. That's the "workflow included" culture in action, and it's genuinely great. What it does not write is the flat, human-readable parameters block that AUTOMATIC1111 and the whole ecosystem around it expect. Set Metadata (All) closes exactly that gap - feed it your prompt, seed, steps, and sampler, and it bakes an A1111-style settings block into the output file so tools from the other side of the fence can read your images.
Why you'd reach for it
If you came up on A1111 - and most of us did - you probably have a folder full of PNGs whose settings you can read at a glance: prompt, negative, CFG, seed, all in one neat block. Tools like Diffusion Toolkit, Stable Diffusion webui, and various gallery and viewer extensions parse that same parameters PNG chunk. This node makes your ComfyUI outputs speak that language, which is handy when you're migrating a workflow or keeping a library that both ecosystems can read.
Keep one thing straight: this is separate from ComfyUI's built-in embedding. ComfyUI writes the workflow as a JSON blob under its own prompt key; this node writes a plaintext parameters line for the tools that only understand A1111's format. Both get written, they don't collide, and you might want both.
How it works
The mechanism is small and sneaky. Every ComfyUI run carries a shared "extra PNG info" dict, and the built-in Save Image node serializes every key in that dict into the file as a tEXt chunk. This node just mutates that dict before the save happens, building a single parameters string in A1111's format:
A cyberpunk street, rain, neon
Negative prompt: blurry, lowres
Steps: 20, Sampler: euler, CFG scale: 7, Seed: 12345, Model: sdxl-base
then dropping it into extra_pnginfo["parameters"]. Save Image picks it up and writes it to disk. No API calls, no external services - pure local text juggling.
The inputs that matter
Every field is optional, and every one is forceInput - meaning you can't type into them; they're connection sockets. Wire them from the values already in your workflow (or from Text/String nodes) and leave the rest unplugged. The ones you actually care about:
prompt,negative- written as the first line and the "Negative prompt:" linesteps,cfg,seed- numbers, folded into the settings linemodel_name,sampler_name,scheduler- the sampler and scheduler enums match ComfyUI's own lists, so feed them from the real KSampler if you want an honest record
It has no outputs, and that's normal. It's an output node that writes side effects, so just leave the socket empty and let it sit there.
One limitation worth knowing: it writes only the combined parameters string. It won't create individual custom keys on their own - for that, reach for its sibling, Set Metadata (single field).
Install
One of the easiest packs you'll add:
cd ComfyUI/custom_nodes
git clone https://github.com/romeobuilderotti/ComfyUI-PNG-Metadata
then restart ComfyUI. Or in ComfyUI Manager, search "ComfyUI-PNG-Metadata" and hit install. There's no requirements.txt, no pip installs, no model downloads - it's two small Python classes. MIT licensed.
Watch for one trap: there's a different pack with the same name, by author "Kisaragi", that reads metadata out of PNGs instead of writing it. When you search Manager, check the author is romeobuilderotti.
Troubleshooting
- Missing metadata. This is the pack's own known issue, straight from the README: execution order isn't enforced. If Set Metadata (All) happens to run after your Save Image node, its changes never reach the file. Re-running the workflow often fixes it because the order isn't stable. It's a real annoyance on a long batch; the author noted it'll be fixed in a future release, but the repo has been quiet since mid-2024, so don't hold your breath.
- Things look quoted. Save Image JSON-serializes every value, so a raw PNG viewer shows
"parameters": "Steps: 20..."with quotes. That's normal - A1111-format parsers handle it fine. - Numeric fields. Everything lands as a string. If a tool like Diffusion Toolkit wants a typed number (say,
aesthetic_score), it may silently ignore the field. A PR adding aSetMetadataFloatnode was proposed for exactly this and never merged.
Given the dormancy, don't expect fancy features - but as a zero-dependency utility that survives ComfyUI updates, it keeps working. If you're keeping one metadata node around, this is the one.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| promptopt | STRING | — | |
| negativeopt | STRING | — | |
| model_nameopt | STRING | — | |
| stepsopt | INT | — | |
| cfgopt | FLOAT | — | |
| sampler_nameopt | COMBO | 34 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +28 | |
| scheduleropt | COMBO | 9 options: normal, karras, exponential, sgm_uniform, simple, ddim_uniform, +3 | |
| seedopt | INT | — |
Outputs (0)
No outputs