A working example, with the files
Read InvokeAI metadata from an original PNG
Use the original PNG to read a supported invokeai_metadata record. The saved-prompt extractor can return its positive prompt, negative prompt and available generation settings without generating new text.
Follow the steps
- Download the InvokeAI example below. Its record is synthetic and the pixels are drawn by code.
- Choose it in the saved-prompt extractor. Check that the prompt describes three folded paper stars.
- Open the saved settings. The example records seed 0, 30 steps, CFG scale 4.5 and the euler scheduler.
A zero seed is still a saved value
This fixture deliberately stores zero as its seed. Zero must be kept distinct from a missing field. The published result below comes from executing our reader against the downloadable file.
Saved generation dimensions describe the record. They need not match the current file’s pixel dimensions; editing or a manually attached record can make them differ.
Why some InvokeAI files return no single prompt
isGenAI handles the supported current-shaped record shown in this example. That does not establish support for every historical InvokeAI format or custom export.
A file may include different main and style prompts. This reader does not silently choose one when the supported record requires more than one instruction. Review the original workflow in that situation.
Keep interpretation separate from reading
The source implementation linked below shows InvokeAI metadata field names and import handling. Our downloadable example tests our reader; it is not a claim that we ran that InvokeAI release or reproduced an image with its settings.
Download · Run · Compare
Try the verified example
We drew the picture by code and attached controlled records. The saved prompts and model names are demonstration data. These files test record reading; no image generator, screenshot app or social network was used to create these test results.
Observed output
{
"format": "invokeai",
"prompt": "Controlled example: three folded paper stars",
"negative_prompt": "text",
"recorded_model": "demonstration-only",
"settings": {
"seed": "0",
"steps": 30,
"scheduler": "euler",
"cfg_scale": 4.5,
"width": 1024,
"height": 768
}
}Seed values in the JSON are strings so that large integers retain their precision. A null result here means no supported saved prompt was returned.
Hashes and reproduction
- invokeai-record.png · 13,470 bytes
f8ed839eb6a2a833548da189fd4499594326376425a7b200692f8064c777af99
Fixtures and observations are CC0-1.0. Download all observations and versions or read the procedure. The complete Node.js reproduction script (requires sharp) creates the same test inputs and compares bytes and pixels. The isGenAI source checkout additionally verifies saved fields with npx tsx scripts/build-guide-lab.ts.
For the separate export study, explore the 18 metadata-retention cases.
Sources and method
The linked primary sources describe the formats. The downloadable fixture outputs were checked with automated assertions against the current isGenAI reader. These guides were prepared with AI assistance and reviewed against those examples.
Report an error or unsupported example. For a signed record, inspect Content Credentials.