Better xformers check

Now relies in the comfy xformers check and can thus be disabled with the command line argument --disable-xformers
This commit is contained in:
kijai
2024-03-25 10:46:36 +02:00
parent 2cd64cdfce
commit 5c54bb1437
3 changed files with 14 additions and 31 deletions
+9 -9
View File
@@ -66,20 +66,20 @@ import torch
import torch.version
import torch.nn.functional as F
from einops import rearrange
#from diffusers.utils.import_utils import is_xformers_available
#import SUPIR.utils.devices as devices
import comfy.model_management
device = comfy.model_management.get_torch_device()
try:
import xformers
import xformers.ops
XFORMERS_IS_AVAILABLE = True
except:
if comfy.model_management.XFORMERS_IS_AVAILABLE:
try:
import xformers
import xformers.ops
XFORMERS_IS_AVAILABLE = True
except:
XFORMERS_IS_AVAILABLE = False
print("no module 'xformers'. Processing without...")
else:
XFORMERS_IS_AVAILABLE = False
print("no module 'xformers'. Processing without...")
sd_flag = True