Skip to content
Merged
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,3 @@ requirements.compiled
override.txt
.coverage
coverage.xml

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Comfy provides commands that allow you to easily run the installed ComfyUI.

```
comfy launch --frontend-pr "#456"
comfy launch --frontend-pr "username:branch-name"
comfy launch --frontend-pr "username:branch-name"
comfy launch --frontend-pr "https://github.com/Comfy-Org/ComfyUI_frontend/pull/456"
```

Expand All @@ -142,7 +142,7 @@ Comfy provides commands that allow you to easily run the installed ComfyUI.
comfy pr-cache clean # Clean all cached builds
comfy pr-cache clean 456 # Clean specific PR cache
```

- Cache automatically expires after 7 days
- Maximum of 10 PR builds are kept (oldest are removed automatically)
- Cache limits help manage disk space while keeping recent builds available
Expand Down
38 changes: 19 additions & 19 deletions comfy_cli/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import subprocess
import sys
import webbrowser
from typing import Annotated, Optional
from typing import Annotated

import questionary
import typer
Expand Down Expand Up @@ -65,15 +65,15 @@ def help(ctx: typer.Context):
def entry(
ctx: typer.Context,
workspace: Annotated[
Optional[str],
str | None,
typer.Option(
show_default=False,
help="Path to ComfyUI workspace",
callback=g_exclusivity.validate,
),
] = None,
recent: Annotated[
Optional[bool],
bool | None,
typer.Option(
show_default=False,
is_flag=True,
Expand All @@ -82,7 +82,7 @@ def entry(
),
] = None,
here: Annotated[
Optional[bool],
bool | None,
typer.Option(
show_default=False,
is_flag=True,
Expand Down Expand Up @@ -136,7 +136,7 @@ def entry(
# logging.info(f"scan_dir took {end_time - start_time:.2f} seconds to run")


def validate_commit_and_version(commit: Optional[str], ctx: typer.Context) -> Optional[str]:
def validate_commit_and_version(commit: str | None, ctx: typer.Context) -> str | None:
"""
Validate that the commit is not specified unless the version is 'nightly'.
"""
Expand Down Expand Up @@ -190,7 +190,7 @@ def install(
bool, typer.Option(show_default=False, help="Skip installing requirements.txt")
] = False,
nvidia: Annotated[
Optional[bool],
bool | None,
typer.Option(
show_default=False,
help="Install for Nvidia gpu",
Expand All @@ -199,23 +199,23 @@ def install(
] = None,
cuda_version: Annotated[CUDAVersion, typer.Option(show_default=True)] = CUDAVersion.v12_6,
amd: Annotated[
Optional[bool],
bool | None,
typer.Option(
show_default=False,
help="Install for AMD gpu",
callback=g_gpu_exclusivity.validate,
),
] = None,
m_series: Annotated[
Optional[bool],
bool | None,
typer.Option(
show_default=False,
help="Install for Mac M-Series gpu",
callback=g_gpu_exclusivity.validate,
),
] = None,
intel_arc: Annotated[
Optional[bool],
bool | None,
typer.Option(
hidden=True,
show_default=False,
Expand All @@ -224,15 +224,15 @@ def install(
),
] = None,
cpu: Annotated[
Optional[bool],
bool | None,
typer.Option(
show_default=False,
help="Install for CPU",
callback=g_gpu_exclusivity.validate,
),
] = None,
commit: Annotated[
Optional[str], typer.Option(help="Specify commit hash for ComfyUI", callback=validate_commit_and_version)
str | None, typer.Option(help="Specify commit hash for ComfyUI", callback=validate_commit_and_version)
] = None,
fast_deps: Annotated[
bool,
Expand All @@ -243,11 +243,11 @@ def install(
),
] = False,
manager_commit: Annotated[
Optional[str],
str | None,
typer.Option(help="Specify commit hash for ComfyUI-Manager"),
] = None,
pr: Annotated[
Optional[str],
str | None,
typer.Option(
show_default=False,
help="Install from a specific PR. Supports formats: username:branch, #123, or PR URL",
Expand Down Expand Up @@ -403,15 +403,15 @@ def run(
typer.Option(help="Enables verbose output of the execution process."),
] = False,
host: Annotated[
Optional[str],
str | None,
typer.Option(help="The IP/hostname where the ComfyUI instance is running, e.g. 127.0.0.1 or localhost."),
] = None,
port: Annotated[
Optional[int],
int | None,
typer.Option(help="The port where the ComfyUI instance is running, e.g. 8188."),
] = None,
timeout: Annotated[
Optional[int],
int | None,
typer.Option(help="The timeout in seconds for the workflow execution."),
] = 30,
):
Expand Down Expand Up @@ -474,7 +474,7 @@ def launch(
extra: list[str] = typer.Argument(None),
background: Annotated[bool, typer.Option(help="Launch ComfyUI in background")] = False,
frontend_pr: Annotated[
Optional[str],
str | None,
typer.Option(
"--frontend-pr",
show_default=False,
Expand Down Expand Up @@ -614,14 +614,14 @@ def standalone(
),
] = False,
platform: Annotated[
Optional[constants.OS],
constants.OS | None,
typer.Option(
show_default=False,
help="Create standalone Python for specified platform",
),
] = None,
proc: Annotated[
Optional[constants.PROC],
constants.PROC | None,
typer.Option(
show_default=False,
help="Create standalone Python for specified processor",
Expand Down
42 changes: 21 additions & 21 deletions comfy_cli/command/custom_nodes/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
import uuid
from enum import Enum
from typing import Annotated, Optional
from typing import Annotated

import typer
from rich import print
Expand Down Expand Up @@ -182,7 +182,7 @@ def execute_install_script(repo_path):
@tracking.track_command("node")
def save_snapshot(
output: Annotated[
Optional[str],
str | None,
typer.Option(show_default=False, help="Specify the output file path. (.json/.yaml)"),
] = None,
):
Expand All @@ -197,19 +197,19 @@ def save_snapshot(
@tracking.track_command("node")
def restore_snapshot(
path: str,
pip_non_url: Optional[bool] = typer.Option(
pip_non_url: bool | None = typer.Option(
default=None,
show_default=False,
is_flag=True,
help="Restore for pip packages registered on PyPI.",
),
pip_non_local_url: Optional[bool] = typer.Option(
pip_non_local_url: bool | None = typer.Option(
default=None,
show_default=False,
is_flag=True,
help="Restore for pip packages registered at web URLs.",
),
pip_local_url: Optional[bool] = typer.Option(
pip_local_url: bool | None = typer.Option(
default=None,
show_default=False,
is_flag=True,
Expand Down Expand Up @@ -307,7 +307,7 @@ def show(
help="Target to display",
),
channel: Annotated[
Optional[str],
str | None,
typer.Option(
show_default=False,
help="Specify the operation mode",
Expand All @@ -332,7 +332,7 @@ def simple_show(
help="Target to display",
),
channel: Annotated[
Optional[str],
str | None,
typer.Option(
show_default=False,
help="Specify the operation mode",
Expand All @@ -356,7 +356,7 @@ def simple_show(
def install(
nodes: list[str] = typer.Argument(..., help="List of custom nodes to install", autocompletion=node_completer),
channel: Annotated[
Optional[str],
str | None,
typer.Option(
show_default=False,
help="Specify the operation mode",
Expand Down Expand Up @@ -421,15 +421,15 @@ def install(
def reinstall(
nodes: list[str] = typer.Argument(..., help="List of custom nodes to reinstall", autocompletion=node_completer),
channel: Annotated[
Optional[str],
str | None,
typer.Option(
show_default=False,
help="Specify the operation mode",
autocompletion=channel_completer,
),
] = None,
fast_deps: Annotated[
Optional[bool],
bool | None,
typer.Option(
"--fast-deps",
show_default=False,
Expand All @@ -456,7 +456,7 @@ def reinstall(
def uninstall(
nodes: list[str] = typer.Argument(..., help="List of custom nodes to uninstall", autocompletion=node_completer),
channel: Annotated[
Optional[str],
str | None,
typer.Option(
show_default=False,
help="Specify the operation mode",
Expand Down Expand Up @@ -506,7 +506,7 @@ def update(
autocompletion=node_or_all_completer,
),
channel: Annotated[
Optional[str],
str | None,
typer.Option(
show_default=False,
help="Specify the operation mode",
Expand Down Expand Up @@ -535,7 +535,7 @@ def disable(
autocompletion=node_or_all_completer,
),
channel: Annotated[
Optional[str],
str | None,
typer.Option(
show_default=False,
help="Specify the operation mode",
Expand All @@ -562,7 +562,7 @@ def enable(
autocompletion=node_or_all_completer,
),
channel: Annotated[
Optional[str],
str | None,
typer.Option(
show_default=False,
help="Specify the operation mode",
Expand All @@ -589,7 +589,7 @@ def fix(
autocompletion=node_or_all_completer,
),
channel: Annotated[
Optional[str],
str | None,
typer.Option(
show_default=False,
help="Specify the operation mode",
Expand All @@ -614,15 +614,15 @@ def fix(
@tracking.track_command("node")
def install_deps(
deps: Annotated[
Optional[str],
str | None,
typer.Option(show_default=False, help="Dependency spec file (.json)"),
] = None,
workflow: Annotated[
Optional[str],
str | None,
typer.Option(show_default=False, help="Workflow file (.json/.png)"),
] = None,
channel: Annotated[
Optional[str],
str | None,
typer.Option(
show_default=False,
help="Specify the operation mode",
Expand Down Expand Up @@ -670,7 +670,7 @@ def deps_in_workflow(
workflow: Annotated[str, typer.Option(show_default=False, help="Workflow file (.json/.png)")],
output: Annotated[str, typer.Option(show_default=False, help="Output file (.json)")],
channel: Annotated[
Optional[str],
str | None,
typer.Option(
show_default=False,
help="Specify the operation mode",
Expand Down Expand Up @@ -743,7 +743,7 @@ def validate():
@app.command("publish", help="Publish node to registry")
@tracking.track_command("publish")
def publish(
token: Optional[str] = typer.Option(None, "--token", help="Personal Access Token for publishing", hide_input=True),
token: str | None = typer.Option(None, "--token", help="Personal Access Token for publishing", hide_input=True),
):
"""
Publish a node with optional validation.
Expand Down Expand Up @@ -843,7 +843,7 @@ def display_all_nodes():
@tracking.track_command("node")
def registry_install(
node_id: str,
version: Optional[str] = None,
version: str | None = None,
force_download: Annotated[
bool,
typer.Option(
Expand Down
Loading