From 1a2583c92a949b8f737d798c9c19e3cf1ab57cf7 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Mon, 10 Feb 2025 15:39:27 -0800 Subject: [PATCH 1/6] Remove standalone tests. --- .github/workflows/test-mac.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-mac.yml b/.github/workflows/test-mac.yml index 8b351070..2873fa78 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 From fcf28f6e4ce9b23a88a485e28f0650f2d93a30d5 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Mon, 10 Feb 2025 15:39:30 -0800 Subject: [PATCH 2/6] Remove. --- .github/workflows/test-windows.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index ecb1fc0b..0e312fef 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 From 13a02f2f141d3eda124210f5bbafc80c2438bc6c Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Mon, 10 Feb 2025 16:00:06 -0800 Subject: [PATCH 3/6] Fix return code for comfy launch. --- comfy_cli/command/launch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: From 6ee874eea2066bc522889692fa099667d4124ad8 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Mon, 10 Feb 2025 16:00:40 -0800 Subject: [PATCH 4/6] Use comfy launch. --- .github/workflows/test-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 0e312fef..a13b14d9 100755 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -30,4 +30,4 @@ jobs: pip install pytest pip install -e . comfy --skip-prompt --workspace ./ComfyUI install --fast-deps --nvidia --cuda-version 12.6 --skip-manager - ./python/python.exe ComfyUI/main.py --cpu --quick-test-for-ci + comfy --here launch -- --cpu --quick-test-for-ci From cc0a0d346fd9e5f08bad28c6da80205abfeec11f Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Mon, 10 Feb 2025 15:34:26 -0800 Subject: [PATCH 5/6] Add cookie-cutter template for custom nodes. --- comfy_cli/command/custom_nodes/command.py | 19 +++++++++++++++++++ pyproject.toml | 1 + 2 files changed, 20 insertions(+) diff --git a/comfy_cli/command/custom_nodes/command.py b/comfy_cli/command/custom_nodes/command.py index b536eaa6..dd128694 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() @@ -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/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] From d57beabc07b3ac22f068d484839f3272b15917b7 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Mon, 10 Feb 2025 15:50:18 -0800 Subject: [PATCH 6/6] Fix mac command. --- .github/workflows/test-mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-mac.yml b/.github/workflows/test-mac.yml index 2873fa78..c4ea246b 100644 --- a/.github/workflows/test-mac.yml +++ b/.github/workflows/test-mac.yml @@ -28,4 +28,4 @@ jobs: python -m pip install --upgrade pip pip install -e . comfy --skip-prompt --workspace ./ComfyUI install --fast-deps --m-series --skip-manager - ./python/bin/python ComfyUI/main.py --cpu --quick-test-for-ci + comfy --here launch -- --cpu --quick-test-for-ci