mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
disable xformers if cuda not available
This commit is contained in:
parent
d69156c616
commit
65a7432b5a
@ -205,7 +205,7 @@ class Generate:
|
||||
Globals.full_precision = self.precision=='float32'
|
||||
|
||||
if is_xformers_available():
|
||||
if not Globals.disable_xformers:
|
||||
if torch.cuda.is_available() and not Globals.disable_xformers:
|
||||
print('>> xformers memory-efficient attention is available and enabled')
|
||||
else:
|
||||
print('>> xformers memory-efficient attention is available but disabled')
|
||||
|
@ -308,7 +308,7 @@ class StableDiffusionGeneratorPipeline(StableDiffusionPipeline):
|
||||
"""
|
||||
if xformers is available, use it, otherwise use sliced attention.
|
||||
"""
|
||||
if is_xformers_available() and not Globals.disable_xformers:
|
||||
if torch.cuda.is_available() and is_xformers_available() and not Globals.disable_xformers:
|
||||
self.enable_xformers_memory_efficient_attention()
|
||||
else:
|
||||
if torch.backends.mps.is_available():
|
||||
|
Loading…
Reference in New Issue
Block a user