Upload ComfyUI/new_updater.py with huggingface_hub
Browse files- ComfyUI/new_updater.py +35 -0
ComfyUI/new_updater.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import shutil
|
| 3 |
+
|
| 4 |
+
base_path = os.path.dirname(os.path.realpath(__file__))
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def update_windows_updater():
|
| 8 |
+
top_path = os.path.dirname(base_path)
|
| 9 |
+
updater_path = os.path.join(base_path, ".ci/update_windows/update.py")
|
| 10 |
+
bat_path = os.path.join(base_path, ".ci/update_windows/update_comfyui.bat")
|
| 11 |
+
|
| 12 |
+
dest_updater_path = os.path.join(top_path, "update/update.py")
|
| 13 |
+
dest_bat_path = os.path.join(top_path, "update/update_comfyui.bat")
|
| 14 |
+
dest_bat_deps_path = os.path.join(top_path, "update/update_comfyui_and_python_dependencies.bat")
|
| 15 |
+
|
| 16 |
+
try:
|
| 17 |
+
with open(dest_bat_path, 'rb') as f:
|
| 18 |
+
contents = f.read()
|
| 19 |
+
except:
|
| 20 |
+
return
|
| 21 |
+
|
| 22 |
+
if not contents.startswith(b"..\\python_embeded\\python.exe .\\update.py"):
|
| 23 |
+
return
|
| 24 |
+
|
| 25 |
+
shutil.copy(updater_path, dest_updater_path)
|
| 26 |
+
try:
|
| 27 |
+
with open(dest_bat_deps_path, 'rb') as f:
|
| 28 |
+
contents = f.read()
|
| 29 |
+
contents = contents.replace(b'..\\python_embeded\\python.exe .\\update.py ..\\ComfyUI\\', b'call update_comfyui.bat nopause')
|
| 30 |
+
with open(dest_bat_deps_path, 'wb') as f:
|
| 31 |
+
f.write(contents)
|
| 32 |
+
except:
|
| 33 |
+
pass
|
| 34 |
+
shutil.copy(bat_path, dest_bat_path)
|
| 35 |
+
print("Updated the windows standalone package updater.")
|