From 2c1d2375d6bc62b6095e0b8c1b31df1112ec2ea2 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Fri, 23 Aug 2024 04:04:55 -0400 Subject: [PATCH] Fix. --- comfy/model_management.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/comfy/model_management.py b/comfy/model_management.py index c86b67e..fd39790 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -44,11 +44,15 @@ cpu_state = CPUState.GPU 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)