comfyui-cli
comfyui-cli 是一个面向 ComfyUI 的命令行工具,用来通过终端完成工作流执行、模型查询、队列管理、节点信息查看以及基础生成任务。
它面向已运行中的 ComfyUI 服务,适合通过 HTTP/API 在终端里执行工作流、查询模型与节点信息,并进行基础生成任务。
功能概览
- 执行与校验 ComfyUI 工作流
- 查看模型、节点、队列、历史记录与系统状态
- 支持
txt2img、img2img、LoRA 与风格化生成辅助命令 - 支持
--json机器可读输出 - 提供可安装的命令入口:
comfyui-cli
安装
从 PyPI 安装
pip install comfyui-cli
安装完成后,可通过以下命令检查是否可用:
comfyui-cli --version
从源码安装(可选)
如果你已经拿到源码,可以在源码目录执行:
python -m pip install -e .
如果你需要开发、测试或重新打包发布,可以安装开发依赖:
python -m pip install -r requirements-dev.txt
前置条件
需要先启动一个正在运行的 ComfyUI 服务器(默认:http://127.0.0.1:8188)。
python main.py --listen 127.0.0.1 --port 8188
快速开始
# 检查服务连通性
comfyui-cli system ping
# 列出 checkpoints
comfyui-cli models list checkpoints
# 执行工作流
comfyui-cli workflow run my_workflow.json --save-to ./output
# 输出 JSON
comfyui-cli --json system stats
常用场景
校验工作流
comfyui-cli workflow validate my_workflow.json
查看模型类型
comfyui-cli models types
查看节点列表
comfyui-cli nodes list
执行 txt2img
comfyui-cli generate txt2img --prompt "a cat" --checkpoint "model.safetensors"
常用命令
comfyui-cli workflow validate <file>
comfyui-cli workflow info <file>
comfyui-cli queue status
comfyui-cli models types
comfyui-cli nodes list
comfyui-cli history list
comfyui-cli generate txt2img --prompt "a cat" --checkpoint "model.safetensors"
项目结构
.
├── README.md
├── COMFYUI.md
├── LICENSE
├── setup.py
└── comfyui/
├── comfyui_cli.py
├── core/
├── utils/
└── tests/
测试
运行核心单元测试:
pytest comfyui/tests/test_core.py -v
如果需要连接真实 ComfyUI 服务执行 E2E 测试:
export COMFYUI_TEST_SERVER=127.0.0.1:8188
export COMFYUI_TEST_CHECKPOINT=your_model.safetensors
pytest comfyui/tests/test_full_e2e.py -v
相关文档
COMFYUI.md:ComfyUI API 与命令映射说明
License
MIT
Metadata
Release files for comfyui-cli 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| comfyui_cli-0.1.1.tar.gz | 35.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| comfyui_cli-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 73.2 kB
Release files / comfyui_cli-0.1.1.tar.gz
| Download URL | comfyui_cli-0.1.1.tar.gz |
|---|---|
| Size | 35.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a8ac0058021eed118efa3a27e1c956b918e5ad473c588ac3bf49f344b7841631
|
|
BLAKE2b-256 checksum How to use checksums |
5cafe612118dc38cf68d53f3d336dd738056f05472e3eb79eefa1ef064f4efa1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Release files / comfyui_cli-0.1.1-py3-none-any.whl
| Download URL | comfyui_cli-0.1.1-py3-none-any.whl |
|---|---|
| Size | 37.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9ee0c623006fb6eab3d1c67025d53bdd621df0a9cc9a94451712c94fdc4f929c
|
|
BLAKE2b-256 checksum How to use checksums |
030effd1cd41c930019388281b03e38a65c36c9c015acfc3265d1b5f0268abf0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Security for comfyui-cli 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.