mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-17 02:12:58 +08:00
FIXED: robust ComfyUI path recognition
FIXED: robust import even if prestartup is failed IMPROVE: show version tag of ComfyUI instead of revision
This commit is contained in:
parent
a7af3c1bd4
commit
8593a7206b
@ -1,10 +1,12 @@
|
|||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
cli_mode_flag = os.path.join(os.path.dirname(__file__), '.enable-cli-only-mode')
|
cli_mode_flag = os.path.join(os.path.dirname(__file__), '.enable-cli-only-mode')
|
||||||
|
|
||||||
if not os.path.exists(cli_mode_flag):
|
if not os.path.exists(cli_mode_flag):
|
||||||
from .glob import manager_server
|
sys.path.append(os.path.join(os.path.dirname(__file__), "glob"))
|
||||||
from .glob import share_3rdparty
|
import manager_server
|
||||||
|
import share_3rdparty
|
||||||
WEB_DIRECTORY = "js"
|
WEB_DIRECTORY = "js"
|
||||||
else:
|
else:
|
||||||
print(f"\n[ComfyUI-Manager] !! cli-only-mode is enabled !!\n")
|
print(f"\n[ComfyUI-Manager] !! cli-only-mode is enabled !!\n")
|
||||||
|
|||||||
@ -23,7 +23,7 @@ sys.path.append(glob_path)
|
|||||||
import cm_global
|
import cm_global
|
||||||
from manager_util import *
|
from manager_util import *
|
||||||
|
|
||||||
version = [2, 54]
|
version = [2, 55]
|
||||||
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
|
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
|
||||||
|
|
||||||
|
|
||||||
@ -52,8 +52,20 @@ def get_custom_nodes_paths():
|
|||||||
return [custom_nodes_path]
|
return [custom_nodes_path]
|
||||||
|
|
||||||
|
|
||||||
|
def get_comfyui_tag():
|
||||||
|
repo = git.Repo(comfy_path)
|
||||||
|
try:
|
||||||
|
return repo.git.describe('--tags')
|
||||||
|
except:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
comfy_path = os.environ.get('COMFYUI_PATH')
|
comfy_path = os.environ.get('COMFYUI_PATH')
|
||||||
if comfy_path is None:
|
if comfy_path is None:
|
||||||
|
try:
|
||||||
|
import folder_paths
|
||||||
|
comfy_path = os.path.join(os.path.dirname(folder_paths.__file__))
|
||||||
|
except:
|
||||||
comfy_path = os.path.abspath(os.path.join(custom_nodes_path, '..'))
|
comfy_path = os.path.abspath(os.path.join(custom_nodes_path, '..'))
|
||||||
|
|
||||||
channel_list_path = os.path.join(comfyui_manager_path, 'channels.list')
|
channel_list_path = os.path.join(comfyui_manager_path, 'channels.list')
|
||||||
|
|||||||
@ -181,7 +181,7 @@ def print_comfyui_version():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if core.comfy_ui_commit_datetime.date() < core.comfy_ui_required_commit_datetime.date():
|
if core.comfy_ui_commit_datetime.date() < core.comfy_ui_required_commit_datetime.date():
|
||||||
print(f"\n\n## [WARN] ComfyUI-Manager: Your ComfyUI version ({core.comfy_ui_revision})[{core.comfy_ui_commit_datetime.date()}] is too old. Please update to the latest version. ##\n\n")
|
print(f"\n\n## [WARN] ComfyUI-Manager: Your ComfyUI version ({core.get_comfyui_tag()})[{core.comfy_ui_commit_datetime.date()}] is too old. Please update to the latest version. ##\n\n")
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -200,7 +200,11 @@ def print_comfyui_version():
|
|||||||
# <--
|
# <--
|
||||||
|
|
||||||
if current_branch == "master":
|
if current_branch == "master":
|
||||||
|
version_tag = core.get_comfyui_tag()
|
||||||
|
if version_tag is None:
|
||||||
print(f"### ComfyUI Revision: {core.comfy_ui_revision} [{comfy_ui_hash[:8]}] | Released on '{core.comfy_ui_commit_datetime.date()}'")
|
print(f"### ComfyUI Revision: {core.comfy_ui_revision} [{comfy_ui_hash[:8]}] | Released on '{core.comfy_ui_commit_datetime.date()}'")
|
||||||
|
else:
|
||||||
|
print(f"### ComfyUI Version: {core.get_comfyui_tag()} | Released on '{core.comfy_ui_commit_datetime.date()}'")
|
||||||
else:
|
else:
|
||||||
print(f"### ComfyUI Revision: {core.comfy_ui_revision} on '{current_branch}' [{comfy_ui_hash[:8]}] | Released on '{core.comfy_ui_commit_datetime.date()}'")
|
print(f"### ComfyUI Revision: {core.comfy_ui_revision} on '{current_branch}' [{comfy_ui_hash[:8]}] | Released on '{core.comfy_ui_commit_datetime.date()}'")
|
||||||
except:
|
except:
|
||||||
@ -1203,14 +1207,21 @@ async def get_notice(request):
|
|||||||
|
|
||||||
if match:
|
if match:
|
||||||
markdown_content = match.group(1)
|
markdown_content = match.group(1)
|
||||||
|
version_tag = core.get_comfyui_tag()
|
||||||
|
if version_tag is None:
|
||||||
markdown_content += f"<HR>ComfyUI: {core.comfy_ui_revision}[{comfy_ui_hash[:6]}]({core.comfy_ui_commit_datetime.date()})"
|
markdown_content += f"<HR>ComfyUI: {core.comfy_ui_revision}[{comfy_ui_hash[:6]}]({core.comfy_ui_commit_datetime.date()})"
|
||||||
|
else:
|
||||||
|
markdown_content += (f"<HR>ComfyUI: {version_tag}<BR>"
|
||||||
|
f" ({core.comfy_ui_commit_datetime.date()})")
|
||||||
# markdown_content += f"<BR> ()"
|
# markdown_content += f"<BR> ()"
|
||||||
markdown_content += f"<BR>Manager: {core.version_str}"
|
markdown_content += f"<BR>Manager: {core.version_str}"
|
||||||
|
|
||||||
markdown_content = add_target_blank(markdown_content)
|
markdown_content = add_target_blank(markdown_content)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if core.comfy_ui_required_commit_datetime.date() > core.comfy_ui_commit_datetime.date():
|
if core.comfy_ui_commit_datetime == datetime(1900, 1, 1, 0, 0, 0):
|
||||||
|
markdown_content = f'<P style="text-align: center; color:red; background-color:white; font-weight:bold">Your ComfyUI isn\'t git repo.</P>' + markdown_content
|
||||||
|
elif core.comfy_ui_required_commit_datetime.date() > core.comfy_ui_commit_datetime.date():
|
||||||
markdown_content = f'<P style="text-align: center; color:red; background-color:white; font-weight:bold">Your ComfyUI is too OUTDATED!!!</P>' + markdown_content
|
markdown_content = f'<P style="text-align: center; color:red; background-color:white; font-weight:bold">Your ComfyUI is too OUTDATED!!!</P>' + markdown_content
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "comfyui-manager"
|
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."
|
description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI."
|
||||||
version = "2.54"
|
version = "2.55"
|
||||||
license = { file = "LICENSE.txt" }
|
license = { file = "LICENSE.txt" }
|
||||||
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]
|
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user