From 53998d67f11feadfbf2bb545cd0f29b36cc6f4c9 Mon Sep 17 00:00:00 2001 From: Dowon Date: Sat, 20 Jul 2024 17:21:08 +0900 Subject: [PATCH] fix(scripts): revert exif prompt --- scripts/!adetailer.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/scripts/!adetailer.py b/scripts/!adetailer.py index 5b821be..2037b5e 100644 --- a/scripts/!adetailer.py +++ b/scripts/!adetailer.py @@ -616,23 +616,18 @@ class AfterDetailerScript(scripts.Script): i2i.negative_prompt = negative_prompt @staticmethod - def compare_prompt(p, extra_params: dict[str, Any], processed, n: int = 0): - if not hasattr(p, "_ad_extra_params_result"): - p._ad_extra_params_result = {} - + def compare_prompt(extra_params: dict[str, Any], processed, n: int = 0): pt = "ADetailer prompt" + suffix(n) if pt in extra_params and extra_params[pt] != processed.all_prompts[0]: print( f"[-] ADetailer: applied {ordinal(n + 1)} ad_prompt: {processed.all_prompts[0]!r}" ) - p._ad_extra_params_result[pt] = processed.all_prompts[0] ng = "ADetailer negative prompt" + suffix(n) if ng in extra_params and extra_params[ng] != processed.all_negative_prompts[0]: print( f"[-] ADetailer: applied {ordinal(n + 1)} ad_negative_prompt: {processed.all_negative_prompts[0]!r}" ) - p._ad_extra_params_result[ng] = processed.all_negative_prompts[0] @staticmethod def get_i2i_init_image(p, pp): @@ -784,7 +779,7 @@ class AfterDetailerScript(scripts.Script): finally: p2.close() - self.compare_prompt(p, p.extra_generation_params, processed, n=n) + self.compare_prompt(p.extra_generation_params, processed, n=n) p2 = copy(i2i) p2.init_images = [processed.images[0]] @@ -831,9 +826,6 @@ class AfterDetailerScript(scripts.Script): self.write_params_txt(params_txt_content) - if hasattr(p, "_ad_extra_params_result"): - p.extra_generation_params.update(p._ad_extra_params_result) - def on_after_component(component, **_kwargs): global txt2img_submit_button, img2img_submit_button