Skip to content

Commit 3ca50eb

Browse files
authored
Merge pull request #11 from 11cafe/dev2
Dev2
2 parents d6d1dc0 + 923bfec commit 3ca50eb

File tree

92 files changed

+4578
-1906
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+4578
-1906
lines changed

.ci/update_windows/update.py

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import pygit2
22
from datetime import datetime
33
import sys
4+
import os
5+
import shutil
6+
import filecmp
47

58
def pull(repo, remote_name='origin', branch='master'):
69
for remote in repo.remotes:
@@ -42,7 +45,8 @@ def pull(repo, remote_name='origin', branch='master'):
4245
raise AssertionError('Unknown merge analysis result')
4346

4447
pygit2.option(pygit2.GIT_OPT_SET_OWNER_VALIDATION, 0)
45-
repo = pygit2.Repository(str(sys.argv[1]))
48+
repo_path = str(sys.argv[1])
49+
repo = pygit2.Repository(repo_path)
4650
ident = pygit2.Signature('comfyui', 'comfy@ui')
4751
try:
4852
print("stashing current changes")
@@ -51,7 +55,10 @@ def pull(repo, remote_name='origin', branch='master'):
5155
print("nothing to stash")
5256
backup_branch_name = 'backup_branch_{}'.format(datetime.today().strftime('%Y-%m-%d_%H_%M_%S'))
5357
print("creating backup branch: {}".format(backup_branch_name))
54-
repo.branches.local.create(backup_branch_name, repo.head.peel())
58+
try:
59+
repo.branches.local.create(backup_branch_name, repo.head.peel())
60+
except:
61+
pass
5562

5663
print("checking out master branch")
5764
branch = repo.lookup_branch('master')
@@ -63,3 +70,41 @@ def pull(repo, remote_name='origin', branch='master'):
6370

6471
print("Done!")
6572

73+
self_update = True
74+
if len(sys.argv) > 2:
75+
self_update = '--skip_self_update' not in sys.argv
76+
77+
update_py_path = os.path.realpath(__file__)
78+
repo_update_py_path = os.path.join(repo_path, ".ci/update_windows/update.py")
79+
80+
cur_path = os.path.dirname(update_py_path)
81+
82+
83+
req_path = os.path.join(cur_path, "current_requirements.txt")
84+
repo_req_path = os.path.join(repo_path, "requirements.txt")
85+
86+
87+
def files_equal(file1, file2):
88+
try:
89+
return filecmp.cmp(file1, file2, shallow=False)
90+
except:
91+
return False
92+
93+
def file_size(f):
94+
try:
95+
return os.path.getsize(f)
96+
except:
97+
return 0
98+
99+
100+
if self_update and not files_equal(update_py_path, repo_update_py_path) and file_size(repo_update_py_path) > 10:
101+
shutil.copy(repo_update_py_path, os.path.join(cur_path, "update_new.py"))
102+
exit()
103+
104+
if not os.path.exists(req_path) or not files_equal(repo_req_path, req_path):
105+
import subprocess
106+
try:
107+
subprocess.check_call([sys.executable, '-s', '-m', 'pip', 'install', '-r', repo_req_path])
108+
shutil.copy(repo_req_path, req_path)
109+
except:
110+
pass
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1+
@echo off
12
..\python_embeded\python.exe .\update.py ..\ComfyUI\
2-
pause
3+
if exist update_new.py (
4+
move /y update_new.py update.py
5+
echo Running updater again since it got updated.
6+
..\python_embeded\python.exe .\update.py ..\ComfyUI\ --skip_self_update
7+
)
8+
if "%~1"=="" pause

.ci/update_windows/update_comfyui_and_python_dependencies.bat

Lines changed: 0 additions & 3 deletions
This file was deleted.

.ci/update_windows_cu118/update_comfyui_and_python_dependencies.bat

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/windows_release_cu118_dependencies.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

.github/workflows/windows_release_cu118_dependencies_2.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/windows_release_cu118_package.yml

Lines changed: 0 additions & 79 deletions
This file was deleted.

.github/workflows/windows_release_dependencies.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
description: 'python patch version'
2525
required: true
2626
type: string
27-
default: "6"
27+
default: "8"
2828
# push:
2929
# branches:
3030
# - master
@@ -41,10 +41,9 @@ jobs:
4141
- shell: bash
4242
run: |
4343
echo "@echo off
44-
..\python_embeded\python.exe .\update.py ..\ComfyUI\\
44+
call update_comfyui.bat nopause
4545
echo -
46-
echo This will try to update pytorch and all python dependencies, if you get an error wait for pytorch/xformers to fix their stuff
47-
echo You should not be running this anyways unless you really have to
46+
echo This will try to update pytorch and all python dependencies.
4847
echo -
4948
echo If you just want to update normally, close this and run update_comfyui.bat instead.
5049
echo -

.github/workflows/windows_release_nightly_pytorch.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
description: 'python patch version'
2020
required: true
2121
type: string
22-
default: "1"
22+
default: "2"
2323
# push:
2424
# branches:
2525
# - master
@@ -49,7 +49,7 @@ jobs:
4949
echo 'import site' >> ./python3${{ inputs.python_minor }}._pth
5050
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
5151
./python.exe get-pip.py
52-
python -m pip wheel torch torchvision torchaudio --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu${{ inputs.cu }} -r ../ComfyUI/requirements.txt pygit2 -w ../temp_wheel_dir
52+
python -m pip wheel torch torchvision torchaudio mpmath==1.3.0 --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu${{ inputs.cu }} -r ../ComfyUI/requirements.txt pygit2 -w ../temp_wheel_dir
5353
ls ../temp_wheel_dir
5454
./python.exe -s -m pip install --pre ../temp_wheel_dir/*
5555
sed -i '1i../ComfyUI' ./python3${{ inputs.python_minor }}._pth
@@ -68,7 +68,7 @@ jobs:
6868
cp -r ComfyUI/.ci/update_windows/* ./update/
6969
cp -r ComfyUI/.ci/windows_base_files/* ./
7070
71-
echo "..\python_embeded\python.exe .\update.py ..\ComfyUI\\
71+
echo "call update_comfyui.bat nopause
7272
..\python_embeded\python.exe -s -m pip install --upgrade --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cu${{ inputs.cu }} -r ../ComfyUI/requirements.txt pygit2
7373
pause" > ./update/update_comfyui_and_python_dependencies.bat
7474
cd ..

.github/workflows/windows_release_package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
description: 'python patch version'
2020
required: true
2121
type: string
22-
default: "6"
22+
default: "8"
2323
# push:
2424
# branches:
2525
# - master

0 commit comments

Comments
 (0)