Skip to content

Commit

Permalink
[Optional] Checkout specific commit for ComfyUI-Manager (#207)
Browse files Browse the repository at this point in the history
* Handle case when Github releases rate limit is reached.

* Attach GITHUB_TOKEN to releases request if available.

* Fix test.

* Fix test.

* Ruff fix.

* Checkout specific commit for ComfyUI-Manager.
  • Loading branch information
robinjhuang authored Nov 12, 2024
1 parent 6525338 commit 2ff6f6e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions comfy_cli/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ def install(
help="Use new fast dependency installer",
),
] = False,
manager_commit: Annotated[
Optional[str],
typer.Option(help="Specify commit hash for ComfyUI-Manager"),
] = None,
):
check_for_updates()
checker = EnvChecker()
Expand Down Expand Up @@ -279,6 +283,7 @@ def install(
skip_torch_or_directml=skip_torch_or_directml,
skip_requirement=skip_requirement,
fast_deps=fast_deps,
manager_commit=manager_commit,
)
rprint(f"ComfyUI is installed at: {comfy_path}")
return None
Expand Down Expand Up @@ -346,6 +351,7 @@ def install(
skip_torch_or_directml=skip_torch_or_directml,
skip_requirement=skip_requirement,
fast_deps=fast_deps,
manager_commit=manager_commit,
)

rprint(f"ComfyUI is installed at: {comfy_path}")
Expand Down
3 changes: 3 additions & 0 deletions comfy_cli/command/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ def execute(
skip_manager: bool,
version: str,
commit: Optional[str] = None,
manager_commit: Optional[str] = None,
gpu: constants.GPU_OPTION = None,
cuda_version: constants.CUDAVersion = constants.CUDAVersion.v12_1,
plat: constants.OS = None,
Expand Down Expand Up @@ -238,6 +239,8 @@ def execute(
)
else:
subprocess.run(["git", "clone", manager_url, manager_repo_dir], check=True)
if manager_commit is not None:
subprocess.run(["git", "checkout", manager_commit], check=True, cwd=manager_repo_dir)

if not fast_deps:
pip_install_manager_dependencies(repo_dir)
Expand Down

0 comments on commit 2ff6f6e

Please sign in to comment.