Sign In

Workflow and Prompt to PNG

3

Nov 30, 2024

(Updated: 2 months ago)

tool guide
Workflow and Prompt to PNG

If you edit your ComfyUI-generated image in Photoshop, you lost all PNG metadata (prompt, workflow) -- so, you can't load them as workflow anymore. This script allow you to inject metadata back in PNG file (by creating new PNG file with workflow and prompt inside).

UPDATE (October, 2025): many modern workflows contain non-ASCII symbols (emoji, e.t.c) in nodes titles or in description notes - which cause error with adding them as metadata. This script clear all this non-ASCII symbols from files before adding metadata in PNG.

----- How To Use ----- (script and example files in attached zip)

1) --- Get 'prompt' data: ---

Load your ComfyUI-generated image to -- https://www.nayuki.io/page/png-file-chunk-inspector

and copy data from section "keyword: prompt" starting from {"1": ... and ending with ... }}

Paste data in prompt.txt

2) --- Put into C:\Temp ---

image.png

prompt.txt

workflow.json

workflow2png.py

___ and run workflow2png.py by double click.

Created file image_workflow_prompt.png -- has include your prompt and workflow!

***You can test your file in "Stable Diffusion Prompt Extractor" -- https://i210i.github.io/

3