git: b5863da5c6ec - main - misc/comfy-cli: New port: CLI for ComfyUI, a node-based workflow system for AI image generation

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Sun, 22 Mar 2026 03:24:09 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b5863da5c6ecab2ab6a3db82feedeb97723824c8

commit b5863da5c6ecab2ab6a3db82feedeb97723824c8
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2026-03-22 03:02:24 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2026-03-22 03:24:01 +0000

    misc/comfy-cli: New port: CLI for ComfyUI, a node-based workflow system for AI image generation
---
 misc/Makefile                                      |  1 +
 misc/comfy-cli/Makefile                            | 47 ++++++++++++++++++++++
 misc/comfy-cli/distinfo                            |  3 ++
 misc/comfy-cli/files/patch-comfy__cli_constants.py | 25 ++++++++++++
 .../comfy-cli/files/patch-comfy__cli_standalone.py | 17 ++++++++
 misc/comfy-cli/files/patch-comfy__cli_utils.py     | 21 ++++++++++
 .../files/patch-comfy__cli_workspace_manager.py    | 13 ++++++
 misc/comfy-cli/pkg-descr                           | 11 +++++
 8 files changed, 138 insertions(+)

diff --git a/misc/Makefile b/misc/Makefile
index 19ee6b13a26d..33e90e304c7a 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -59,6 +59,7 @@
     SUBDIR += colortail
     SUBDIR += coloursum
     SUBDIR += colwide
+    SUBDIR += comfy-cli
     SUBDIR += comfyui
     SUBDIR += compat.el
     SUBDIR += compat10x
diff --git a/misc/comfy-cli/Makefile b/misc/comfy-cli/Makefile
new file mode 100644
index 000000000000..a907d698f379
--- /dev/null
+++ b/misc/comfy-cli/Makefile
@@ -0,0 +1,47 @@
+PORTNAME=	comfy-cli
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.6.0
+CATEGORIES=	misc python # machine-learning
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	CLI for ComfyUI, a node-based workflow system for AI image generation
+WWW=		https://docs.comfy.org/comfy-cli/getting-started \
+		https://github.com/Comfy-Org/comfy-cli
+
+LICENSE=	GPLv3
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${PY_SETUPTOOLS} \
+		${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}charset-normalizer>=3:textproc/py-charset-normalizer@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}cookiecutter>0:devel/py-cookiecutter@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}gitpython>0:devel/py-gitpython@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}httpx>0:www/py-httpx@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}mixpanel>0:misc/py-mixpanel@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}packaging>0:devel/py-packaging@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pathspec>0:devel/py-pathspec@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}psutil>0:sysutils/py-psutil@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pyyaml>0:devel/py-pyyaml@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}questionary>0:devel/py-questionary@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}rich>0:textproc/py-rich@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}ruff>0:devel/py-ruff@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}semver>=3.0.2:devel/py-semver@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}tomlkit>0:textproc/py-tomlkit@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}typer>=0.12.5:devel/py-typer@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}typing-extensions>=4.7:devel/py-typing-extensions@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}uv>=0.6.9:devel/py-uv@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}websocket-client>0:www/py-websocket-client@${PY_FLAVOR}
+
+USES=		python
+USE_PYTHON=	pep517 concurrent autoplist
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	Comfy-Org
+
+NO_ARCH=	yes
+
+post-patch: # fix version in pyproject.toml
+	@${REINPLACE_CMD} -e 's|version = "0.0.0"|version = "${DISTVERSION}"|' ${WRKSRC}/pyproject.toml
+
+.include <bsd.port.mk>
diff --git a/misc/comfy-cli/distinfo b/misc/comfy-cli/distinfo
new file mode 100644
index 000000000000..4344bea1da2e
--- /dev/null
+++ b/misc/comfy-cli/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1774123313
+SHA256 (Comfy-Org-comfy-cli-v1.6.0_GH0.tar.gz) = 04d120ff34ab4020fce8ce21502275ae9423099bab2616f8170fa07fc6777aa4
+SIZE (Comfy-Org-comfy-cli-v1.6.0_GH0.tar.gz) = 4501799
diff --git a/misc/comfy-cli/files/patch-comfy__cli_constants.py b/misc/comfy-cli/files/patch-comfy__cli_constants.py
new file mode 100644
index 000000000000..f3a6d2481d4a
--- /dev/null
+++ b/misc/comfy-cli/files/patch-comfy__cli_constants.py
@@ -0,0 +1,25 @@
+--- comfy_cli/constants.py.orig	2026-03-22 01:40:43 UTC
++++ comfy_cli/constants.py
+@@ -6,6 +6,7 @@ class OS(str, Enum):
+     WINDOWS = "windows"
+     MACOS = "macos"
+     LINUX = "linux"
++    FREEBSD = "freebsd"
+ 
+ 
+ class PROC(str, Enum):
+@@ -21,12 +22,14 @@ DEFAULT_COMFY_WORKSPACE = {
+     OS.WINDOWS: os.path.join(os.path.expanduser("~"), "Documents", "comfy", "ComfyUI"),
+     OS.MACOS: os.path.join(os.path.expanduser("~"), "Documents", "comfy", "ComfyUI"),
+     OS.LINUX: os.path.join(os.path.expanduser("~"), "comfy", "ComfyUI"),
++    OS.FREEBSD: os.path.join(os.path.expanduser("~"), "comfy", "ComfyUI"),
+ }
+ 
+ DEFAULT_CONFIG = {
+     OS.WINDOWS: os.path.join(os.path.expanduser("~"), "AppData", "Local", "comfy-cli"),
+     OS.MACOS: os.path.join(os.path.expanduser("~"), "Library", "Application Support", "comfy-cli"),
+     OS.LINUX: os.path.join(os.path.expanduser("~"), ".config", "comfy-cli"),
++    OS.FREEBSD: os.path.join(os.path.expanduser("~"), ".config", "comfy-cli"),
+ }
+ 
+ CONTEXT_KEY_WORKSPACE = "workspace"
diff --git a/misc/comfy-cli/files/patch-comfy__cli_standalone.py b/misc/comfy-cli/files/patch-comfy__cli_standalone.py
new file mode 100644
index 000000000000..4a8e8568972a
--- /dev/null
+++ b/misc/comfy-cli/files/patch-comfy__cli_standalone.py
@@ -0,0 +1,17 @@
+--- comfy_cli/standalone.py.orig	2026-03-22 01:45:24 UTC
++++ comfy_cli/standalone.py
+@@ -68,7 +68,12 @@ def download_standalone_python(
+     """grab a pre-built distro from the python-build-standalone project. See
+     https://gregoryszorc.com/docs/python-build-standalone/main/"""
+     platform = get_os() if platform is None else platform
+     proc = get_proc() if proc is None else proc
+-    target = _platform_targets[(platform, proc)]
++    if (platform, proc) not in _platform_targets:
++        raise NotImplementedError(
++            f"Standalone Python download is not supported on {platform.value}/{proc.value}. "
++            "The python-build-standalone project does not provide builds for this platform."
++        )
++    target = _platform_targets[(platform, proc)]
+ 
+     if tag == "latest":
+         # try to fetch json with info about latest release
diff --git a/misc/comfy-cli/files/patch-comfy__cli_utils.py b/misc/comfy-cli/files/patch-comfy__cli_utils.py
new file mode 100644
index 000000000000..087888127a8f
--- /dev/null
+++ b/misc/comfy-cli/files/patch-comfy__cli_utils.py
@@ -0,0 +1,21 @@
+--- comfy_cli/utils.py.orig	2026-03-22 01:45:24 UTC
++++ comfy_cli/utils.py
+@@ -49,6 +49,8 @@ def get_os():
+         return OS.WINDOWS
+     elif platform_system == "linux":
+         return OS.LINUX
++    elif platform_system == "freebsd":
++        return OS.FREEBSD
+     else:
+         raise ValueError(f"Running on unsupported os {platform.system()}")
+ 
+@@ -57,5 +59,7 @@ def get_proc():
+ 
+     if proc == "x86_64" or proc == "AMD64":
+         return PROC.X86_64
++    elif proc == "amd64":
++        return PROC.X86_64
+     elif "arm" in proc:
+         return PROC.ARM
+     else:
+ 
diff --git a/misc/comfy-cli/files/patch-comfy__cli_workspace_manager.py b/misc/comfy-cli/files/patch-comfy__cli_workspace_manager.py
new file mode 100644
index 000000000000..89a1f1e6aaab
--- /dev/null
+++ b/misc/comfy-cli/files/patch-comfy__cli_workspace_manager.py
@@ -0,0 +1,13 @@
+--- comfy_cli/workspace_manager.py.orig	2026-03-22 01:45:24 UTC
++++ comfy_cli/workspace_manager.py
+@@ -260,9 +260,9 @@ class WorkspaceManager:
+         if self.use_recent is None:
+             recent_workspace = self.config_manager.get(constants.CONFIG_KEY_RECENT_WORKSPACE)
+             if recent_workspace and check_comfy_repo(recent_workspace)[0]:
+                 return recent_workspace, WorkspaceType.RECENT
+-            else:
++            elif recent_workspace:
+                 print(
+                     f"[bold red]warn: The recent workspace {recent_workspace} is not a valid ComfyUI path.[/bold red]"
+                 )
+ 
diff --git a/misc/comfy-cli/pkg-descr b/misc/comfy-cli/pkg-descr
new file mode 100644
index 000000000000..67749aa95448
--- /dev/null
+++ b/misc/comfy-cli/pkg-descr
@@ -0,0 +1,11 @@
+comfy-cli is a command line tool that helps users easily install and manage
+ComfyUI, a powerful open-source machine learning framework. With comfy-cli,
+you can quickly set up ComfyUI, install packages, and manage custom nodes,
+all from the convenience of your terminal.
+
+Features:
+- Easy installation of ComfyUI with a single command
+- Seamless package management for ComfyUI extensions and dependencies
+- Custom node management for extending ComfyUI's functionality
+- Download checkpoints and save model hashes
+- Support for testing frontend pull requests