Comfy-Org/comfy-cli
CLI for using ComfyUI
What comfy‑cli does
comfy‑cli 是一个基于 Python 的命令行界面,旨在帮助您安装、运行和扩展 ComfyUI。ComfyUI 是一个用于使用 AI 模型(例如 Stable Diffusion, Flux, DALL·E 等)生成图像、视频和其他媒体的开源引擎。
与其手动克隆 ComfyUI 仓库、安装 Python 依赖项并处理 JSON 工作流文件,不如直接输入简单的命令,如 comfy install、comfy run 或 comfy generate。
Core capabilities
| Feature | What it means for you |
|---|---|
| One‑command install & launch | comfy setup (或 comfy install + comfy launch) 会一步到位地下载最新的 ComfyUI 代码、其管理器以及所有必需的 Python 包。 |
| Direct model calls | comfy generate 可以直接与合作伙伴的图像/视频节点(Flux, DALL·E, Stability AI 等)通信,而无需您手动创建 UI 工作流 JSON。 |
| Custom node management | 使用命令如 comfy node install <id> 和 comfy node update all 从 Comfy Registry 或 GitHub 安装、更新、快照或二分查找自定义节点包。 |
| Fast dependency resolution | 标志位 --fast-deps 或 --uv-compile 使用 uv 解析器来为所有节点编译单个 lockfile,从而显著加快安装速度。 |
| Model downloading | 通过单个命令从 CivitAI, Hugging Face, 或任何 URL 下载模型。 |
| Run local or cloud workflows | comfy run --workflow file.json --where cloud 会将工作流发送到 Comfy Cloud(无需 GPU)。相同的命令也可用于在本地运行的 ComfyUI 服务器。 |
| Agent‑friendly JSON output | 添加 --json 标志位可以使每个命令输出结构化的数据包,以便基于 LLM 的智能体(Claude, Cursor 等)进行解析和操作。 |
| Cross‑platform | 支持 Windows, macOS 和 Linux;可以通过 virtualenv, conda env, 或通过 pipx 进行安装。 |
| Shell autocomplete | comfy --install-completion 提供所有子命令和选项的 tab 键自动补全。 |
Typical workflow
- Install the CLI –
pip install comfy-cli(Python 3.10+)。 - Set up ComfyUI –
comfy setup(交互式向导) 或comfy install。 - Add nodes or models –
comfy node install comfyui‑impact‑pack或comfy model download <url>。 - Run a generation –
comfy generate --prompt "a cyberpunk city at night"(本地) 或添加--where cloud在托管服务上运行。 - Retrieve results –
comfy download <prompt_id> -o ./outputs。
Why it matters
ComfyUI 是一个功能强大但手动操作繁重的平台,用于 AI 驱动的媒体创作。comfy‑cli 移除了设置、依赖地狱和仅限 JSON 的工作流执行中的摩擦,使得该引擎可以被开发者、CI 管道和需要以编程方式调用图像生成功能的 AI 智能体轻松使用。
Quick reference (selected commands)
comfy install– 下载 ComfyUI + manager。comfy launch– 启动 UI 服务器 (添加--background以实现后台运行)。comfy generate– 直接从终端调用合作伙伴的模型。comfy run --workflow FILE.json [--where cloud]– 执行保存的工作流。comfy node install <registry‑id>– 添加一个自定义节点包。comfy update all– 刷新 ComfyUI 和所有已安装的节点。comfy cloud login/comfy cloud status– 管理托管的 Comfy Cloud 账户。comfy --json <subcommand>– 为 LLM 智能体提供的机器可读输出。
Who should use it?
- Developers 想要通过脚本实现安装、CI 测试或自动化生成。
- Researchers 需要为生成式媒体实验提供可重复的环境。
- LLM‑powered agents (Claude, Cursor 等) 需要一个稳定的 JSON 接口来驱动图像创作。
- Artists 熟悉终端并希望有一种更快捷的方式来启动 ComfyUI 并访问许多模型提供商。
Where to learn more
- GitHub repository – https://://github.com/Comfy-Org/comfy-cli (README, issue tracker, CI status badges)。
- ComfyUI project – https://://github.com/comfyanonymous/ComfyUI (该 CLI 封装-了 ComfyUI 引擎)。
- Comfy Cloud – https://://www.comfy.org/ (通过
--where cloud使用的托管 GPU 服务)。
All details above are taken directly from the project's README; no additional features have been inferred.
相关
- 项目
- 项目
- 项目
- 项目
- 项目