Skip to content

Commit f19a2b5

Browse files
committed
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
1 parent 7cf52dd commit f19a2b5

File tree

10 files changed

+56
-7
lines changed

10 files changed

+56
-7
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@echo off
2+
..\python_embeded\python.exe .\install_manager.py ..\ComfyUI\
3+
echo Installed manager through pip package, if not already installed.
4+
pause
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import sys
2+
import os
3+
4+
repo_path = str(sys.argv[1])
5+
repo_manager_req_path = os.path.join(repo_path, "manager_requirements.txt")
6+
7+
if os.path.exists(repo_manager_req_path):
8+
import subprocess
9+
# if not installed, we get 'WARNING: Package(s) not found: comfyui_manager'
10+
# if installed, there will be a line like 'Version: 0.1.0' = False
11+
try:
12+
output = subprocess.check_output([sys.executable, '-s', '-m', 'pip', 'show', 'comfyui_manager'])
13+
if 'Version:' in output.decode('utf-8'):
14+
print("comfyui_manager is already installed, will attempt to update to matching version of ComfyUI.") # noqa: T201
15+
else:
16+
print("comfyui_manager is not installed, will install it now.") # noqa: T201
17+
except:
18+
pass
19+
20+
try:
21+
subprocess.check_call([sys.executable, '-s', '-m', 'pip', 'install', '-r', repo_manager_req_path])
22+
print("comfyui_manager installed successfully.") # noqa: T201
23+
except:
24+
print("Failed to install comfyui_manager, please install it manually.") # noqa: T201

.ci/update_windows/update.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ def latest_tag(repo):
114114
req_path = os.path.join(cur_path, "current_requirements.txt")
115115
repo_req_path = os.path.join(repo_path, "requirements.txt")
116116

117+
manager_req_path = os.path.join(cur_path, "current_manager_requirements.txt")
118+
repo_manager_req_path = os.path.join(repo_path, "manager_requirements.txt")
117119

118120
def files_equal(file1, file2):
119121
try:
@@ -140,6 +142,25 @@ def file_size(f):
140142
except:
141143
pass
142144

145+
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)):
146+
import subprocess
147+
# first, confirm that comfyui_manager package is installed; only update it if it is
148+
# if not installed, we get 'WARNING: Package(s) not found: comfyui_manager'
149+
# if installed, there will be a line like 'Version: 0.1.0'
150+
update_manager = False
151+
try:
152+
output = subprocess.check_output([sys.executable, '-s', '-m', 'pip', 'show', 'comfyui_manager'])
153+
if 'Version:' in output.decode('utf-8'):
154+
update_manager = True
155+
except:
156+
pass
157+
158+
if update_manager:
159+
try:
160+
subprocess.check_call([sys.executable, '-s', '-m', 'pip', 'install', '-r', repo_manager_req_path])
161+
shutil.copy(repo_manager_req_path, manager_req_path)
162+
except:
163+
pass
143164

144165
stable_update_script = os.path.join(repo_path, ".ci/update_windows/update_comfyui_stable.bat")
145166
stable_update_script_to = os.path.join(cur_path, "update_comfyui_stable.bat")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build
1+
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --enable-manager
22
pause
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --disable-smart-memory
1+
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --enable-manager --disable-smart-memory
22
pause
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --fast
1+
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --enable-manager --fast
22
pause
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
..\python_embeded\python.exe -s ..\ComfyUI\main.py --windows-standalone-build --disable-api-nodes
1+
..\python_embeded\python.exe -s ..\ComfyUI\main.py --windows-standalone-build --enable-manager --disable-api-nodes
22
echo If you see this and ComfyUI did not start try updating your Nvidia Drivers to the latest.
33
pause
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
.\python_embeded\python.exe -s ComfyUI\main.py --cpu --windows-standalone-build
1+
.\python_embeded\python.exe -s ComfyUI\main.py --cpu --windows-standalone-build --enable-manager
22
pause
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build
1+
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --enable-manager
22
echo If you see this and ComfyUI did not start try updating your Nvidia Drivers to the latest.
33
pause
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --fast fp16_accumulation
1+
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --enable-manager --fast fp16_accumulation
22
echo If you see this and ComfyUI did not start try updating your Nvidia Drivers to the latest.
33
pause

0 commit comments

Comments
 (0)