How Generative AI Pipelines Embed Prompts & Local Paths Inside PNG Files
Digital illustrators, creative agencies, and concept studios build complex multi-stage pipelines in ComfyUI, Automatic1111, Forge, InvokeAI, and Flux. By default, every single PNG saved out of these engines embeds the entire generation recipe right inside ancillary PNG text chunks. Even worse, ComfyUI workflow JSON frequently records internal Windows or macOS folder paths (such as C:\Users\RealName\Models\Lora\client_v3.safetensors), proprietary client style LoRAs, and API node configurations.
Delivering raw AI-assisted design comps or uploading PNG assets to a website without scrubbing allows anyone who downloads the image to drag it straight into PNG Info or ComfyUI and reconstruct your exact node graph in one second.
Anatomy of a PNG Metadata Chunk
Following the 8-byte PNG file signature (89 50 4E 47 0D 0A 1A 0A), every PNG container is an ordered sequence of independent binary chunks:
[Length: 4 Bytes UInt32 BE] + [Chunk Type: 4 Bytes ASCII] + [Payload: Length Bytes] + [CRC32: 4 Bytes]Chunks whose first letter is lowercase (
tEXt, iTXt, zTXt, eXIf, tIME) are ancillary—removing them cleanly leaves IHDR and IDAT pixel streams 100% lossless and bit-exact!
AI Generator Metadata Storage Matrix
| AI Tool / Pipeline | Embedded Chunk / Tag | Typical Payload Size | What Gets Exposed If Unscrubbed |
|---|---|---|---|
| ComfyUI (Default PNG) | tEXt: prompt + workflow |
12 KB – 85 KB JSON | Complete node graph, custom nodes, LoRA names, local model paths, seeds |
| Automatic1111 / Forge | tEXt: parameters or EXIF 0x9286 |
1.5 KB – 8 KB text | Positive/negative prompt, CFG, sampler, Hires.fix settings, model hash |
| Midjourney / Niji Exports | tEXt: Description / iTXt |
0.8 KB – 3 KB text | Full prompt text, --sref style codes, aspect & chaos flags, Job UUID |
| WebP / JPEG Diffusion Saves | RIFF EXIF / XMP / COM |
2 KB – 30 KB | Serialized JSON parameters, software version, and creation timestamps |
Why Lossless Chunk Removal Beats Re-Saving in Image Editors
Opening a 4K PNG in a traditional raster editor and re-exporting takes several seconds per file, strips alpha premultiplication nuances if misconfigured, and can inflate file size due to weaker Deflate compression levels. Our Lossless Binary Chunk Strip excises ancillary text chunks in milliseconds while preserving your exact compressed IDAT stream and 8-bit/16-bit RGBA transparency.
Step-by-Step Benchmark: Scrubbing a ComfyUI Production Render
Consider a 1536 × 1024 studio concept PNG exported from a multi-ControlNet ComfyUI graph. Before sanitization, the file carries a 34.8 KB tEXt (workflow) chunk and an 11.2 KB tEXt (prompt) chunk containing 42 node definitions, internal network drive paths, custom IP-Adapter weights, and exact positive/negative prompt tokens. Dropping that PNG into this browser inspector immediately highlights the payload in purple under the AI Prompts filter tab. Selecting Lossless Binary Marker/Chunk Strip and clicking download outputs a bit-accurate PNG that is 46 KB lighter, passes CRC32 chunk integrity checks, and reports 0 Metadata Tags Remaining when re-loaded into the verifier or dragged back onto a ComfyUI canvas.