From ab4d34e509622695419587bdfc5e94222b08f23c Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Fri, 18 Aug 2023 18:43:23 +0530 Subject: [PATCH] sdkit 1.0.176 - resize control images to the task dimensions, to avoid memory errors with high-res control images --- scripts/check_modules.py | 2 +- ui/easydiffusion/tasks/render_images.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/check_modules.py b/scripts/check_modules.py index b3a28a76..3edaebff 100644 --- a/scripts/check_modules.py +++ b/scripts/check_modules.py @@ -18,7 +18,7 @@ os_name = platform.system() modules_to_check = { "torch": ("1.11.0", "1.13.1", "2.0.0"), "torchvision": ("0.12.0", "0.14.1", "0.15.1"), - "sdkit": "1.0.175", + "sdkit": "1.0.176", "stable-diffusion-sdkit": "2.1.4", "rich": "12.6.0", "uvicorn": "0.19.0", diff --git a/ui/easydiffusion/tasks/render_images.py b/ui/easydiffusion/tasks/render_images.py index bdf6e3ac..593b409d 100644 --- a/ui/easydiffusion/tasks/render_images.py +++ b/ui/easydiffusion/tasks/render_images.py @@ -15,6 +15,8 @@ from sdkit.utils import ( img_to_base64_str, img_to_buffer, latent_samples_to_images, + resize_img, + get_image, log, ) @@ -226,6 +228,8 @@ def generate_images_internal( req.width, req.height = map(lambda x: x - x % 8, (req.width, req.height)) # clamp to 8 if req.control_image and task_data.control_filter_to_apply: + req.control_image = get_image(req.control_image) + req.control_image = resize_img(req.control_image.convert("RGB"), req.width, req.height, clamp_to_8=True) req.control_image = filter_images(context, req.control_image, task_data.control_filter_to_apply)[0] if context.test_diffusers: