@@ -244,28 +244,17 @@ async def _install_comfy(self, comfy_dir: Path, network: QNetworkAccessManager,
244244 elif self .backend is ServerBackend .directml :
245245 torch_args = ["numpy<2" , "torch-directml" ]
246246 elif self .backend is ServerBackend .xpu :
247- torch_args = [
248- "torch==2.6.0" ,
249- "torchvision==0.21.0" ,
250- "torchaudio==2.6.0" ,
251- "--index-url" ,
252- "https://download.pytorch.org/whl/xpu" ,
253- ]
247+ torch_args = ["torch==2.6.0" , "torchvision==0.21.0" , "torchaudio==2.6.0" ]
248+ torch_args += ["--index-url" , "https://download.pytorch.org/whl/xpu" ]
254249 await self ._pip_install ("PyTorch" , torch_args , cb )
255250
256251 requirements_txt = Path (__file__ ).parent / "server_requirements.txt"
257252 await self ._pip_install ("ComfyUI" , ["-r" , str (requirements_txt )], cb )
258253
259254 if self .backend is ServerBackend .xpu :
260- await self ._pip_install (
261- "Ipex" ,
262- [
263- "intel-extension-for-pytorch==2.6.10+xpu" ,
264- "--extra-index-url" ,
265- "https://pytorch-extension.intel.com/release-whl/stable/xpu/us/" ,
266- ],
267- cb ,
268- )
255+ idx_url = "https://pytorch-extension.intel.com/release-whl/stable/xpu/us/"
256+ cmd = ["intel-extension-for-pytorch==2.6.10+xpu" , "--extra-index-url" , idx_url ]
257+ await self ._pip_install ("Ipex" , cmd , cb )
269258
270259 requirements_txt = temp_comfy_dir / "requirements.txt"
271260 await self ._pip_install ("ComfyUI" , ["-r" , str (requirements_txt )], cb )
@@ -711,12 +700,12 @@ def can_install(self):
711700
712701 @property
713702 def upgrade_required (self ):
703+ gpu_backends = [ServerBackend .cuda , ServerBackend .directml , ServerBackend .xpu ]
714704 backend_mismatch = (
715705 self ._installed_backend is not None
716706 and self ._installed_backend != self .backend
717- and self .backend in [ServerBackend .cuda , ServerBackend .directml ]
718- and self ._installed_backend
719- in [ServerBackend .cuda , ServerBackend .directml , ServerBackend .cpu ]
707+ and self .backend in gpu_backends
708+ and self ._installed_backend in (gpu_backends + [ServerBackend .cpu ])
720709 )
721710 return (
722711 self .state is not ServerState .not_installed
0 commit comments