diff --git a/.ci/manager_windows/install_manager.bat b/.ci/manager_windows/install_manager.bat new file mode 100644 index 000000000000..56dfa1c4598f --- /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 000000000000..db991d984e42 --- /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 fe646a6ed424..42bc59d4343f 100755 --- a/.ci/update_windows/update.py +++ b/.ci/update_windows/update.py @@ -126,6 +126,8 @@ def latest_tag(repo): 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: @@ -152,6 +154,25 @@ def file_size(f): 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 274d7c9486e0..a911d7a57185 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 cece0aeb20b5..1c382477f435 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 ca6d6868af4e..67aaee88f340 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 ed00583b62f2..f6dcd3eb6614 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 c3ba4172161a..366317779fc3 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 4898a424f4fc..02f86eea05a8 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 32611e4affd8..69692e82f93a 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