Include ComfyUI version

This commit is contained in:
pythongosssss 2024-08-28 18:46:32 +01:00
parent d86f59ced1
commit 945c1cdf7a

View File

@ -406,9 +406,25 @@ class PromptServer():
device_name = comfy.model_management.get_torch_device_name(device)
vram_total, torch_vram_total = comfy.model_management.get_total_memory(device, torch_total_too=True)
vram_free, torch_vram_free = comfy.model_management.get_free_memory(device, torch_free_too=True)
comfyui_version = "unknown"
try:
import pygit2
repo_path = os.path.dirname(os.path.realpath(__file__))
repo = pygit2.Repository(repo_path)
comfyui_version = repo.describe(describe_strategy=pygit2.GIT_DESCRIBE_TAGS)
except Exception:
try:
import subprocess
comfyui_version = subprocess.check_output(["git", "describe", "--tags"], cwd=repo_path)
except Exception:
pass
system_stats = {
"system": {
"os": os.name,
"comfyui_version": comfyui_version.strip(),
"python_version": sys.version,
"pytorch_version": torch.version.__version__,
"embedded_python": os.path.split(os.path.split(sys.executable)[0])[1] == "python_embeded",