Skip to content

Commit

Permalink
Update sd_hijack.py
Browse files Browse the repository at this point in the history
  • Loading branch information
C43H66N12O12S2 authored and AUTOMATIC1111 committed Oct 15, 2022
1 parent 09814e3 commit 529afbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/sd_hijack.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def apply_optimizations():

ldm.modules.diffusionmodules.model.nonlinearity = silu

if cmd_opts.force_enable_xformers or (cmd_opts.xformers and shared.xformers_available and torch.version.cuda and (6, 0) <= torch.cuda.get_device_capability(shared.device) <= (8, 6)):
if cmd_opts.force_enable_xformers or (cmd_opts.xformers and shared.xformers_available and torch.version.cuda and (6, 0) <= torch.cuda.get_device_capability(shared.device) <= (9, 0)):
print("Applying xformers cross attention optimization.")
ldm.modules.attention.CrossAttention.forward = sd_hijack_optimizations.xformers_attention_forward
ldm.modules.diffusionmodules.model.AttnBlock.forward = sd_hijack_optimizations.xformers_attnblock_forward
Expand Down

0 comments on commit 529afbf

Please sign in to comment.