diff --git a/.github/workflows/test-mac.yml b/.github/workflows/test-mac.yml index 8b351070..c4ea246b 100644 --- a/.github/workflows/test-mac.yml +++ b/.github/workflows/test-mac.yml @@ -28,6 +28,4 @@ jobs: python -m pip install --upgrade pip pip install -e . comfy --skip-prompt --workspace ./ComfyUI install --fast-deps --m-series --skip-manager - comfy --workspace ./ComfyUI standalone --platform macos - comfy standalone --rehydrate - ./python/bin/python ComfyUI/main.py --cpu --quick-test-for-ci + comfy --here launch -- --cpu --quick-test-for-ci diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index ecb1fc0b..a13b14d9 100755 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -30,7 +30,4 @@ jobs: pip install pytest pip install -e . comfy --skip-prompt --workspace ./ComfyUI install --fast-deps --nvidia --cuda-version 12.6 --skip-manager - comfy --workspace ./ComfyUI standalone --platform windows --proc x86_64 - ls - comfy standalone --rehydrate --platform windows --proc x86_64 - ./python/python.exe ComfyUI/main.py --cpu --quick-test-for-ci + comfy --here launch -- --cpu --quick-test-for-ci diff --git a/comfy_cli/command/custom_nodes/command.py b/comfy_cli/command/custom_nodes/command.py index b536eaa6..f15d6072 100644 --- a/comfy_cli/command/custom_nodes/command.py +++ b/comfy_cli/command/custom_nodes/command.py @@ -8,6 +8,7 @@ import typer from rich import print +from rich.console import Console from typing_extensions import Annotated, List from comfy_cli import logging, tracking, ui, utils @@ -28,6 +29,7 @@ ) from comfy_cli.workspace_manager import WorkspaceManager +console = Console() app = typer.Typer() app.add_typer(bisect_app, name="bisect", help="Bisect custom nodes for culprit node.") manager_app = typer.Typer() @@ -392,7 +394,7 @@ def install( ), ] = None, fast_deps: Annotated[ - Optional[bool], + bool, typer.Option( "--fast-deps", show_default=False, @@ -649,7 +651,7 @@ def install_deps( execute_cm_cli( ["deps-in-workflow", "--workflow", workflow, "--output", tmp_path], channel, - mode, + mode=mode, ) deps_file = tmp_path @@ -689,7 +691,7 @@ def deps_in_workflow( execute_cm_cli( ["deps-in-workflow", "--workflow", workflow, "--output", output], channel, - mode, + mode=mode, ) @@ -918,3 +920,20 @@ def pack(): zip_files(zip_filename) typer.echo(f"Created zip file: {NODE_ZIP_FILENAME}") logging.info("Node has been packed successfully.") + + +@app.command("scaffold", help="Create a new ComfyUI custom node project using cookiecutter") +@tracking.track_command("node") +def scaffold_cookiecutter(): + """Create a new ComfyUI custom node project using cookiecutter.""" + import cookiecutter.main + + try: + cookiecutter.main.cookiecutter( + "https://github.com/Comfy-Org/cookiecutter-comfy-extension.git", + overwrite_if_exists=True, + ) + console.print("[bold green]✓ Custom node project created successfully![/bold green]") + except Exception as e: + console.print(f"[bold red]Error creating project: {str(e)}[/bold red]") + raise typer.Exit(code=1) diff --git a/comfy_cli/command/launch.py b/comfy_cli/command/launch.py index b1881006..52885e66 100644 --- a/comfy_cli/command/launch.py +++ b/comfy_cli/command/launch.py @@ -48,7 +48,7 @@ def launch_comfyui(extra): exit(res) if not os.path.exists(reboot_path): - exit(res) + exit(res.returncode) os.remove(reboot_path) else: diff --git a/pyproject.toml b/pyproject.toml index 7dabe97d..328c087c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,6 +43,7 @@ dependencies = [ "websocket-client", "ruff", "semver~=3.0.2", + "cookiecutter", ] [project.optional-dependencies]