Skip to content

Commit

Permalink
Fix xpu Pytorch nightly build from calling optimize which doesn't exi…
Browse files Browse the repository at this point in the history
…st. (#4978)
  • Loading branch information
simonlui authored Sep 19, 2024
1 parent a1e71cf commit de8e8e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion comfy/model_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit de8e8e3

Please sign in to comment.