From 84f8ab407692cc948efe92920b0e8e098fbe348b Mon Sep 17 00:00:00 2001 From: Disty0 Date: Sun, 13 Oct 2024 14:24:55 +0300 Subject: [PATCH] Fix IPEX --- modules/devices.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/devices.py b/modules/devices.py index a572252f0..4658de1eb 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -12,7 +12,7 @@ debug = os.environ.get('SD_DEVICE_DEBUG', None) is not None install_traceback() # traceback handler opts = None # initialized in get_backend to avoid circular import args = None # initialized in get_backend to avoid circular import -cuda_ok = torch.cuda.is_available() +cuda_ok = torch.cuda.is_available() or (hasattr(torch, 'xpu') and torch.xpu.is_available()) inference_context = torch.no_grad cpu = torch.device("cpu")