From c083197684c6bc12d049efdd76b7808758339d0c Mon Sep 17 00:00:00 2001 From: Dowon Date: Mon, 25 Mar 2024 20:59:16 +0900 Subject: [PATCH] fix: webui < 1.6.0 import error --- scripts/!adetailer.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/!adetailer.py b/scripts/!adetailer.py index 7c0bd31..4af26d9 100644 --- a/scripts/!adetailer.py +++ b/scripts/!adetailer.py @@ -50,13 +50,20 @@ from modules.processing import ( Processed, StableDiffusionProcessingImg2Img, - create_binary_mask, create_infotext, process_images, ) from modules.sd_samplers import all_samplers from modules.shared import cmd_opts, opts, state +try: + from modules.processing import create_binary_mask +except ImportError: + + def create_binary_mask(image: Image.Image): + return image.convert("L") + + if TYPE_CHECKING: from fastapi import FastAPI