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
13 changes: 0 additions & 13 deletions comfy_cli/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,6 @@ def entry(
)
ctx.exit()

# TODO: Move this to proper place
# start_time = time.time()
# workspace_manager.scan_dir()
# end_time = time.time()
#
# logging.info(f"scan_dir took {end_time - start_time:.2f} seconds to run")


def validate_commit_and_version(commit: str | None, ctx: typer.Context) -> str | None:
"""
Expand Down Expand Up @@ -1160,12 +1153,6 @@ def run_cli(
)


def validate_comfyui(_env_checker):
if _env_checker.comfy_repo is None:
rprint("[bold red]If ComfyUI is not installed, this feature cannot be used.[/bold red]")
raise typer.Exit(code=1)


@app.command(help="Stop background ComfyUI")
@tracking.track_command()
def stop():
Expand Down
28 changes: 0 additions & 28 deletions comfy_cli/cql/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,42 +543,14 @@ def downstream(self, name: str) -> list[Morphism]:
result.sort(key=lambda m: m.id)
return result

def pack_nodes(self, pack: str) -> list[Morphism]:
"""All nodes belonging to a custom-node pack (case-insensitive)."""
p = pack.lower()
return sorted([m for m in self._nodes.values() if m.pack.lower() == p], key=lambda m: m.id)

def label_nodes(self, label: str) -> list[Morphism]:
"""All nodes carrying a specific behavioral label."""
return sorted([m for m in self._nodes.values() if label in m.labels], key=lambda m: m.id)

def cloud_disabled_nodes(self) -> list[Morphism]:
"""All nodes that are disabled on Comfy Cloud."""
return sorted([m for m in self._nodes.values() if m.cloud_disabled], key=lambda m: m.id)

def cloud_enabled_nodes(self) -> list[Morphism]:
"""All nodes that are enabled on Comfy Cloud."""
return sorted([m for m in self._nodes.values() if not m.cloud_disabled], key=lambda m: m.id)

def api_nodes(self) -> list[Morphism]:
"""All partner API nodes."""
return sorted([m for m in self._nodes.values() if m.is_api_node], key=lambda m: m.id)

def output_nodes(self) -> list[Morphism]:
"""All terminal output nodes (SaveImage, etc.)."""
return sorted([m for m in self._nodes.values() if m.is_output_node], key=lambda m: m.id)

def packs(self) -> list[str]:
"""All known pack names, sorted."""
return sorted(set(m.pack for m in self._nodes.values() if m.pack))

def known_labels(self) -> list[str]:
"""All known labels, sorted."""
labels: set[str] = set()
for m in self._nodes.values():
labels.update(m.labels)
return sorted(labels)

def find_paths(
self,
from_type: str,
Expand Down
3 changes: 0 additions & 3 deletions comfy_cli/cql/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@ def __post_init__(self):

def __str__(self) -> str: # pragma: no cover - trivial
return self.runtime_message

def as_details(self) -> dict[str, Any]:
return {**self.details, "runtime_message": self.runtime_message}
3 changes: 0 additions & 3 deletions comfy_cli/env_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ def __init__(self):
self.python_version = sys.version_info
self.check()

def is_isolated_env(self):
return self.virtualenv_path or self.conda_env

def get_isolated_env(self):
if self.virtualenv_path:
return self.virtualenv_path
Expand Down
12 changes: 0 additions & 12 deletions comfy_cli/standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,6 @@ def pip_install(self, *args: str):
def uv_install(self, *args: str):
self.run_module("uv", "pip", "install", *args)

def install_comfy_cli(self, dev: bool = False):
if dev:
self.uv_install(str(_here.parent))
else:
self.uv_install("comfy_cli")

def run_comfy_cli(self, *args: str):
self.run_module("comfy_cli", *args)

def install_comfy(self, *args: str, gpu_arg: str = "--nvidia"):
self.run_comfy_cli("--here", "--skip-prompt", "install", "--fast-deps", gpu_arg, *args)

def dehydrate_comfy_deps(
self,
comfyDir: PathLike,
Expand Down
20 changes: 0 additions & 20 deletions comfy_cli/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,6 @@ def show_progress(iterable, total, description="Downloading..."):
ChoiceType = str | Choice | dict[str, Any]


def prompt_autocomplete(
question: str, choices: list[ChoiceType], default: ChoiceType = "", force_prompting: bool = False
) -> ChoiceType | None:
"""
Asks a single select question using questionary and returns the selected response.

Args:
question (str): The question to display to the user.
choices (List[ChoiceType]): A list of choices the user can autocomplete from.
default (ChoiceType): Default choice.
force_prompting (bool): Whether to force prompting even if skip_prompting is set.

Returns:
Optional[ChoiceType]: The selected choice from the user, or None if skipping prompts.
"""
if workspace_manager.skip_prompting and not force_prompting:
return None
return questionary.autocomplete(question, choices=choices, default=default).ask()


def prompt_select(
question: str, choices: list[ChoiceType], default: ChoiceType = "", force_prompting: bool = False
) -> ChoiceType | None:
Expand Down
6 changes: 0 additions & 6 deletions comfy_cli/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import subprocess
import sys
import time
from importlib.metadata import metadata
from pathlib import Path

import requests
Expand Down Expand Up @@ -40,11 +39,6 @@ def check_for_newer_pypi_version(package_name, current_version):
return False, current_version


def get_version_from_pyproject():
package_metadata = metadata("comfy-cli")
return package_metadata["Version"]


def upgrade_cli():
"""Upgrade the ``comfy-cli`` package itself via pip against the running
interpreter. Raises ``CalledProcessError`` if pip fails — fail fast."""
Expand Down
15 changes: 0 additions & 15 deletions comfy_cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,18 @@
import functools
import platform
import shutil
import subprocess
import tarfile
from contextlib import contextmanager
from pathlib import Path
from typing import BinaryIO, cast

import psutil
import requests
import typer
from rich import progress
from rich.live import Live
from rich.table import Table

from comfy_cli.constants import DEFAULT_COMFY_WORKSPACE, OS, PROC

# Use the output shim so prints go to stderr (not stdout) in JSON mode,
# preserving the one-envelope-on-stdout contract.
from comfy_cli.output import rprint as print # noqa: A001 - intentional shadowing
from comfy_cli.typing import PathLike


Expand Down Expand Up @@ -70,15 +64,6 @@ def get_proc():
raise ValueError


def install_conda_package(package_name):
try:
subprocess.check_call(["conda", "install", "-y", package_name])
print(f"[bold green] Successfully installed {package_name} [/bold green]")
except subprocess.CalledProcessError as e:
print(f"[bold red] Failed to install {package_name}. Error: {e} [/bold red]")
raise typer.Exit(code=1)


def get_not_user_set_default_workspace():
return DEFAULT_COMFY_WORKSPACE[get_os()]

Expand Down
Loading