Stable Diffusion and ComfyUI metadata: where prompts hide and how to clean them

By ExifZero Engineering · Updated

Short answer: Local image generators write reproduction data directly into PNG text chunks (or JPEG/WebP EXIF UserComment) so you can drag an image back into the UI later. AUTOMATIC1111, Forge and SD.Next store prompts, seeds and model hashes in a parameters chunk; ComfyUI embeds both prompt and workflow JSON graphs; NovelAI, InvokeAI and Fooocus use their own JSON chunks. Keep your uncleaned PNGs in a private archive and batch-strip sharing copies losslessly.

Hosted AI services usually embed formal provenance claims (like OpenAI's C2PA manifest), whereas local open-weight interfaces embed engineering recipes. That design is great when you want to reproduce a render six months later, and awkward when you post a showcase image online without realizing it carries your local folder structure, private LoRA filenames, client project names or negative prompt lists.

Where each local tool writes its data

GeneratorContainer locationWhat is exposed inside
AUTOMATIC1111 / Forge / SD.NextPNG tEXt/iTXt key parameters; JPEG/WebP EXIF UserCommentPositive prompt, negative prompt, steps, sampler, schedule type, CFG scale, seed, resolution, model name, model hash, LoRA weights
ComfyUIPNG tEXt keys prompt and workflowEvery node connection, CLIP prompt text, seed, custom node names, checkpoint/LoRA subpaths (e.g. clients/acme_v2.safetensors), UI notes
InvokeAIPNG key invokeai_metadata (older builds: sd-metadata, Dream)JSON object with prompt, model, scheduler, steps, CFG and ControlNet references
FooocusPNG keys parameters or fooocus_schemePrompt, negative prompt, style presets, performance mode, seed, base/refiner model
NovelAIPNG keys Software, Source, CommentJSON payload containing prompt, uc (undesired content), steps, sampler, scale and seed

What the raw chunks look like

An AUTOMATIC1111 or Forge render looks deceptively simple when viewed as a picture, yet its parameters PNG chunk holds a plain-text block structured like this:

editorial studio portrait of a ceramic teapot on linen, soft window light
Negative prompt: plastic, oversaturated, watermark, blurry
Steps: 28, Sampler: DPM++ 2M, Schedule type: Karras, CFG scale: 6.5, Seed: 418902114, Size: 1024x1024, Model hash: 6ce0161689, Model: juggernautXL_v9

ComfyUI goes much further. Its prompt chunk serializes the execution graph (where ExifZero extracts text from CLIPTextEncode nodes), and its workflow chunk often weighs 15 KB to 120 KB of JSON detailing subfolder names and custom nodes:

{
  "3": {
    "class_type": "KSampler",
    "inputs": { "seed": 88412093, "steps": 24, "cfg": 5.5, "sampler_name": "euler" }
  },
  "4": {
    "class_type": "CheckpointLoaderSimple",
    "inputs": { "ckpt_name": "flux1-dev-fp8.safetensors" }
  },
  "6": {
    "class_type": "CLIPTextEncode",
    "inputs": { "text": "warm afternoon light across oak floorboards, 35mm film" }
  }
}

Notice that checkpoint and LoRA strings mirror your disk paths. If you keep project-specific LoRAs in folders named after clients or unreleased products, those directory names travel inside every ComfyUI PNG.

ExifZero inspecting synthetic-sd.png and extracting the Stable Diffusion prompt, negative prompt and generation parameters
How ExifZero surfaces embedded PNG generation chunks: plain-text prompt copy buttons, parameter chips and privacy alerts in one view.

The two-folder workflow (recommended)

Turning off metadata saving permanently inside your UI is convenient until the day you want to tweak a seed or inspect which sampler produced your favorite render. A safer setup separates archival masters from publishable exports:

  1. Keep metadata ON in your working output folder. Let A1111, Forge or ComfyUI write full parameters / workflow chunks to your local drive so you never lose a recipe.
  2. Batch-clean only the export copies. Copy the finals into a sharing folder, drop the whole batch onto ExifZero's metadata remover, and click Clean all & download ZIP. ExifZero removes every PNG text chunk and EXIF comment while copying IHDR, IDAT and color chunks byte for byte — zero re-encoding.
  3. Check the Summary and All metadata tabs on one output. Confirm no stray Software, Comment or UserComment fields survived, especially if you converted PNGs to WebP or JPEG earlier.

How to disable metadata saving in-app (when needed)

If you prefer never writing prompts at all, most local interfaces expose toggles — though exact menu labels vary by version and extensions:

What happens when you convert PNG renders to WebP or JPEG

Many creators convert ComfyUI or A1111 PNGs to WebP or JPEG to save disk space before uploading to portfolios or client decks, assuming the format switch discards PNG text chunks automatically. In practice, A1111, Forge and popular ComfyUI save nodes copy the generation string into EXIF UserComment (0x9286) or XMP Description whenever you save as JPEG or WebP — and if an image contains both EXIF and XMP, desktop converters like ImageMagick or XnConvert often carry those chunks straight across into the new format.

That is why checking the final export format in ExifZero's AI image checker is safer than relying on file conversion alone. ExifZero parses PNG chunks, JPEG APP1 / COM segments and WebP EXIF / XMP chunks uniformly, and its lossless cleaner cuts them out without adding a second round of JPEG or WebP compression loss.

One detail specific to PNGs exported from ComfyUI: if a file has both a large workflow chunk (say 80 KB of node coordinates) and a prompt chunk, stripping those chunks reduces PNG file size immediately while keeping every RGBA pixel and transparency mask bit for bit identical. If you publish sprite sheets, alpha-masked cutouts or high-detail renders, keeping pixels untouched avoids the color banding that canvas re-savers often introduce.

Remember two boundaries: stripping PNG text chunks removes file metadata only (it never touches pixels or pixel-level watermarks), and if a site, contest or client requires disclosing AI-assisted artwork, removing generation chunks does not waive that disclosure rule.

Frequently asked questions

Does ComfyUI save my entire workflow graph inside every PNG?

By default, yes. ComfyUI writes two PNG text chunks into saved outputs: “prompt” (the API execution graph with your text prompts, seeds and checkpoint filenames) and “workflow” (the full UI node layout, custom node types and notes).

Does converting a Stable Diffusion PNG to JPEG remove the prompt?

Not automatically. Many WebUI extensions and image workflows copy the generation string into the JPEG EXIF UserComment field or XMP description. Always inspect the converted JPEG before assuming the prompt is gone.

If I strip metadata from my local PNG, can I still drag it back into ComfyUI or A1111 later?

No. Drag-and-drop workflow reloading relies entirely on those “prompt”, “workflow” and “parameters” PNG text chunks. Keep an uncleaned master folder locally for yourself and clean only copies meant for sharing.

Can ExifZero remove prompts from dozens of WebUI renders at once?

Yes. Drop a batch of PNG, JPEG or WebP renders onto the tool and click “Clean all & download ZIP”. All text chunks and EXIF comments are stripped losslessly in your browser without recompressing pixels.

Related tools

Related guides

Browse all 16 guides →