From 85ebcd98978867d03369863127ec4c70220bc7bd Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Wed, 26 Nov 2025 22:35:03 +0900 Subject: [PATCH] In response to the patch that separates manager_requirements.txt from requirements.txt, this update additionally refreshes manager_requirements.txt when it is present. https://github.com/ltdrdata/ComfyUI/commit/79fb96488aa3842b9799a96e570535c6aed8e963 --- comfyui_manager/glob/manager_core.py | 22 ++++++++++++++++++++++ comfyui_manager/glob/manager_server.py | 2 ++ comfyui_manager/legacy/manager_core.py | 21 +++++++++++++++++++++ comfyui_manager/legacy/manager_server.py | 2 ++ pyproject.toml | 2 +- 5 files changed, 48 insertions(+), 1 deletion(-) diff --git a/comfyui_manager/glob/manager_core.py b/comfyui_manager/glob/manager_core.py index d597c6f7..1951526b 100644 --- a/comfyui_manager/glob/manager_core.py +++ b/comfyui_manager/glob/manager_core.py @@ -1901,6 +1901,27 @@ def execute_install_script(url, repo_path, lazy_mode=False, instant_execution=Fa return True +def install_manager_requirements(repo_path): + """ + Install packages from manager_requirements.txt if it exists. + This is specifically for ComfyUI's manager_requirements.txt. + """ + manager_requirements_path = os.path.join(repo_path, "manager_requirements.txt") + if not os.path.exists(manager_requirements_path): + return + + logging.info("[ComfyUI-Manager] Installing manager_requirements.txt") + with open(manager_requirements_path, "r") as f: + for line in f: + line = line.strip() + if line and not line.startswith('#'): + if '#' in line: + line = line.split('#')[0].strip() + if line: + install_cmd = manager_util.make_pip_cmd(["install", line]) + subprocess.run(install_cmd) + + def git_repo_update_check_with(path, do_fetch=False, do_update=False, no_deps=False): """ @@ -2434,6 +2455,7 @@ def update_to_stable_comfyui(repo_path): else: logging.info(f"[ComfyUI-Manager] Updating ComfyUI: {current_tag} -> {latest_tag}") repo.git.checkout(latest_tag) + execute_install_script("ComfyUI", repo_path, instant_execution=False, no_deps=False) return 'updated', latest_tag except Exception: traceback.print_exc() diff --git a/comfyui_manager/glob/manager_server.py b/comfyui_manager/glob/manager_server.py index 128575de..fd06010e 100644 --- a/comfyui_manager/glob/manager_server.py +++ b/comfyui_manager/glob/manager_server.py @@ -968,6 +968,8 @@ async def task_worker(): logging.error("ComfyUI update failed") return "fail" elif res == "updated": + core.install_manager_requirements(repo_path) + if is_stable: logging.info("ComfyUI is updated to latest stable version.") return "success-stable-" + latest_tag diff --git a/comfyui_manager/legacy/manager_core.py b/comfyui_manager/legacy/manager_core.py index e300f3aa..98e2cc3d 100644 --- a/comfyui_manager/legacy/manager_core.py +++ b/comfyui_manager/legacy/manager_core.py @@ -1913,6 +1913,27 @@ def execute_install_script(url, repo_path, lazy_mode=False, instant_execution=Fa return True +def install_manager_requirements(repo_path): + """ + Install packages from manager_requirements.txt if it exists. + This is specifically for ComfyUI's manager_requirements.txt. + """ + manager_requirements_path = os.path.join(repo_path, "manager_requirements.txt") + if not os.path.exists(manager_requirements_path): + return + + logging.info("[ComfyUI-Manager] Installing manager_requirements.txt") + with open(manager_requirements_path, "r") as f: + for line in f: + line = line.strip() + if line and not line.startswith('#'): + if '#' in line: + line = line.split('#')[0].strip() + if line: + install_cmd = manager_util.make_pip_cmd(["install", line]) + subprocess.run(install_cmd) + + def git_repo_update_check_with(path, do_fetch=False, do_update=False, no_deps=False): """ diff --git a/comfyui_manager/legacy/manager_server.py b/comfyui_manager/legacy/manager_server.py index cadc4bca..3d431427 100644 --- a/comfyui_manager/legacy/manager_server.py +++ b/comfyui_manager/legacy/manager_server.py @@ -561,6 +561,8 @@ async def task_worker(): logging.error("ComfyUI update failed") return "fail" elif res == "updated": + core.install_manager_requirements(repo_path) + if is_stable: logging.info("ComfyUI is updated to latest stable version.") return "success-stable-"+latest_tag diff --git a/pyproject.toml b/pyproject.toml index 81c68881..2dffedba 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.3b2" +version = "4.0.3b3" 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"