Nodes/ComfyUI-SaveImageWithMetaData/Create Extra MetaData
ComfyUI Node

Create Extra MetaData

Stamp your own custom key/value fields into saved images

By nkchocoai·Created 2 years ago·Updated about a year ago· 126
Create Extra MetaData
  • extra_metadata
  • EXTRA_METADATA
key1
value1
key2
value2
key3
value3
key4
value4

This is the little sidekick node in the SaveImageWithMetaData pack. On its own it does almost nothing visible - its whole job is to let you attach arbitrary custom fields to the metadata that Save Image With Metadata bakes into your files. The main node handles all the automatic stuff (prompt, steps, sampler, model hashes). This one is for the things only you know and want written down alongside them.

Why would you bother? A few real cases. You're generating a themed batch and want every file tagged project: halloween-2026 so you can find them later. You're A/B testing and want variant: A stamped into the pixels, not just remembered in your head. You run a small pipeline and want a client or batch_id field to survive after the file leaves ComfyUI. Anything you'd otherwise scribble in a spreadsheet, you can instead weld directly to the image so the note can't get separated from the picture. That "the data rides inside the file" property is the same reason ComfyUI's workflow-in-PNG trick caught on in the first place - the context travels with the image instead of rotting in some folder you'll lose.

How it works

It's plumbing, not magic. You give it pairs - a key and a value - and it hands back a small bundle of type EXTRA_METADATA. That bundle is meaningless by itself; it only does something once you plug it into the extra_metadata input on the Save Image With Metadata node. At save time, your custom pairs get merged into the metadata block written to the file, right next to the auto-extracted generation parameters.

So the wiring is always the same two-node shape: Create Extra MetaData → (extra_metadata) → Save Image With Metadata. The create node produces, the save node consumes and writes. If you never connect it to the saver, it's a no-op.

The inputs and output

The interface is deliberately dead simple. There are four key/value slots:

  • key1 and value1 - the one required pair. Both are plain strings (key1 = "project", value1 = "halloween-2026").
  • key2/value2, key3/value3, key4/value4 - three more optional pairs, same deal. Leave the ones you don't need blank and they're ignored.

That's four custom fields per node. There's also an extra_metadata input on this node - that's the interesting bit for anyone who needs more than four fields. You can chain these: feed one Create Extra MetaData's EXTRA_METADATA output into the next one's extra_metadata input, and the pairs accumulate. Four nodes chained gives you sixteen fields. In practice four is plenty for most people, but the chaining escape hatch is there.

The single output is EXTRA_METADATA (type EXTRA_METADATA, not a list). It goes exactly one place: the extra_metadata socket on the saver. Nothing else in a normal workflow speaks this type.

Installing it

You don't install this node separately - it ships in the same pack as Save Image With Metadata. Get the pack and you get both.

Via ComfyUI Manager: search ComfyUI-SaveImageWithMetaData, install, restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/nkchocoai/ComfyUI-SaveImageWithMetaData.git

Then restart ComfyUI. It's pure Python - no model files, no chunky dependencies, nothing to download. Installs clean and fast.

Things worth knowing

  • It does nothing until it's wired to the saver. The most common "it's not working" is simply forgetting to connect the EXTRA_METADATA output into the Save Image With Metadata node. On its own it produces a value nobody reads.
  • Keep keys simple and don't collide with the built-ins. The saver already writes standard fields like the prompt, model, and hashes. Naming your custom key something generic risks confusion; use a distinctive namespace like myproject_batch rather than plain batch.
  • Your custom fields aren't part of the CivitAI spec. CivitAI reads the standard generation-parameters block to auto-detect resources; your bespoke project or variant fields are just extra text riding along in the file. They're for you and your own tooling, not for the site to interpret.
  • PNG only, really. Like all embedded metadata, these fields live in the image's text chunks and get stripped by anything that re-encodes the file. Keep the original the node saved if you want the notes to survive.
CategorySaveImage

Inputs (9)

NameTypeDefaultDescription
key1STRING
value1STRING
key2optSTRING
value2optSTRING
key3optSTRING
value3optSTRING
key4optSTRING
value4optSTRING
extra_metadataoptEXTRA_METADATA

Outputs (1)

NameTypeDescription
EXTRA_METADATAEXTRA_METADATA