Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: save yaml file #24

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
29 changes: 26 additions & 3 deletions comfy_cli/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from comfy_cli.config_manager import ConfigManager
from comfy_cli.constants import GPU_OPTION
from comfy_cli.env_checker import EnvChecker, check_comfy_server_running
from comfy_cli.update import check_for_updates
from comfy_cli.update import check_for_updates, get_version_from_pyproject
from comfy_cli.workspace_manager import (
WorkspaceManager,
WorkspaceType,
Expand Down Expand Up @@ -94,9 +94,10 @@ def entry(
skip_prompt: Annotated[
Optional[bool],
typer.Option(
"--skip-prompt",
show_default=False,
is_flag=True,
help="Do not prompt user for input, use default options",
help="Do not prompt user for input, use default options and command line args",
),
] = None,
enable_telemetry: Annotated[
Expand All @@ -108,12 +109,26 @@ def entry(
help="Enable tracking",
),
] = True,
version: Annotated[
Optional[bool],
typer.Option(
"-v",
"--version",
show_default=False,
is_flag=True,
help="Display version",
),
] = False,
):
workspace_manager.setup_workspace_manager(workspace, here, recent, skip_prompt)

tracking.prompt_tracking_consent(skip_prompt, default_value=enable_telemetry)

if ctx.invoked_subcommand is None:
if version:
version = get_version_from_pyproject()
print(f"Comfy CLI version: {version}")

if ctx.invoked_subcommand is None and not version:
print(
"[bold yellow]Welcome to Comfy CLI![/bold yellow]: https://github.com/Comfy-Org/comfy-cli"
)
Expand Down Expand Up @@ -505,6 +520,14 @@ def which():
)
raise typer.Exit(code=1)

if workspace_manager.workspace_type == WorkspaceType.DEFAULT:
print("Default Comfy path is used.")
elif workspace_manager.workspace_type == WorkspaceType.CURRENT_DIR:
print("Current directory is used.")
elif workspace_manager.workspace_type == WorkspaceType.RECENT:
print("Most recently used ComfyUP is used")
elif workspace_manager.workspace_type == WorkspaceType.SPECIFIED:
print("Specified path is used.")
print(f"Target ComfyUI path: {comfy_path}")


Expand Down
6 changes: 3 additions & 3 deletions comfy_cli/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ class OS(Enum):
CONFIG_KEY_INSTALL_EVENT_TRIGGERED = "install_event_triggered"
CONFIG_KEY_BACKGROUND = "background"

DEFAULT_TRACKING_VALUE = True

COMFY_LOCK_YAML_FILE = "comfy.lock.yaml"
COMFY_LOCK_YAML_FILE = "comfy-lock.yaml"

# TODO: figure out a better way to check if this is a comfy repo
COMFY_ORIGIN_URL_CHOICES = [
Expand All @@ -65,4 +63,6 @@ class GPU_OPTION(Enum):
# https://github.com/comfyanonymous/ComfyUI/blob/a88b0ebc2d2f933c94e42aa689c42e836eedaf3c/folder_paths.py#L5
SUPPORTED_PT_EXTENSIONS = (".ckpt", ".pt", ".bin", ".pth", ".safetensors")

IGNORE_CUSTOM_NODE_FOLDERS = ("__pycache__",)

COMFY_REGISTRY_URL_ROOT = "https://api-frontend-dev-qod3oz2v2q-uc.a.run.app"
2 changes: 2 additions & 0 deletions comfy_cli/env_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from rich.table import Table
import requests

from comfy_cli import update
from comfy_cli.utils import singleton
from comfy_cli.config_manager import ConfigManager

Expand Down Expand Up @@ -109,6 +110,7 @@ def fill_print_table(self):
self.virtualenv_path if self.virtualenv_path else "Not Used",
)
table.add_row("Conda Env", self.conda_env if self.conda_env else "Not Used")
table.add_row("Comfy CLI Version", update.get_version_from_pyproject())

ConfigManager().fill_print_env(table)

Expand Down
Loading
Loading