Skip to content

Commit 935ae15

Browse files
Cleanup.
1 parent e91662e commit 935ae15

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

comfy/model_management.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class CPUState(Enum):
4545
total_vram = 0
4646

4747
xpu_available = False
48+
torch_version = ""
4849
try:
4950
torch_version = torch.version.__version__
5051
xpu_available = (int(torch_version[0]) < 2 or (int(torch_version[0]) == 2 and int(torch_version[2]) <= 4)) and torch.xpu.is_available()

server.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from model_filemanager import download_model, DownloadModelStatus
3131
from typing import Optional
3232
from api_server.routes.internal.internal_routes import InternalRoutes
33-
import torch
3433

3534
class BinaryEventTypes:
3635
PREVIEW_IMAGE = 1
@@ -52,7 +51,7 @@ def get_comfyui_version():
5251
except Exception:
5352
try:
5453
import subprocess
55-
comfyui_version = subprocess.check_output(["git", "describe", "--tags"], cwd=repo_path)
54+
comfyui_version = subprocess.check_output(["git", "describe", "--tags"], cwd=repo_path).decode('utf-8')
5655
except Exception as e:
5756
logging.warning(f"Failed to get ComfyUI version: {e}")
5857
return comfyui_version.strip()
@@ -427,7 +426,7 @@ async def system_stats(request):
427426
"os": os.name,
428427
"comfyui_version": get_comfyui_version(),
429428
"python_version": sys.version,
430-
"pytorch_version": torch.version.__version__,
429+
"pytorch_version": comfy.model_management.torch_version,
431430
"embedded_python": os.path.split(os.path.split(sys.executable)[0])[1] == "python_embeded",
432431
"argv": sys.argv
433432
},

0 commit comments

Comments
 (0)