Skip to content

Commit

Permalink
Honor lossless webp compression option in API
Browse files Browse the repository at this point in the history
  • Loading branch information
catboxanon committed Nov 1, 2024
1 parent 1b16c62 commit ca3bedb
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 ca3bedb

Please sign in to comment.