Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Include metadata inside the PNG header #25

Open
gymdreams8 opened this issue Sep 20, 2023 · 0 comments
Open

[Feature Request] Include metadata inside the PNG header #25

gymdreams8 opened this issue Sep 20, 2023 · 0 comments

Comments

@gymdreams8
Copy link

gymdreams8 commented Sep 20, 2023

I am using this model for some specific use cases via the Replicate API. I know that I can fork this and create my own version, but I only have a small request that I think that everyone could benefit from it, so instead of writing this small enhancement myself, thought that perhaps it would make sense for to you just implement it?

Right now, the images generated via the Replicate API does not include any parameter info, making it hard to know the parameters used after the images are saved locally. I would like to see if you would consider adding these metadata into the PNG header, similar to how Automatic1111 does it.

You can read the A1111 source, but potentially an even easier way is to see how image viewers read that info. You can view the implementation by SD Prompt Reader here:

https://github.com/receyuki/stable-diffusion-prompt-reader/blob/master/sd_prompt_reader/format/a1111.py

Essentially, the prompt and other meta data is stored inside the info field:

https://github.com/receyuki/stable-diffusion-prompt-reader/blob/28d1d1ba509203558ad26b8ae13b4e91418f1e5a/sd_prompt_reader/image_data_reader.py#L66

There‘s a very good reason to store inside the info field instead of EXIF — with one of the primary reason being that it won’t be stripped by Discord. This thus allows PNGs to be shared on Discord server and the prompts can then be shared and evolved among friends.

I hope that you would consider this feature as I believe that it would be beneficial to all.

I can explain my particular use case if necessary, but even merely for personal usage, not having prompt information makes these PNGs somewhat less useful. I know that I could possibly insert them into the PNG myself after receiving it from the replicate server, but in some ways it seems that it would be fantastic if all the PNGs already have that info.

Thanks very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant