Nodes/ComfyUI-QING/元数据丨写入
ComfyUI Node

元数据丨写入

Stamp your own prompt, seed, and model onto an output image

By sheengoa·Created about a year ago·Updated 19 days ago· 16
元数据丨写入
  • image
  • output_path
  • meta_json
prompt
seed0
model
video_path

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 a qing_metadata PNG 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 .json file 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.

CategoryQING/配置管理

Inputs (5)

NameTypeDefaultDescription
promptSTRING
seedINT0-1–2147483647
modelSTRING
imageoptIMAGE可选,写入 PNG 元数据并导出图片
video_pathoptSTRING可选,写入 sidecar 元数据文件

Outputs (2)

NameTypeDescription
output_pathSTRING
meta_jsonSTRING