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

sd_api_pictures Should include SD metadata in generated images #920

Closed
altoiddealer opened this issue Apr 8, 2023 · 2 comments · Fixed by #1082
Closed

sd_api_pictures Should include SD metadata in generated images #920

altoiddealer opened this issue Apr 8, 2023 · 2 comments · Fixed by #1082

Comments

@altoiddealer
Copy link
Contributor

altoiddealer commented Apr 8, 2023

I have the sd_api_pictures extension running and it seems like it is working as intended-
-The bot types something
-SD uses that as a prompt to generate an image
-The image appears in the chat, and also in the /sd_api_pictures/outputs directory.

However, the output .PNG images do not have any Stable Diffusion metadata., which is very unfortunate.

Originally posted by @altoiddealer in #309 (comment)

Screenshot 2023-04-08 092926

@altoiddealer altoiddealer changed the title api_sd_pictures Should include SD metadata in generated images sd_api_pictures Should include SD metadata in generated images Apr 8, 2023
@altoiddealer
Copy link
Contributor Author

This is how the generated images should include metadata (example from a typical SD output)

Screenshot 2023-04-08 093148

@xlyric
Copy link

xlyric commented Apr 11, 2023

I have modify the API, and it's work, the image has now metadata

ln14 : from PIL import Image, PngImagePlugin

ln 147 :
png_payload = { "image": "data:image/png;base64," + img_str } response2 = requests.post(url=f'{params["address"]}/sdapi/v1/png-info', json=png_payload) pnginfo = PngImagePlugin.PngInfo() pnginfo.add_text("parameters", response2.json().get("info"))

corrected API
api.py.txt

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

Successfully merging a pull request may close this issue.

2 participants