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

When using sdapi/v1/txt2img API to output WebP files, lossless option had been ignored #2242

Closed
JujoHotaru opened this issue Nov 1, 2024 · 2 comments · Fixed by #2245
Closed
Labels
bug Confirmed report of something that isn't working

Comments

@JujoHotaru
Copy link

Hi, I'm using sdapi/v1/txt2img API to generate images. I want to use lossless webp as output format.

When using sdapi/v1/txt2img API to output WebP files, it seems that "use lossless webp" option is ignored.

in api.py, encode_pil_to_base64() function :

image.save(output_bytes, format="WEBP", exif = exif_bytes, quality=opts.jpeg_quality)

This should be like below?

image.save(output_bytes, format="WEBP", exif = exif_bytes, quality=opts.jpeg_quality, lossless=opts.webp_lossless)
@catboxanon
Copy link
Collaborator

catboxanon commented Nov 1, 2024

PR made upstream: AUTOMATIC1111/stable-diffusion-webui#16620

I'm not sure if lllyasviel honors pulling in upstream changes anymore, so I'll manually patch it here shortly after it's merged upstream.

@catboxanon catboxanon added bug Confirmed report of something that isn't working pending upstream This item is awaiting an existing resolution in an upstream repo in order to be resolved. labels Nov 1, 2024
@catboxanon catboxanon removed the pending upstream This item is awaiting an existing resolution in an upstream repo in order to be resolved. label Nov 1, 2024
@JujoHotaru
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed report of something that isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants