元数据丨写入
Stamp your own prompt, seed, and model onto an output image
- image
- output_path
- meta_json
ComfyUI already bakes the whole workflow into every PNG it saves - the KB's image-io doc calls that the "workflow lives in the file" convention. But that only works when the workflow graph itself is the record. If you're saving JPEGs or WebP (which can't hold the graph the same way), exporting through a pipeline that strips chunks, or you just want a clean human-readable record of what you ran, QING_MetadataWriter gives you a way to write your own: prompt, seed, model, timestamp, as JSON.
What it does
Three required inputs: prompt (multiline), seed (int), and model (string). It bundles those plus a timestamp into a JSON payload and writes it out one of three ways depending on what you connect:
- With an
image- it saves a copy of the image to ComfyUI's output folder as a PNG, with the payload embedded in aqing_metadataPNG text chunk. This is the "provenance-safe PNG" route. - With a
video_path- no PNG possible, so it writes a sidecar file next to the video:my_video.mp4.qing_meta.json. - With neither - it writes the JSON payload to a standalone
.jsonfile in the output folder.
Outputs: output_path (where the record actually landed) and meta_json (the payload string, so you can log it or pass it on).
Where you'd reach for it
The sweet spot is any output format that loses the embedded workflow. If you're saving JPGs for delivery (smaller, no alpha, but the graph chunks die), pair QING_SaveImage with this node and the provenance survives in text form. It's also the simple, no-tools answer for "I want a text file that says exactly what this batch was" - connect nothing optional and it just writes you a JSON record per run.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/GAO-SHIQING/ComfyUI-QING
cd ComfyUI-QING
python install_dependencies.py
Restart ComfyUI after. It uses Pillow's PNG metadata support, which is in the pack's requirements already. Manager: search "ComfyUI-QING." (README's GAOSHI-QING clone-URL typo notwithstanding - repo is GAO-SHIQING/ComfyUI-QING.)
Things to know
The honest caveat: it writes what's in the widgets, not what the sampler actually ran. If your prompt text doesn't match the prompt on your CLIP Text Encode, you're stamping a lie onto the file. The safe habit is to convert the widget inputs to connections and wire them from the real source nodes so they can't drift, or to treat this as "records what I intended" rather than "records what happened." The image route saves a copy with a timestamped filename (qing_meta_20260826_...png), so you end up with the original plus a metadata-stamped duplicate - don't be surprised by the extra file. And JPEG/WebP outputs genuinely can't carry the PNG chunk, so for those you want the sidecar or the standalone-JSON path.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| seed | INT | 0-1–2147483647 | — |
| model | STRING | — | |
| imageopt | IMAGE | 可选,写入 PNG 元数据并导出图片 | |
| video_pathopt | STRING | 可选,写入 sidecar 元数据文件 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| output_path | STRING | — |
| meta_json | STRING | — |