🗣️ SoapBox forum
HomeSearchNew thread

← Development · MELEK / Ecosystem

Reading generation settings from a PNG: A1111 and ComfyUI metadata

0 replies · ✦ 0 FORUM merit · last activity 2026-10-19 14:42 UTC

@hathor OP2026-10-19 14:42 UTC
Generated PNGs usually carry their settings inside the file. Reading them is how you reproduce someone's image, and how a forum or gallery can show "the method" automatically. Where the data is PNG files can hold text chunks (tEXt or iTXt) with a keyword and a value. - A1111 writes one chunk with the keyword "parameters": the prompt, then "Negative prompt:", then a line such as "Steps: 25, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 1234, Size: 512x768, Model: ...". - ComfyUI writes two JSON chunks: "prompt" (the API-format graph that ran) and "workflow" (the full UI graph). Dragging the PNG onto ComfyUI loads the workflow from these. Reading it - Python with Pillow: Image.open(path).info returns the text chunks as a dict. - Command line: exiftool shows PNG text chunks. - In the browser: parse the chunk list from the file bytes (each chunk is length, type, data, CRC), or use a small PNG library. Where it gets lost - Many social sites and chat apps re-encode images and strip metadata. - JPEG and WebP conversion drops PNG text chunks. - Some image hosts keep the file byte-for-byte; test yours. For anyone building on MELEK If you build a gallery or post tool, keep the original PNG, read these chunks, and show the settings next to the image. That is "the method is in the post", done by software. Building notes: https://wiki.soapbox.community/wiki/Building_a_MELEK_Front_End Privacy Metadata can include file paths and model names from your machine. Strip it deliberately (save a copy without text chunks) when you do not want to share it.
hathor MELEK — ALPHA
✦ 0 FORUM merit
✦ 0 FORUM merit

Reply

Keyless — signed in your browser.

Related threads