From 22ac20467805e2ae5860fe7d46a4175f00c72858 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Mon, 11 Mar 2024 22:55:02 +1100 Subject: [PATCH] fix(config): fix invisible_watermark handling This setting was hardcoded to True. Simplified logic around it to not have a conditional that does nothing. --- invokeai/backend/image_util/invisible_watermark.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/invokeai/backend/image_util/invisible_watermark.py b/invokeai/backend/image_util/invisible_watermark.py index b21cc2e124..84342e442f 100644 --- a/invokeai/backend/image_util/invisible_watermark.py +++ b/invokeai/backend/image_util/invisible_watermark.py @@ -10,9 +10,9 @@ from imwatermark import WatermarkEncoder from PIL import Image import invokeai.backend.util.logging as logger -from invokeai.app.services.config import InvokeAIAppConfig +from invokeai.app.services.config.config_default import get_config -config = InvokeAIAppConfig.get_config() +config = get_config() class InvisibleWatermark: @@ -20,14 +20,8 @@ class InvisibleWatermark: Wrapper around InvisibleWatermark module. """ - @classmethod - def invisible_watermark_available(cls) -> bool: - return config.invisible_watermark - @classmethod def add_watermark(cls, image: Image.Image, watermark_text: str) -> Image.Image: - if not cls.invisible_watermark_available(): - return image logger.debug(f'Applying invisible watermark "{watermark_text}"') bgr = cv2.cvtColor(np.array(image.convert("RGB")), cv2.COLOR_RGB2BGR) encoder = WatermarkEncoder()