Skip to content

Commit

Permalink
Merge branch 'comfyanonymous:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Totsukawaii authored Mar 2, 2024
2 parents 80bced3 + 0042556 commit cc9e1ca
Show file tree
Hide file tree
Showing 151 changed files with 23,025 additions and 5,711 deletions.

This file was deleted.

2 changes: 0 additions & 2 deletions .ci/nightly/windows_base_files/run_nvidia_gpu.bat

This file was deleted.

49 changes: 47 additions & 2 deletions .ci/update_windows/update.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import pygit2
from datetime import datetime
import sys
import os
import shutil
import filecmp

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

pygit2.option(pygit2.GIT_OPT_SET_OWNER_VALIDATION, 0)
repo = pygit2.Repository(str(sys.argv[1]))
repo_path = str(sys.argv[1])
repo = pygit2.Repository(repo_path)
ident = pygit2.Signature('comfyui', 'comfy@ui')
try:
print("stashing current changes")
Expand All @@ -51,7 +55,10 @@ def pull(repo, remote_name='origin', branch='master'):
print("nothing to stash")
backup_branch_name = 'backup_branch_{}'.format(datetime.today().strftime('%Y-%m-%d_%H_%M_%S'))
print("creating backup branch: {}".format(backup_branch_name))
repo.branches.local.create(backup_branch_name, repo.head.peel())
try:
repo.branches.local.create(backup_branch_name, repo.head.peel())
except:
pass

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

print("Done!")

self_update = True
if len(sys.argv) > 2:
self_update = '--skip_self_update' not in sys.argv

update_py_path = os.path.realpath(__file__)
repo_update_py_path = os.path.join(repo_path, ".ci/update_windows/update.py")

cur_path = os.path.dirname(update_py_path)


req_path = os.path.join(cur_path, "current_requirements.txt")
repo_req_path = os.path.join(repo_path, "requirements.txt")


def files_equal(file1, file2):
try:
return filecmp.cmp(file1, file2, shallow=False)
except:
return False

def file_size(f):
try:
return os.path.getsize(f)
except:
return 0


if self_update and not files_equal(update_py_path, repo_update_py_path) and file_size(repo_update_py_path) > 10:
shutil.copy(repo_update_py_path, os.path.join(cur_path, "update_new.py"))
exit()

if not os.path.exists(req_path) or not files_equal(repo_req_path, req_path):
import subprocess
try:
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-r', repo_req_path])
shutil.copy(repo_req_path, req_path)
except:
pass
8 changes: 7 additions & 1 deletion .ci/update_windows/update_comfyui.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
@echo off
..\python_embeded\python.exe .\update.py ..\ComfyUI\
pause
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
)
if "%~1"=="" pause
3 changes: 0 additions & 3 deletions .ci/update_windows/update_comfyui_and_python_dependencies.bat

This file was deleted.

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/test-ui.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Tests CI

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements.txt
- name: Run Tests
run: |
npm ci
npm run test:generate
npm test -- --verbose
working-directory: ./tests-ui
71 changes: 0 additions & 71 deletions .github/workflows/windows_release_cu118_dependencies.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/windows_release_cu118_dependencies_2.yml

This file was deleted.

79 changes: 0 additions & 79 deletions .github/workflows/windows_release_cu118_package.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/windows_release_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ jobs:
- shell: bash
run: |
echo "@echo off
..\python_embeded\python.exe .\update.py ..\ComfyUI\\
call update_comfyui.bat nopause
echo -
echo This will try to update pytorch and all python dependencies, if you get an error wait for pytorch/xformers to fix their stuff
echo You should not be running this anyways unless you really have to
echo This will try to update pytorch and all python dependencies.
echo -
echo If you just want to update normally, close this and run update_comfyui.bat instead.
echo -
Expand Down
Loading

0 comments on commit cc9e1ca

Please sign in to comment.