From f19a2b53f41fd99956031c9775df95aada38ede7 Mon Sep 17 00:00:00 2001 From: Jedrzej Kosinski Date: Wed, 26 Nov 2025 16:42:29 -0800 Subject: [PATCH] Create install_manager scripts, make update.py attempt to update comfyui_manager package if already installed, add --enable-manager startup arg to all run scripts --- .ci/manager_windows/install_manager.bat | 4 ++++ .ci/manager_windows/install_manager.py | 24 +++++++++++++++++++ .ci/update_windows/update.py | 21 ++++++++++++++++ .ci/windows_amd_base_files/run_amd_gpu.bat | 2 +- .../run_amd_gpu_disable_smart_memory.bat | 2 +- .../run_nvidia_gpu_fast.bat | 2 +- .../run_nvidia_gpu_disable_api_nodes.bat | 2 +- .ci/windows_nvidia_base_files/run_cpu.bat | 2 +- .../run_nvidia_gpu.bat | 2 +- .../run_nvidia_gpu_fast_fp16_accumulation.bat | 2 +- 10 files changed, 56 insertions(+), 7 deletions(-) create mode 100644 .ci/manager_windows/install_manager.bat create mode 100644 .ci/manager_windows/install_manager.py diff --git a/.ci/manager_windows/install_manager.bat b/.ci/manager_windows/install_manager.bat new file mode 100644 index 000000000..56dfa1c45 --- /dev/null +++ b/.ci/manager_windows/install_manager.bat @@ -0,0 +1,4 @@ +@echo off +..\python_embeded\python.exe .\install_manager.py ..\ComfyUI\ +echo Installed manager through pip package, if not already installed. +pause \ No newline at end of file diff --git a/.ci/manager_windows/install_manager.py b/.ci/manager_windows/install_manager.py new file mode 100644 index 000000000..db991d984 --- /dev/null +++ b/.ci/manager_windows/install_manager.py @@ -0,0 +1,24 @@ +import sys +import os + +repo_path = str(sys.argv[1]) +repo_manager_req_path = os.path.join(repo_path, "manager_requirements.txt") + +if os.path.exists(repo_manager_req_path): + import subprocess + # if not installed, we get 'WARNING: Package(s) not found: comfyui_manager' + # if installed, there will be a line like 'Version: 0.1.0' = False + try: + output = subprocess.check_output([sys.executable, '-s', '-m', 'pip', 'show', 'comfyui_manager']) + if 'Version:' in output.decode('utf-8'): + print("comfyui_manager is already installed, will attempt to update to matching version of ComfyUI.") # noqa: T201 + else: + print("comfyui_manager is not installed, will install it now.") # noqa: T201 + except: + pass + + try: + subprocess.check_call([sys.executable, '-s', '-m', 'pip', 'install', '-r', repo_manager_req_path]) + print("comfyui_manager installed successfully.") # noqa: T201 + except: + print("Failed to install comfyui_manager, please install it manually.") # noqa: T201 diff --git a/.ci/update_windows/update.py b/.ci/update_windows/update.py index 51a263203..4a202786d 100755 --- a/.ci/update_windows/update.py +++ b/.ci/update_windows/update.py @@ -114,6 +114,8 @@ cur_path = os.path.dirname(update_py_path) req_path = os.path.join(cur_path, "current_requirements.txt") repo_req_path = os.path.join(repo_path, "requirements.txt") +manager_req_path = os.path.join(cur_path, "current_manager_requirements.txt") +repo_manager_req_path = os.path.join(repo_path, "manager_requirements.txt") def files_equal(file1, file2): try: @@ -140,6 +142,25 @@ if not os.path.exists(req_path) or not files_equal(repo_req_path, req_path): except: pass +if os.path.exists(repo_manager_req_path) and (not os.path.exists(manager_req_path) or not files_equal(repo_manager_req_path, manager_req_path)): + import subprocess + # first, confirm that comfyui_manager package is installed; only update it if it is + # if not installed, we get 'WARNING: Package(s) not found: comfyui_manager' + # if installed, there will be a line like 'Version: 0.1.0' + update_manager = False + try: + output = subprocess.check_output([sys.executable, '-s', '-m', 'pip', 'show', 'comfyui_manager']) + if 'Version:' in output.decode('utf-8'): + update_manager = True + except: + pass + + if update_manager: + try: + subprocess.check_call([sys.executable, '-s', '-m', 'pip', 'install', '-r', repo_manager_req_path]) + shutil.copy(repo_manager_req_path, manager_req_path) + except: + pass stable_update_script = os.path.join(repo_path, ".ci/update_windows/update_comfyui_stable.bat") stable_update_script_to = os.path.join(cur_path, "update_comfyui_stable.bat") diff --git a/.ci/windows_amd_base_files/run_amd_gpu.bat b/.ci/windows_amd_base_files/run_amd_gpu.bat index 274d7c948..a911d7a57 100755 --- a/.ci/windows_amd_base_files/run_amd_gpu.bat +++ b/.ci/windows_amd_base_files/run_amd_gpu.bat @@ -1,2 +1,2 @@ -.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build +.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --enable-manager pause diff --git a/.ci/windows_amd_base_files/run_amd_gpu_disable_smart_memory.bat b/.ci/windows_amd_base_files/run_amd_gpu_disable_smart_memory.bat index cece0aeb2..1c382477f 100755 --- a/.ci/windows_amd_base_files/run_amd_gpu_disable_smart_memory.bat +++ b/.ci/windows_amd_base_files/run_amd_gpu_disable_smart_memory.bat @@ -1,2 +1,2 @@ -.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --disable-smart-memory +.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --enable-manager --disable-smart-memory pause diff --git a/.ci/windows_nightly_base_files/run_nvidia_gpu_fast.bat b/.ci/windows_nightly_base_files/run_nvidia_gpu_fast.bat index ca6d6868a..67aaee88f 100644 --- a/.ci/windows_nightly_base_files/run_nvidia_gpu_fast.bat +++ b/.ci/windows_nightly_base_files/run_nvidia_gpu_fast.bat @@ -1,2 +1,2 @@ -.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --fast +.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --enable-manager --fast pause diff --git a/.ci/windows_nvidia_base_files/advanced/run_nvidia_gpu_disable_api_nodes.bat b/.ci/windows_nvidia_base_files/advanced/run_nvidia_gpu_disable_api_nodes.bat index ed00583b6..f6dcd3eb6 100644 --- a/.ci/windows_nvidia_base_files/advanced/run_nvidia_gpu_disable_api_nodes.bat +++ b/.ci/windows_nvidia_base_files/advanced/run_nvidia_gpu_disable_api_nodes.bat @@ -1,3 +1,3 @@ -..\python_embeded\python.exe -s ..\ComfyUI\main.py --windows-standalone-build --disable-api-nodes +..\python_embeded\python.exe -s ..\ComfyUI\main.py --windows-standalone-build --enable-manager --disable-api-nodes echo If you see this and ComfyUI did not start try updating your Nvidia Drivers to the latest. pause diff --git a/.ci/windows_nvidia_base_files/run_cpu.bat b/.ci/windows_nvidia_base_files/run_cpu.bat index c3ba41721..366317779 100755 --- a/.ci/windows_nvidia_base_files/run_cpu.bat +++ b/.ci/windows_nvidia_base_files/run_cpu.bat @@ -1,2 +1,2 @@ -.\python_embeded\python.exe -s ComfyUI\main.py --cpu --windows-standalone-build +.\python_embeded\python.exe -s ComfyUI\main.py --cpu --windows-standalone-build --enable-manager pause diff --git a/.ci/windows_nvidia_base_files/run_nvidia_gpu.bat b/.ci/windows_nvidia_base_files/run_nvidia_gpu.bat index 4898a424f..02f86eea0 100755 --- a/.ci/windows_nvidia_base_files/run_nvidia_gpu.bat +++ b/.ci/windows_nvidia_base_files/run_nvidia_gpu.bat @@ -1,3 +1,3 @@ -.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build +.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --enable-manager echo If you see this and ComfyUI did not start try updating your Nvidia Drivers to the latest. pause diff --git a/.ci/windows_nvidia_base_files/run_nvidia_gpu_fast_fp16_accumulation.bat b/.ci/windows_nvidia_base_files/run_nvidia_gpu_fast_fp16_accumulation.bat index 32611e4af..69692e82f 100644 --- a/.ci/windows_nvidia_base_files/run_nvidia_gpu_fast_fp16_accumulation.bat +++ b/.ci/windows_nvidia_base_files/run_nvidia_gpu_fast_fp16_accumulation.bat @@ -1,3 +1,3 @@ -.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --fast fp16_accumulation +.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --enable-manager --fast fp16_accumulation echo If you see this and ComfyUI did not start try updating your Nvidia Drivers to the latest. pause