From d7799964decaefe52f58f5a4b55d4128499fb70e Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Sat, 6 Sep 2025 03:35:43 +0900 Subject: [PATCH] =?UTF-8?q?fixed:=20Issue=20where=20an=20invalid=20channel?= =?UTF-8?q?=20exception=20occurred=20when=20using=20the=20default=20channe?= =?UTF-8?q?l=20-=20Mismatch=20issue=20between=20ltdrdata/=20and=20Comfy-Or?= =?UTF-8?q?g/=20modified:=20/v2/customnode/installed=20=E2=80=93=20cnr=5Fi?= =?UTF-8?q?d=20was=20being=20returned=20in=20a=20normalized=20form=20modif?= =?UTF-8?q?ied:=20/v2/customnode/installed=20=E2=80=93=20when=20both=20an?= =?UTF-8?q?=20enabled=20nodepack=20and=20a=20disabled=20nodepack=20existed?= =?UTF-8?q?,=20modified=20to=20report=20only=20the=20enabled=20nodepack=20?= =?UTF-8?q?fixed:=20Removed=20unnecessary=20warning=20messages=20printed?= =?UTF-8?q?=20during=20nodepack=20installation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comfyui_manager/common/cnr_utils.py | 2 ++ comfyui_manager/glob/manager_core.py | 26 +++++++----------------- comfyui_manager/legacy/manager_core.py | 3 ++- comfyui_manager/legacy/manager_server.py | 13 +++++++----- pyproject.toml | 2 +- 5 files changed, 20 insertions(+), 26 deletions(-) diff --git a/comfyui_manager/common/cnr_utils.py b/comfyui_manager/common/cnr_utils.py index 1cdb8472..c723020b 100644 --- a/comfyui_manager/common/cnr_utils.py +++ b/comfyui_manager/common/cnr_utils.py @@ -211,6 +211,7 @@ def read_cnr_info(fullpath): project = data.get('project', {}) name = project.get('name').strip().lower() + original_name = project.get('name') # normalize version # for example: 2.5 -> 2.5.0 @@ -222,6 +223,7 @@ def read_cnr_info(fullpath): if name and version: # repository is optional return { "id": name, + "original_name": original_name, "version": version, "url": repository } diff --git a/comfyui_manager/glob/manager_core.py b/comfyui_manager/glob/manager_core.py index 1aa262e2..c3318568 100644 --- a/comfyui_manager/glob/manager_core.py +++ b/comfyui_manager/glob/manager_core.py @@ -46,6 +46,7 @@ version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' i DEFAULT_CHANNEL = "https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main" +DEFAULT_CHANNEL_LEGACY = "https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main" default_custom_nodes_path = None @@ -153,14 +154,8 @@ def check_invalid_nodes(): cached_config = None js_path = None -comfy_ui_required_revision = 1930 -comfy_ui_required_commit_datetime = datetime(2024, 1, 24, 0, 0, 0) - -comfy_ui_revision = "Unknown" -comfy_ui_commit_datetime = datetime(1900, 1, 1, 0, 0, 0) - channel_dict = None -valid_channels = {'default', 'local'} +valid_channels = {'default', 'local', DEFAULT_CHANNEL, DEFAULT_CHANNEL_LEGACY} channel_list = None @@ -1479,7 +1474,7 @@ def identify_node_pack_from_path(fullpath): # cnr cnr = cnr_utils.read_cnr_info(fullpath) if cnr is not None: - return module_name, cnr['version'], cnr['id'], None + return module_name, cnr['version'], cnr['original_name'], None return None else: @@ -1529,7 +1524,10 @@ def get_installed_node_packs(): if info is None: continue - res[info[0]] = { 'ver': info[1], 'cnr_id': info[2], 'aux_id': info[3], 'enabled': False } + # NOTE: don't add disabled nodepack if there is enabled nodepack + original_name = info[0].split('@')[0] + if original_name not in res: + res[info[0]] = { 'ver': info[1], 'cnr_id': info[2], 'aux_id': info[3], 'enabled': False } return res @@ -1786,16 +1784,6 @@ def try_install_script(url, repo_path, install_cmd, instant_execution=False): print(f"\n## ComfyUI-Manager: EXECUTE => {install_cmd}") code = manager_funcs.run_script(install_cmd, cwd=repo_path) - if platform.system() != "Windows": - try: - if not os.environ.get('__COMFYUI_DESKTOP_VERSION__') and comfy_ui_commit_datetime.date() < comfy_ui_required_commit_datetime.date(): - print("\n\n###################################################################") - print(f"[WARN] ComfyUI-Manager: Your ComfyUI version ({comfy_ui_revision})[{comfy_ui_commit_datetime.date()}] is too old. Please update to the latest version.") - print("[WARN] The extension installation feature may not work properly in the current installed ComfyUI version on Windows environment.") - print("###################################################################\n\n") - except Exception: - pass - if code != 0: if url is None: url = os.path.dirname(repo_path) diff --git a/comfyui_manager/legacy/manager_core.py b/comfyui_manager/legacy/manager_core.py index 52b47251..3d7790a6 100644 --- a/comfyui_manager/legacy/manager_core.py +++ b/comfyui_manager/legacy/manager_core.py @@ -46,6 +46,7 @@ version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' i DEFAULT_CHANNEL = "https://raw.githubusercontent.com/Comfy-Org/ComfyUI-Manager/main" +DEFAULT_CHANNEL_LEGACY = "https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main" default_custom_nodes_path = None @@ -160,7 +161,7 @@ comfy_ui_revision = "Unknown" comfy_ui_commit_datetime = datetime(1900, 1, 1, 0, 0, 0) channel_dict = None -valid_channels = {'default', 'local'} +valid_channels = {'default', 'local', DEFAULT_CHANNEL, DEFAULT_CHANNEL_LEGACY} channel_list = None diff --git a/comfyui_manager/legacy/manager_server.py b/comfyui_manager/legacy/manager_server.py index 8af46ff7..cadc4bca 100644 --- a/comfyui_manager/legacy/manager_server.py +++ b/comfyui_manager/legacy/manager_server.py @@ -1072,12 +1072,15 @@ async def fetch_customnode_list(request): if channel != 'local': found = 'custom' - for name, url in core.get_channel_dict().items(): - if url == channel: - found = name - break + if channel == core.DEFAULT_CHANNEL or channel == core.DEFAULT_CHANNEL_LEGACY: + channel = 'default' + else: + for name, url in core.get_channel_dict().items(): + if url == channel: + found = name + break - channel = found + channel = found result = dict(channel=channel, node_packs=node_packs.to_dict()) diff --git a/pyproject.toml b/pyproject.toml index f531c39e..47608333 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "comfyui-manager" license = { text = "GPL-3.0-only" } -version = "4.0.1-beta.4" +version = "4.0.1-beta.5" requires-python = ">= 3.9" description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI." readme = "README.md"