From de8e8e3b0d08cc27b3981c97ba45ed3444601d6f Mon Sep 17 00:00:00 2001 From: Simon Lui <502929+simonlui@users.noreply.github.com> Date: Thu, 19 Sep 2024 18:11:42 +0900 Subject: [PATCH] Fix xpu Pytorch nightly build from calling optimize which doesn't exist. (#4978) --- comfy/model_management.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/model_management.py b/comfy/model_management.py index 77c05510e2a..22a584a2e99 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -326,7 +326,7 @@ def model_load(self, lowvram_model_memory=0, force_patch_weights=False): self.model_unload() raise e - if is_intel_xpu() and not args.disable_ipex_optimize and self.real_model is not None: + if is_intel_xpu() and not args.disable_ipex_optimize and 'ipex' in globals() and self.real_model is not None: with torch.no_grad(): self.real_model = ipex.optimize(self.real_model.eval(), inplace=True, graph_mode=True, concat_linear=True)