From 702edb288e53b9cf9d1727e0ca89f95102907c04 Mon Sep 17 00:00:00 2001 From: Art Gourieff <85128026+Gourieff@users.noreply.github.com> Date: Wed, 20 Mar 2024 15:14:28 +0700 Subject: [PATCH] FIX: initial_pp RGBA right way --- modules/api/api.py | 2 +- modules/postprocessing.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/api/api.py b/modules/api/api.py index 4e6560826..3e42dd7b1 100644 --- a/modules/api/api.py +++ b/modules/api/api.py @@ -99,7 +99,7 @@ def decode_base64_to_image(encoding): raise HTTPException(status_code=500, detail="Invalid encoded image") from e -def encode_pil_to_base64(image): +def encode_pil_to_base64(image: Image.Image): with io.BytesIO() as output_bytes: if isinstance(image, str): return image diff --git a/modules/postprocessing.py b/modules/postprocessing.py index 9afcfef86..40cf866a4 100644 --- a/modules/postprocessing.py +++ b/modules/postprocessing.py @@ -66,7 +66,7 @@ def run_postprocessing(extras_mode, image, image_folder, input_dir, output_dir, if parameters: existing_pnginfo["parameters"] = parameters - initial_pp = scripts_postprocessing.PostprocessedImage(image_data) + initial_pp = scripts_postprocessing.PostprocessedImage(image_data.convert("RGBA")) if image_data.mode == "RGBA" else scripts_postprocessing.PostprocessedImage(image_data.convert("RGB")) scripts.scripts_postproc.run(initial_pp, args)