From ca3bedbd02d9b9837641b0e58345f63eac52a8cc Mon Sep 17 00:00:00 2001 From: catboxanon <122327233+catboxanon@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:32:52 -0400 Subject: [PATCH] Honor lossless webp compression option in API --- modules/api/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/api/api.py b/modules/api/api.py index 97ec7514ea1..db2fc648019 100644 --- a/modules/api/api.py +++ b/modules/api/api.py @@ -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")