AI Image Generators Hide Your Prompt Inside the File

If you have generated images locally and shared them, you have probably also shared your exact prompt, your negative prompt, the seed, the model you used, the sampler, the step count and β€” with some tools β€” your entire node workflow. It is stored inside the file, in plain text, and almost nobody knows it is there.

Where it lives

In a PNG text chunk β€” the same metadata mechanism used for copyright notices. It is not hidden or encoded; it is a key-value string sitting next to the image data. exiftool image.png reveals it in one command.

What is actually written

Stable Diffusion web interfaces store generation parameters in a single tEXt chunk keyed parameters:

a photorealistic portrait of a woman in a red coat, autumn park, golden hour, shallow depth of field Negative prompt: blurry, extra fingers, watermark, text Steps: 30, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 2847193056, Size: 832x1216, Model hash: 6ce0161689, Model: v1-5-pruned-emaonly, Denoising strength: 0.45, Hires upscale: 2, Lora hashes: "detail_tweaker: 7c6bad76eb00"

That is enough for anyone to reproduce the image exactly β€” same seed, same model, same settings. Which is precisely why it is written: reproducibility is genuinely useful when you are iterating.

ComfyUI embeds the whole workflow

// Two chunks, both JSON workflow β†’ the complete node graph, positions included prompt β†’ the resolved execution graph // Which means the PNG contains: - every node and its settings - all model, LoRA and embedding filenames - custom node names (revealing installed extensions) - local file paths, sometimes including a username

Drag a ComfyUI-generated PNG into ComfyUI and the entire workflow loads. That is a genuinely excellent feature for sharing techniques, and it means a casually posted image can disclose a pipeline someone spent months building β€” or a filesystem path containing their real name.

ToolStoresWhere
Automatic1111, ForgeFull parameter stringPNG tEXt: parameters
ComfyUIEntire workflow JSONPNG tEXt: workflow, prompt
InvokeAIMetadata JSONPNG tEXt: invokeai_metadata
FooocusParameters JSONPNG text chunk
MidjourneyPrompt textEXIF description fields
DALLΒ·E, FireflyProvenance, not promptC2PA manifest

Reading it

# Everything, including text chunks exiftool image.png # Just the generation parameters exiftool -Parameters image.png exiftool -PNG:All image.png # ComfyUI workflow, formatted exiftool -b -Workflow image.png | jq . # Often visible with no tools at all β€” # PNG text chunks are uncompressed by default strings image.png | head -40

That last command is the one that makes the point. The prompt is frequently readable in the first few hundred bytes of the file, because tEXt chunks store their content as plain uncompressed text and are written before the image data.

⚠️ Why people assume PNGs are clean

Metadata privacy advice is almost entirely about EXIF and JPEG photos β€” GPS coordinates, camera serial numbers, timestamps. PNG has no EXIF, so it acquired a reputation for being metadata-free.

It is not. PNG's tEXt, zTXt and iTXt chunks carry arbitrary key-value data, and AI generators use them heavily. The reputation is thirty years old and the usage is three years old.

What it can disclose

ExposedConsequence
The prompt itselfCan be personal, commercially sensitive, or embarrassing out of context
Negative promptOften reveals what you were trying to avoid
Model and LoRA namesIdentifies specific checkpoints, including private ones
Seed and settingsFull reproducibility by anyone
Workflow graphDiscloses a technique built over months
File pathsFrequently contain a username or client name
Denoising strengthA non-zero value reveals the image was img2img β€” it started from something

The last row is subtle and matters. A denoising strength below 1.0 means the generation started from an existing image. That alone tells a viewer the output was derived from a source, which may be exactly what someone presenting work as fully generated did not intend to disclose.

For commercial work the practical risk is simpler: a client-facing deliverable whose metadata names the LoRA, the base model and the local path /Users/jsmith/clients/acme/ discloses more about your process and your other clients than any contract intended.

Removing it

# Strip everything (PNG has no orientation tag to lose) exiftool -all= image.png # Whole folder, no backup copies exiftool -all= -overwrite_original -r ./output/ # ImageMagick magick input.png -strip output.png # oxipng β€” strips and optimises in one pass oxipng --strip all -o 4 image.png # Verify β€” should return nothing exiftool -Parameters -Workflow -Prompt image.png

βœ… Stripping PNG metadata is safe

With JPEG photographs, stripping metadata removes the EXIF Orientation tag and can leave the image permanently sideways. PNG has no orientation concept β€” pixels are always stored as displayed β€” so there is no equivalent risk.

You can strip PNG metadata unconditionally without needing to bake in a rotation first.

Keeping a copy for yourself

The parameters are useful. The sensible workflow keeps them privately and strips them from anything published:

# Archive the metadata alongside the original, then clean a copy for f in *.png; do exiftool -Parameters -Workflow -b "$f" > "archive/${f%.png}.txt" cp "$f" "publish/$f" exiftool -all= -overwrite_original "publish/$f" done

Does converting formats clean it?

ConversionRemoves the prompt?
PNG β†’ JPEGUsually β€” but some tools copy it to EXIF
PNG β†’ WebPDepends entirely on the encoder
PNG β†’ PNG (re-encode)Often not β€” many tools preserve chunks
Screenshot of the imageYes β€” new pixels, no history
Explicit -stripYes

Do not rely on conversion. Strip explicitly and then verify β€” one exiftool command confirms it rather than assuming a converter behaved as expected.

Platform behaviour

Most social platforms re-encode uploads and lose the metadata as a side effect. That is a side effect, not a guarantee, and it varies:

  • Behaviour changes without notice. A platform that strips today may add an "original quality" option tomorrow.
  • Displayed and downloadable versions differ. Some services show a stripped derivative and serve the original through a download link.
  • Direct file sharing preserves everything. Chat attachments, cloud storage links, email and Discord "send as file" all keep the original bytes intact.
  • Image hosts vary widely. Several art and AI-focused hosts deliberately preserve generation parameters as a feature.

🚨 The one that catches people

You post a stripped image publicly, then send the full-resolution original directly to a client or a collaborator. The public copy is clean; the file that went to a third party carries your entire workflow and your local paths.

Strip at the point of export, not at the point of posting. Then every copy that leaves your machine is already clean.

The opposite case: provenance

Commercial generators increasingly embed C2PA content credentials instead β€” a cryptographically signed manifest recording that the image was AI-generated, by which tool, and what edits followed.

That is deliberately the reverse of the problem above. Generation parameters are metadata you may want gone; provenance credentials are metadata intended to survive, so that an image can be verified as AI-generated downstream.

The tension is real: the same -all= command removes both. If you are stripping prompts from an image that carries content credentials, you are also removing its provenance record β€” which may be exactly what you want, or may be stripping a disclosure you are expected to preserve.

Strip metadata before you share

Remove embedded prompts, workflows and EXIF data in your browser β€” the image is never uploaded anywhere, which matters when the metadata is the sensitive part.

Open the EXIF Remover β†’

Summary

  • Local generators write the full prompt into PNG text chunks in plain text.
  • ComfyUI embeds the entire workflow, including file paths that may name you.
  • PNG is not metadata-free. That reputation predates AI tooling by decades.
  • strings image.png often reveals the prompt with no tools at all.
  • Denoising strength below 1.0 discloses that the image started from a source.
  • Stripping PNG metadata is safe β€” no orientation tag to lose.
  • Format conversion is not reliable. Strip explicitly and verify.
  • Strip at export, so every copy leaving your machine is clean.

Frequently Asked Questions

Do AI-generated images contain the prompt?

Most local generators do. Stable Diffusion interfaces write the full prompt, negative prompt, seed, sampler, step count, CFG scale and model hash into a PNG text chunk. ComfyUI goes further and embeds the entire node workflow as JSON, which anyone can load and reproduce.

Where is the prompt stored in a PNG?

In a tEXt or iTXt metadata chunk β€” the same mechanism PNG uses for copyright notices and comments. It sits alongside the image data rather than inside it, so it is trivially readable with any metadata tool and equally trivially removable.

How do I see the prompt in an AI image?

Run exiftool against the file, or open it in a text editor and look near the start β€” PNG text chunks are stored uncompressed by default, so the prompt is often readable as plain text among the binary data.

Does converting to JPEG remove the prompt?

It removes PNG text chunks, because JPEG has no equivalent. But some converters copy metadata into EXIF fields instead, and some generators write to EXIF directly. Verify with a metadata tool rather than assuming the conversion cleaned it.

Do social platforms strip this metadata?

Most re-encode uploads and strip it as a side effect, but behaviour varies by platform and changes without notice. Some preserve full-resolution originals in a download path even when the displayed version is stripped. Strip it yourself before uploading rather than relying on the platform.

P

Written by Paras

We build free, browser-based file tools and write the reference material we wish existed when we were looking things up. Spotted an error? Tell us and we will fix it.