From cac8af092804b60be44de6c34d0ee8267c2c04a0 Mon Sep 17 00:00:00 2001 From: lllyasviel Date: Thu, 12 Oct 2023 02:56:19 -0700 Subject: [PATCH] sync (#656) --- dev_script_build_backend.py | 3 ++- modules/launch_util.py | 16 +++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/dev_script_build_backend.py b/dev_script_build_backend.py index 3682534..ea217c0 100644 --- a/dev_script_build_backend.py +++ b/dev_script_build_backend.py @@ -22,7 +22,8 @@ def get_empty_folder(path): comfy_repo = "https://github.com/comfyanonymous/ComfyUI" -comfy_commit_hash = "8cc75c64ff7188ce72cd4ba595119586e425c09f" +comfy_commit_hash = None + comfy_temp_path = get_empty_folder(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'backend', 'comfy_temp')) comfy_core_path = get_empty_folder(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'backend', 'headless')) diff --git a/modules/launch_util.py b/modules/launch_util.py index 4fc3eaf..360f464 100644 --- a/modules/launch_util.py +++ b/modules/launch_util.py @@ -52,15 +52,13 @@ def git_clone(url, dir, name, hash=None): repo = pygit2.clone_repository(url, dir) print(f'{name} cloned from {url}.') - remote = repo.remotes['origin'] - remote.fetch() - - commit = repo.get(hash) - - repo.checkout_tree(commit, strategy=pygit2.GIT_CHECKOUT_FORCE) - repo.set_head(commit.id) - - print(f'{name} checkout finished for {hash}.') + if hash is not None: + remote = repo.remotes['origin'] + remote.fetch() + commit = repo.get(hash) + repo.checkout_tree(commit, strategy=pygit2.GIT_CHECKOUT_FORCE) + repo.set_head(commit.id) + print(f'{name} checkout finished for {hash}.') except Exception as e: print(f'Git clone failed for {name}: {str(e)}')