From 04fa540a8c09d890147fe158090d813be8d05d40 Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Sat, 8 Mar 2025 10:15:23 +0900 Subject: [PATCH] fixed: crash on desktop version when displaying to print version information --- glob/manager_core.py | 4 ++-- glob/manager_server.py | 27 ++++++++++++++------------- pyproject.toml | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/glob/manager_core.py b/glob/manager_core.py index 58bcf084..6b71fc28 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -43,7 +43,7 @@ import manager_downloader from node_package import InstalledNodePackage -version_code = [3, 30, 2] +version_code = [3, 30, 3] version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '') @@ -75,8 +75,8 @@ def get_custom_nodes_paths(): def get_comfyui_tag(): - repo = git.Repo(comfy_path) try: + repo = git.Repo(comfy_path) return repo.git.describe('--tags') except: return None diff --git a/glob/manager_server.py b/glob/manager_server.py index e2b2096d..392d8424 100644 --- a/glob/manager_server.py +++ b/glob/manager_server.py @@ -1545,26 +1545,27 @@ async def get_notice(request): if match: markdown_content = match.group(1) - version_tag = core.get_comfyui_tag() - if version_tag is None: - version_tag = os.environ.get('__COMFYUI_DESKTOP_VERSION__') - if version_tag is not None: - markdown_content += f"
ComfyUI: {version_tag} [Desktop]" - else: - markdown_content += f"
ComfyUI: {core.comfy_ui_revision}[{comfy_ui_hash[:6]}]({core.comfy_ui_commit_datetime.date()})" + version_tag = os.environ.get('__COMFYUI_DESKTOP_VERSION__') + if version_tag is not None: + markdown_content += f"
ComfyUI: {version_tag} [Desktop]" else: - markdown_content += (f"
ComfyUI: {version_tag}
" - f"         ({core.comfy_ui_commit_datetime.date()})") + version_tag = core.get_comfyui_tag() + if version_tag is None: + markdown_content += f"
ComfyUI: {core.comfy_ui_revision}[{comfy_ui_hash[:6]}]({core.comfy_ui_commit_datetime.date()})" + else: + markdown_content += (f"
ComfyUI: {version_tag}
" + f"         ({core.comfy_ui_commit_datetime.date()})") # markdown_content += f"
         ()" markdown_content += f"
Manager: {core.version_str}" markdown_content = add_target_blank(markdown_content) try: - if core.comfy_ui_commit_datetime == datetime(1900, 1, 1, 0, 0, 0): - markdown_content = '

Your ComfyUI isn\'t git repo.

' + markdown_content - elif core.comfy_ui_required_commit_datetime.date() > core.comfy_ui_commit_datetime.date(): - markdown_content = '

Your ComfyUI is too OUTDATED!!!

' + markdown_content + if '__COMFYUI_DESKTOP_VERSION__' not in os.environ: + if core.comfy_ui_commit_datetime == datetime(1900, 1, 1, 0, 0, 0): + markdown_content = '

Your ComfyUI isn\'t git repo.

' + markdown_content + elif core.comfy_ui_required_commit_datetime.date() > core.comfy_ui_commit_datetime.date(): + markdown_content = '

Your ComfyUI is too OUTDATED!!!

' + markdown_content except: pass diff --git a/pyproject.toml b/pyproject.toml index 763e29d2..cf15c026 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-manager" description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI." -version = "3.30.2" +version = "3.30.3" license = { file = "LICENSE.txt" } dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions", "toml", "uv", "chardet"]