From ae0c282486ee0ca83549251fb814eba38541d7eb Mon Sep 17 00:00:00 2001 From: lvmin Date: Wed, 23 Aug 2023 02:21:13 -0700 Subject: [PATCH] change schedule --- scripts/hook.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/hook.py b/scripts/hook.py index b81506b28..7ef28af1d 100644 --- a/scripts/hook.py +++ b/scripts/hook.py @@ -615,6 +615,12 @@ def forward(self, x, timesteps=None, context=None, y=None, **kwargs): outer.current_style_fidelity = float(param.preprocessor['threshold_a']) outer.current_style_fidelity = max(0.0, min(1.0, outer.current_style_fidelity)) + if is_sdxl: + # sdxl's attention hacking is highly unstable. + # We have no other methods but to reduce the style_fidelity a bit. + # By default, 0.5 ** 3.0 = 0.125 + outer.current_style_fidelity = outer.current_style_fidelity ** 3.0 + if param.cfg_injection: outer.current_style_fidelity = 1.0 elif param.soft_injection or is_in_high_res_fix: