Nodes/OmniNodes/Metadata Embed 🏷️
ComfyUI Node

Metadata Embed 🏷️

Stamp your own notes into a PNG before you save it

By TensorVizionΒ·Created 3 months agoΒ·Updated about 8 hours agoΒ· 0
Metadata Embed 🏷️
  • image
  • saved_path
β—„filenametv_outputβ–Ί
β—„output_diroutput/tensorvizionβ–Ί
β—„keytv_notesβ–Ί
β—„valueβ–Ί
β—„extra_jsonβ–Ί

You already know the trick: ComfyUI bakes the entire workflow into every PNG it saves, as text chunks in the file. Metadata Embed 🏷️ is the same idea, but with your own key and value instead of ComfyUI's graph. It's a save node that writes whatever you want into the PNG's tEXt chunks alongside the pixels - a client name, a job ID, which seed-bank run this was, a note to your future self.

Why would you bother? Because the metadata in a PNG is the payload, not a footnote (the KB's image-io doc is worth a read on this). If you're running batch jobs for someone, or keeping an audit trail across hundreds of renders, embedding a searchable tag at save time beats maintaining a spreadsheet next to your output folder. This is the write side of the pair; its sibling Metadata Reader reads any PNG's chunks back out.

How it works

It's a thin wrapper around PIL. The image tensor is converted to a PIL image, and a PngImagePlugin.PngInfo object gets your key/value added as a text chunk - plus a tv_saved_at timestamp it stamps automatically. If you feed the optional extra_json field a valid JSON object, each top-level key becomes its own chunk, so you can attach a whole structured record at once. It saves to output_dir/filename.png, and if that file already exists it appends _001, _002, and so on rather than overwriting - repeat runs never silently clobber a previous save.

The inputs that matter

Four required inputs: the image you want saved, filename (default tv_output), output_dir (default output/tensorvizion), and key/value - the tag and its contents. key defaults to tv_notes, so if you only fill in value, you get a consistently-named chunk you can find later. Output is a single saved_path string telling you exactly where the file landed.

Two things to know. First, this is an output node - ComfyUI treats it as a workflow endpoint, so it has a queue slot alongside Save Image. Second, its category is TensorVizion/Model, which in this pack shows up in a separate submenu from the main Model Utilities group - a known quirk of OmniNodes, not a bug.

Installing it

It ships in the OmniNodes pack:

cd ComfyUI/custom_nodes/
git clone https://github.com/TensorVizion/OmniNodes

Then restart ComfyUI (or use ComfyUI Manager and search "OmniNodes"). No extra dependencies - this node uses only PIL, which every ComfyUI install already has. If it doesn't appear, restart completely and check the terminal for [OmniNodes] βœ… Loaded lines.

One honest caveat: whatever you embed survives only while the file itself survives. Re-encoding the PNG to JPEG, WebP, or pushing it through an image host that recompresses strips every text chunk - yours included. Keep the original PNG as the master, and the tags stay with it.

CategoryTensorVizion/Model

Inputs (6)

NameTypeDefaultDescription
imageIMAGEβ€”
filenameSTRINGtv_outputβ€”
output_dirSTRINGoutput/tensorvizionβ€”
keySTRINGtv_notesβ€”
valueSTRINGβ€”
extra_jsonoptSTRINGβ€”

Outputs (1)

NameTypeDescription
saved_pathSTRINGβ€”