Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions comfy_cli/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,24 +165,13 @@ def install(
callback=validate_version,
),
] = "nightly",
manager_url: Annotated[
str,
typer.Option(
show_default=False,
help="url or local path pointing to the ComfyUI-Manager git repo to be installed. A specific branch can optionally be specified using a setuptools-like syntax, eg https://foo.git@bar",
),
] = constants.COMFY_MANAGER_GITHUB_URL,
restore: Annotated[
bool,
typer.Option(
show_default=False,
help="Restore dependencies for installed ComfyUI if not installed",
),
] = False,
skip_manager: Annotated[
bool,
typer.Option(show_default=False, help="Skip installing the manager component"),
] = False,
skip_torch_or_directml: Annotated[
bool,
typer.Option(show_default=False, help="Skip installing PyTorch Or DirectML"),
Expand Down Expand Up @@ -243,10 +232,6 @@ 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 All @@ -272,10 +257,8 @@ def install(
rprint("[bold yellow]Installing for CPU[/bold yellow]")
install_inner.execute(
url,
manager_url,
comfy_path,
restore,
skip_manager,
commit=commit,
version=version,
gpu=None,
Expand All @@ -284,7 +267,6 @@ 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 @@ -340,10 +322,8 @@ def install(

install_inner.execute(
url,
manager_url,
comfy_path,
restore,
skip_manager,
commit=commit,
gpu=gpu,
version=version,
Expand All @@ -352,7 +332,6 @@ 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
10 changes: 1 addition & 9 deletions comfy_cli/command/custom_nodes/cm_cli_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,7 @@
print("\n[bold red]ComfyUI path is not resolved.[/bold red]\n", file=sys.stderr)
raise typer.Exit(code=1)

cm_cli_path = os.path.join(workspace_path, "custom_nodes", "ComfyUI-Manager", "cm-cli.py")
if not os.path.exists(cm_cli_path):
print(
f"\n[bold red]ComfyUI-Manager not found: {cm_cli_path}[/bold red]\n",
file=sys.stderr,
)
raise typer.Exit(code=1)

cmd = [sys.executable, cm_cli_path] + args
cmd = [sys.executable, '-m', 'comfyui_manager.cm_cli'] + args

Check warning on line 33 in comfy_cli/command/custom_nodes/cm_cli_util.py

View check run for this annotation

Codecov / codecov/patch

comfy_cli/command/custom_nodes/cm_cli_util.py#L33

Added line #L33 was not covered by tests

if channel is not None:
cmd += ["--channel", channel]
Expand Down
4 changes: 1 addition & 3 deletions comfy_cli/command/custom_nodes/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,14 +482,12 @@
config_manager = ConfigManager()
workspace_path = workspace_manager.workspace_path

cm_cli_path = os.path.join(workspace_path, "custom_nodes", "ComfyUI-Manager", "cm-cli.py")

tmp_path = os.path.join(config_manager.get_config_path(), "tmp")
if not os.path.exists(tmp_path):
os.makedirs(tmp_path)

cache_path = os.path.join(tmp_path, "node-cache.list")
cmd = [sys.executable, cm_cli_path, "export-custom-node-ids", cache_path]
cmd = [sys.executable, "-m", "comfyui_manager.cm_cli", "export-custom-node-ids", cache_path]

Check warning on line 490 in comfy_cli/command/custom_nodes/command.py

View check run for this annotation

Codecov / codecov/patch

comfy_cli/command/custom_nodes/command.py#L490

Added line #L490 was not covered by tests

new_env = os.environ.copy()
new_env["COMFYUI_PATH"] = workspace_path
Expand Down
41 changes: 0 additions & 41 deletions comfy_cli/command/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from rich.panel import Panel

from comfy_cli import constants, ui, utils
from comfy_cli.command.custom_nodes.command import update_node_id_cache
from comfy_cli.constants import GPU_OPTION
from comfy_cli.git_utils import git_checkout_tag
from comfy_cli.uv import DependencyCompiler
Expand Down Expand Up @@ -162,13 +161,10 @@ def pip_install_manager_dependencies(repo_dir):

def execute(
url: str,
manager_url: str,
comfy_path: str,
restore: bool,
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_6,
plat: constants.OS = None,
Expand Down Expand Up @@ -225,48 +221,11 @@ def execute(

rprint("")

# install ComfyUI-Manager
if skip_manager:
rprint("Skipping installation of ComfyUI-Manager. (by --skip-manager)")
else:
manager_repo_dir = os.path.join(repo_dir, "custom_nodes", "ComfyUI-Manager")

if os.path.exists(manager_repo_dir):
if restore and not fast_deps:
pip_install_manager_dependencies(repo_dir)
else:
rprint(
f"Directory {manager_repo_dir} already exists. Skipping installation of ComfyUI-Manager.\nIf you want to restore dependencies, add the '--restore' option."
)
else:
rprint("\nInstalling ComfyUI-Manager..")

if "@" in manager_url:
# clone specific branch
manager_url, manager_branch = manager_url.rsplit("@", 1)
subprocess.run(
["git", "clone", "-b", manager_branch, manager_url, manager_repo_dir],
check=True,
)
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)

if fast_deps:
depComp = DependencyCompiler(cwd=repo_dir, gpu=gpu)
depComp.compile_deps()
depComp.install_deps()

if not skip_manager:
try:
update_node_id_cache()
except subprocess.CalledProcessError as e:
rprint(f"Failed to update node id cache: {e}")

os.chdir(repo_dir)

rprint("")
Expand Down
1 change: 0 additions & 1 deletion comfy_cli/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class PROC(str, Enum):


COMFY_GITHUB_URL = "https://github.com/comfyanonymous/ComfyUI"
COMFY_MANAGER_GITHUB_URL = "https://github.com/ltdrdata/ComfyUI-Manager"

DEFAULT_COMFY_MODEL_PATH = "models"
DEFAULT_COMFY_WORKSPACE = {
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies = [
"ruff",
"semver~=3.0.2",
"cookiecutter",
"comfyui-manager"
]

[project.optional-dependencies]
Expand Down
3 changes: 1 addition & 2 deletions tests/comfy_cli/command/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ def test_install_here(cmd, runner, mock_execute, mock_prompt_select_enum):
assert result.exit_code == 0, result.stdout

args, _ = mock_execute.call_args
url, manager_url, comfy_path, *_ = args
url, comfy_path, *_ = args
assert url == "https://github.com/comfyanonymous/ComfyUI"
assert manager_url == "https://github.com/ltdrdata/ComfyUI-Manager"
assert comfy_path == os.path.join(os.getcwd(), "ComfyUI")


Expand Down
Loading