From 4895fe839546d44a7b1c3f6b7bd5b63bd112e366 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Sun, 5 Feb 2023 10:26:40 -0500 Subject: [PATCH] fix crash when text mask applied to img2img (#2526) This PR fixes the crash reported at https://discord.com/channels/1020123559063990373/1031668022294884392/1071782238137630800 It also quiets-down the "NSFW is disabled" nag during img2img generation. --- ldm/invoke/CLI.py | 2 ++ ldm/invoke/generator/inpaint.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ldm/invoke/CLI.py b/ldm/invoke/CLI.py index aba8f6e1ce..931e17a3a1 100644 --- a/ldm/invoke/CLI.py +++ b/ldm/invoke/CLI.py @@ -71,6 +71,8 @@ def main(): # when the frozen CLIP tokenizer is imported import transformers transformers.logging.set_verbosity_error() + import diffusers + diffusers.logging.set_verbosity_error() # Loading Face Restoration and ESRGAN Modules gfpgan,codeformer,esrgan = load_face_restoration(opt) diff --git a/ldm/invoke/generator/inpaint.py b/ldm/invoke/generator/inpaint.py index db0ae39463..61c5b56582 100644 --- a/ldm/invoke/generator/inpaint.py +++ b/ldm/invoke/generator/inpaint.py @@ -194,7 +194,8 @@ class Inpaint(Img2Img): """ self.enable_image_debugging = enable_image_debugging - self.infill_method = infill_method or infill_methods()[0], # The infill method to use + infill_method = infill_method or infill_methods()[0] + self.infill_method = infill_method self.inpaint_width = inpaint_width self.inpaint_height = inpaint_height