InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[enhancement]: Write prompt to a standard PNG EXIF field

Open psychedelicious opened this issue 2 years ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Contact Details

No response

What should this feature add?

We could write the prompt (with no other metadata) to a standard PNG EXIF e.g. Description. Then normal image viewers can at least see it.

Alternatives

No response

Aditional Content

No response

psychedelicious avatar Dec 02 '22 00:12 psychedelicious

From NemesisFlux @ discord:

Maybe just to help out people like me, a note could be put in the comments field, saying something like, "InvokeAI parameters for this image are stored in tEXt fields in the PNG file. You can examine them with the free third-party program, pngcheck."

psychedelicious avatar Dec 02 '22 00:12 psychedelicious

Example implementation: https://gitlab.com/keturn/kikifusion/-/blob/890be52914713d33757c5b900b03ad91c735be21/src/qittnz6Lz/metadata.py#L77

ImageIFD.ImageDescription is probably the most widely-supported, but doesn't cope with multi-byte charsets like UTF-8 or UTF-16, so it's not great.

ExifIFD.UserComment does handle unicode and is supported by at least some applications.

I've noticed this request most often from Mac users. Is anyone able to point us to docs on which fields OS X displays in Finder and includes in its search index?

keturn avatar Dec 02 '22 17:12 keturn