Skip to content

Commit

Permalink
Add a update/update_comfyui_stable.bat to the standalones.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Aug 15, 2024
1 parent ab4dd19 commit 153d0a8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .ci/update_windows/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,25 @@ def pull(repo, remote_name='origin', branch='master'):
print("pulling latest changes")
pull(repo)

if "--stable" in sys.argv:
def latest_tag(repo):
versions = []
for k in repo.references:
try:
prefix = "refs/tags/v"
if k.startswith(prefix):
version = list(map(int, k[len(prefix):].split(".")))
versions.append((version[0] * 10000000000 + version[1] * 100000 + version[2], k))
except:
pass
versions.sort()
if len(versions) > 0:
return versions[-1][1]
return None
latest_tag = latest_tag(repo)
if latest_tag is not None:
repo.checkout(latest_tag)

print("Done!")

self_update = True
Expand Down Expand Up @@ -115,3 +134,13 @@ def file_size(f):
shutil.copy(repo_req_path, 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")

try:
if not file_size(stable_update_script_to) > 10:
shutil.copy(stable_update_script, stable_update_script_to)
except:
pass
8 changes: 8 additions & 0 deletions .ci/update_windows/update_comfyui_stable.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@echo off
..\python_embeded\python.exe .\update.py ..\ComfyUI\ --stable
if exist update_new.py (
move /y update_new.py update.py
echo Running updater again since it got updated.
..\python_embeded\python.exe .\update.py ..\ComfyUI\ --skip_self_update --stable
)
if "%~1"=="" pause

0 comments on commit 153d0a8

Please sign in to comment.