Skip to content

Commit

Permalink
Fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Aug 23, 2024
1 parent 64ccb3c commit 2c1d237
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions comfy/model_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,15 @@ class CPUState(Enum):

total_vram = 0

torch_version = torch.version.__version__
xpu_available = False
try:
torch_version = torch.version.__version__
xpu_available = int(torch_version[0]) < 2 or (int(torch_version[0]) == 2 and int(torch_version[2]) <= 4)
xpu_available = xpu_available and torch.xpu.is_available()
except:
pass

lowvram_available = True
xpu_available = int(torch_version[0]) < 2 or (int(torch_version[0]) == 2 and int(torch_version[2]) <= 4)

if args.deterministic:
logging.info("Using deterministic algorithms for pytorch")
torch.use_deterministic_algorithms(True, warn_only=True)
Expand Down

0 comments on commit 2c1d237

Please sign in to comment.