mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-17 11:50:18 +08:00
Honor lossless webp compression option in API
This commit is contained in:
parent
1b16c62608
commit
ca3bedbd02
@ -122,7 +122,7 @@ def encode_pil_to_base64(image):
|
|||||||
if opts.samples_format.lower() in ("jpg", "jpeg"):
|
if opts.samples_format.lower() in ("jpg", "jpeg"):
|
||||||
image.save(output_bytes, format="JPEG", exif = exif_bytes, quality=opts.jpeg_quality)
|
image.save(output_bytes, format="JPEG", exif = exif_bytes, quality=opts.jpeg_quality)
|
||||||
else:
|
else:
|
||||||
image.save(output_bytes, format="WEBP", exif = exif_bytes, quality=opts.jpeg_quality)
|
image.save(output_bytes, format="WEBP", exif = exif_bytes, quality=opts.jpeg_quality, lossless=opts.webp_lossless)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise HTTPException(status_code=500, detail="Invalid image format")
|
raise HTTPException(status_code=500, detail="Invalid image format")
|
||||||
|
Loading…
Reference in New Issue
Block a user