Skip to content

Commit

Permalink
Merge pull request #16620 from AUTOMATIC1111/fix/api-webp-lossless
Browse files Browse the repository at this point in the history
Honor lossless WebP compression option in API
  • Loading branch information
w-e-w authored Nov 1, 2024
2 parents 1b16c62 + ca3bedb commit 7799859
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def encode_pil_to_base64(image):
if opts.samples_format.lower() in ("jpg", "jpeg"):
image.save(output_bytes, format="JPEG", exif = exif_bytes, quality=opts.jpeg_quality)
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:
raise HTTPException(status_code=500, detail="Invalid image format")
Expand Down

0 comments on commit 7799859

Please sign in to comment.