Skip to content

Commit

Permalink
change schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
lllyasviel committed Aug 23, 2023
1 parent 172a0c3 commit ae0c282
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ae0c282

Please sign in to comment.