AI metadata

PNG text chunks and AI generation metadata

A PNG is a sequence of labelled chunks, and three of those labels hold arbitrary text. That is why an image generated locally can arrive at a stranger's computer carrying your full prompt, your negative prompt, your seed and the entire node graph you built to produce it.

tEXt, zTXt and iTXt

The PNG specification defines three textual chunk types. All three store a keyword and a value; they differ in encoding.

tEXt holds a Latin-1 keyword, a null separator and uncompressed Latin-1 text. It is the simplest form and the one every tool can read.

zTXt holds the same keyword, a compression-method byte, and a zlib-compressed value. Nothing about the chunk is human-readable until it is inflated.

iTXt is the international variant: UTF-8 text, an optional language tag and translated keyword, and a compression flag. When that flag is set the value is compressed exactly as in zTXt; when it is clear, the text sits in the open.

The distinction looks like an encoding detail. It is the entire problem.

What AUTOMATIC1111 writes

The Stable Diffusion web UI writes a single text chunk under the keyword parameters. Its value is one string that typically contains the positive prompt, the negative prompt, and a trailing line of generation settings — steps, sampler, CFG scale, seed, output size, and the model name and hash.

That last part is what makes it sensitive beyond the obvious. A prompt is embarrassing at worst; a model hash plus a seed makes an output reproducible, and a reused seed links separate images to the same session.

What ComfyUI writes

ComfyUI writes considerably more. It stores two records: prompt, the resolved execution graph, and workflow, the editor's own representation of the canvas — nodes, wiring, widget values and positions.

Both are JSON, and both describe the complete pipeline: every checkpoint, LoRA and VAE by filename, every sampler setting, and any local file paths that appear as node inputs. A ComfyUI PNG frequently carries more information about the machine that made it than about the picture. Because these payloads are large, they are the chunks most likely to be compressed.

Why compressed chunks hide

Here is the practical failure. A tool that enumerates PNG chunks and reads only tEXt — or that greps the file for readable strings — will find nothing in a file whose entire workflow sits inside a zTXt chunk. It reports a clean image. The workflow is still there, byte for byte, one inflate call away from anyone who cares to look.

This is not a hypothetical class of tool. Reading compressed chunks requires actually decompressing them, which is a step a simple metadata stripper can skip without appearing to fail.

MetaPurify's inspector inflates compressed PNG text before classifying it, so a compressed ComfyUI workflow is reported as found rather than missed. On removal, all three chunk types are dropped together — tEXt, zTXt and iTXt — rather than only the readable one. The same pass covers the eXIf chunk and the tIME timestamp.

One useful consequence: because chunk removal happens around the image data, the compressed pixel stream in IDAT is copied through unchanged. Stripping a 400 KB workflow out of a PNG does not re-encode the picture.

JPEG is not exempt

PNG gets the attention because text chunks are where generators naturally write, but the same details reach JPEG files by other routes: an EXIF UserComment, a JPEG comment segment, or an XMP packet carrying CreatorTool and generation parameters. A file converted from PNG to JPEG by a tool that "preserves metadata" carries the prompt across with it.

If you check one thing, check the format you actually shared, not the format you generated.

What removal does not do

Removing generation metadata removes generation metadata. It does not do any of the following, and any tool implying otherwise is overselling:

The honest framing is narrow and still worth acting on: your prompt, your seed, your model list and your node graph are private information that PNG will carry to anyone you send the file to, unless you take them out first.

Inspect an AI-generated image