From 63a06db0947b5d8fe6f81b95d03cd3e5f3a51576 Mon Sep 17 00:00:00 2001 From: Bingsu Date: Mon, 3 Jul 2023 00:51:09 +0900 Subject: [PATCH] fix: close Processing object after generation --- scripts/!adetailer.py | 2 ++ sd_webui/processing.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/scripts/!adetailer.py b/scripts/!adetailer.py index 6d1f8b9..3fdf4bb 100644 --- a/scripts/!adetailer.py +++ b/scripts/!adetailer.py @@ -557,6 +557,8 @@ class AfterDetailerScript(scripts.Script): msg = f"[-] ADetailer: 'NansException' occurred with {ordinal(n + 1)} settings.\n{e}" print(msg, file=sys.stderr) continue + finally: + p2.close() self.compare_prompt(p2, processed, n=n) p2 = copy(i2i) diff --git a/sd_webui/processing.py b/sd_webui/processing.py index fb9999c..c7d3a31 100644 --- a/sd_webui/processing.py +++ b/sd_webui/processing.py @@ -65,6 +65,9 @@ if TYPE_CHECKING: iteration: int = 1 is_hr_pass: bool = False + def close(self) -> None: + pass + @dataclass class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): sampler: Callable | None = None