Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Fix xpu Pytorch nightly build from calling optimize which doesn't exist. (#4978)

Simon Luide8e8e3b0d08
diff --git a/comfy/model_management.py b/comfy/model_management.py
index 77c05510e..22a584a2e 100644
--- a/comfy/model_management.py
+++ b/comfy/model_management.py
@@ -326,7 +326,7 @@ class LoadedModel:
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)