Esta página solo está disponible en inglés por ahora. El resto del sitio está en tu idioma.

Read Stable Diffusion Metadata from a PNG

2026-08-11 · 6 min

Why a PNG can contain your entire prompt

The PNG format has a slot for arbitrary text. Local image generators use it. When AUTOMATIC1111, ComfyUI, InvokeAI or Fooocus saves a PNG, it writes the generation parameters into that slot as a plain string, so you can drop the file back into the interface later and recover the settings.

That is a genuinely good design decision for reproducibility. It also means the file announces itself: an image carrying a parameters chunk with a sampler name and a CFG scale is self-declaring as AI-generated, in a way nobody has to interpret.

How PNG text chunks work

A PNG is a signature followed by a sequence of chunks. Each chunk is length, four-character type, data, CRC. Decoders ignore chunk types they do not recognise, which is what makes the format extensible.

Three chunk types carry text.

Chunk Encoding Compressed Typical use
tEXt Latin-1 No Short ASCII keyword/value pairs — the classic A1111 parameters blob
zTXt Latin-1 zlib deflate The same data when it is long enough to be worth compressing
iTXt UTF-8 Optional Non-ASCII prompts, and the standard home for embedded XMP

Each has a keyword, then a null byte, then the payload. Reading a tEXt chunk is straightforward. Reading zTXt and iTXt requires an inflate step, which is where a lot of simple viewers give up and report nothing — one reason an image can look "clean" in one tool and be full of data in another.

There is also eXIf for a standard EXIF block, and caBX for a C2PA manifest.

Which key each tool writes

Tool Keyword Format
AUTOMATIC1111 / Forge parameters One string: prompt, negative prompt, then comma-separated settings
ComfyUI prompt and workflow JSON — the API graph and the editor graph
InvokeAI invokeai_metadata (older: sd-metadata, Dream) JSON
Fooocus parameters or Comment A1111-compatible string, or its own JSON
NovelAI Software, Comment, Description Software identifier plus a JSON comment
Draw Things XMP or a tool-specific key Varies by version

A typical AUTOMATIC1111 payload looks like this:

a lighthouse in fog, 35mm, muted colours
Negative prompt: text, watermark, blurry
Steps: 28, Sampler: DPM++ 2M Karras, CFG scale: 7,
Seed: 2947183055, Size: 832x1216, Model hash: 1f2c9e0d3a,
Model: sd_xl_base_1.0, Denoising strength: 0.45,
Hires upscale: 2, Hires upscaler: 4x-UltraSharp

Everything needed to re-run the generation is there: prompt, negative prompt, sampler, step count, CFG scale, seed, resolution, and the model identified both by name and by hash.

ComfyUI is different in kind. It stores the whole node graph as JSON, so the payload can run to tens of kilobytes and includes every node, every connection, and the values of all widgets. It is harder to read at a glance and contains strictly more information.

Four ways to read it

1. Drop it into SynthCheck. Open SynthCheck, drag the file in. It parses the bytes locally in your browser — nothing is uploaded, there is no server and no account — and it inflates zTXt and iTXt, so compressed payloads are not missed. It shows the raw field alongside the finding.

2. exiftool. The command-line standard:

exiftool -a -G1 -s image.png
exiftool -PNG:All image.png

The -a flag shows duplicate tags and -G1 shows which group each came from.

3. Python. Pillow exposes the text chunks directly:

from PIL import Image
img = Image.open("image.png")
for key, value in img.text.items():
    print(key, "->", value[:400])

img.text covers tEXt, zTXt and iTXt, with decompression handled for you.

4. The generator itself. AUTOMATIC1111 has a "PNG Info" tab; drop the image there and it parses the parameters and offers to send them straight to txt2img. ComfyUI restores an entire workflow when you drag a PNG onto the canvas.

What destroys it

Action Result
Save as JPEG or WebP Gone. Neither format has PNG text chunks
Upload to most social platforms Gone. The file is re-encoded — see why Instagram strips image metadata
Screenshot Gone. A screenshot is a new file with no history
Crop or edit in most editors Usually gone, unless the tool deliberately preserves text chunks
Copy the file, zip it, email it Intact. Byte-for-byte copies keep everything

Some sites go the other way and read the chunks on purpose. Civitai parses generation data on upload and displays the prompt and settings under the image, which is why parameters often show up there even when the same image is bare everywhere else.

What this data does and does not prove

A parameters chunk naming a sampler and a seed is strong evidence: no camera writes that, and no ordinary editing pipeline invents it. Combined with a model name and a CFG value, it is about as clear a self-declaration of AI origin as you can get short of a signed C2PA manifest.

The reverse does not hold. A PNG with no text chunks is not evidence that the image is a photograph. The chunks are optional, most generators can be configured not to write them, every format conversion removes them, and the overwhelming majority of images in circulation never had them. This is the same rule that governs every other marker — covered in more depth in how to check if an image is AI-generated.

Also worth knowing: these chunks are unsigned plain text. Anyone can write a convincing parameters string into any PNG. For a marker with cryptographic backing, you want C2PA Content Credentials, which are signed and hash-bound to the pixels.

Reproducing an image from its parameters

Having the seed does not guarantee an identical result. You also need the same model weights (check the hash, not just the name), the same VAE, the same sampler implementation, and often the same library versions — attention backends, precision settings and GPU differences all shift the output. Same seed, different environment, different image. Close, usually. Identical, rarely.

FAQ

My PNG has no prompt data. Was the metadata removed? Possibly, but more likely it was never written. Web-based generators mostly do not write A1111-style chunks, the file may have been converted from another format, or the tool was configured not to save parameters.

Why does one tool show nothing and another shows a full prompt? Because the payload is in a compressed zTXt or iTXt chunk and the first tool did not inflate it. SynthCheck, exiftool and Pillow all handle compressed chunks.

Are prompts private? Treat them as public. Prompts routinely contain LoRA names, local file paths, model directories and occasionally personal details, and they travel with any unmodified copy of the file. Know what you are sharing before you share it.

Does a prompt chunk mean the image is entirely AI-generated? Not necessarily. The same fields appear for img2img and inpainting runs, where a real photograph was the input. A denoising strength well below 1.0, or an inpainting mask reference, is a hint that something else was underneath.

Comprueba una imagen ahora

Gratis, sin registro, y el archivo nunca sale de tu navegador.

Abrir la herramienta