cli-anything-comfyui
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecli-anything-comfyui
cli-anything-comfyui
AI image generation workflow management via the ComfyUI REST API. Designed for AI agents and power users who need to queue workflows, manage models, download generated images, and monitor the generation queue without a GUI.
通过ComfyUI REST API管理AI图像生成工作流。专为需要在无GUI环境下排队工作流、管理模型、下载生成的图像以及监控生成队列的AI Agent和高级用户设计。
Installation
安装
This CLI is installed as part of the cli-anything-comfyui package:
bash
pip install cli-anything-comfyuiPrerequisites:
- Python 3.10+
- ComfyUI must be installed and running at http://localhost:8188
该CLI作为cli-anything-comfyui包的一部分进行安装:
bash
pip install cli-anything-comfyui前置要求:
- Python 3.10+
- ComfyUI必须已安装并在 http://localhost:8188 运行
Usage
使用方法
Basic Commands
基础命令
bash
undefinedbash
undefinedShow help
显示帮助
cli-anything-comfyui --help
cli-anything-comfyui --help
Start interactive REPL mode
启动交互式REPL模式
cli-anything-comfyui repl
cli-anything-comfyui repl
Check server stats
查看服务器状态
cli-anything-comfyui system stats
cli-anything-comfyui system stats
Run with JSON output (for agent consumption)
以JSON格式输出(供Agent调用)
cli-anything-comfyui --json system stats
undefinedcli-anything-comfyui --json system stats
undefinedREPL Mode
REPL模式
Start an interactive session for exploratory use:
bash
cli-anything-comfyui repl启动交互式会话用于探索性操作:
bash
cli-anything-comfyui replEnter commands interactively with tab-completion and history
交互式输入命令,支持自动补全和历史记录
undefinedundefinedCommand Groups
命令组
Workflow
Workflow(工作流)
Workflow management commands.
| Command | Description |
|---|---|
| List saved workflows |
| Load a workflow from a JSON file |
| Validate a workflow JSON against the ComfyUI node graph |
工作流管理命令。
| 命令 | 描述 |
|---|---|
| 列出已保存的工作流 |
| 从JSON文件加载工作流 |
| 验证工作流JSON是否符合ComfyUI节点图规范 |
Queue
Queue(队列)
Generation queue management.
| Command | Description |
|---|---|
| Queue a workflow for execution |
| Show current queue status (running and pending) |
| Clear the generation queue |
| Show prompt execution history |
| Interrupt the currently running generation |
生成队列管理命令。
| 命令 | 描述 |
|---|---|
| 将工作流加入队列等待执行 |
| 显示当前队列状态(运行中与待处理任务) |
| 清空生成队列 |
| 显示提示词执行历史 |
| 中断当前正在运行的生成任务 |
Models
Models(模型)
Model discovery commands.
| Command | Description |
|---|---|
| List available checkpoint models |
| List available LoRA models |
| List available VAE models |
| List available ControlNet models |
| Show detailed info for a specific node type |
| List all available node types |
模型查询命令。
| 命令 | 描述 |
|---|---|
| 列出可用的Checkpoint模型 |
| 列出可用的LoRA模型 |
| 列出可用的VAE模型 |
| 列出可用的ControlNet模型 |
| 显示特定节点类型的详细信息 |
| 列出所有可用的节点类型 |
Images
Images(图像)
Generated image management.
| Command | Description |
|---|---|
| List generated images on the server |
| Download a specific generated image |
| Download all images from a prompt execution |
生成图像管理命令。
| 命令 | 描述 |
|---|---|
| 列出服务器上的生成图像 |
| 下载指定的生成图像 |
| 下载某次提示词执行生成的所有图像 |
System
System(系统)
Server status and information.
| Command | Description |
|---|---|
| Show ComfyUI system statistics (GPU, CPU, memory) |
| Show ComfyUI server info and extensions |
服务器状态与信息查询命令。
| 命令 | 描述 |
|---|---|
| 显示ComfyUI系统统计信息(GPU、CPU、内存) |
| 显示ComfyUI服务器信息及扩展 |
Examples
示例
Check System Status
检查系统状态
bash
undefinedbash
undefinedServer stats
服务器统计信息
cli-anything-comfyui system stats
cli-anything-comfyui system stats
Server info
服务器信息
cli-anything-comfyui system info
undefinedcli-anything-comfyui system info
undefinedDiscover Available Models
查询可用模型
bash
undefinedbash
undefinedList checkpoints
列出Checkpoint模型
cli-anything-comfyui models checkpoints
cli-anything-comfyui models checkpoints
List LoRAs
列出LoRA模型
cli-anything-comfyui models loras
cli-anything-comfyui models loras
List all node types
列出所有节点类型
cli-anything-comfyui models list-nodes
undefinedcli-anything-comfyui models list-nodes
undefinedQueue and Monitor Generation
排队并监控生成任务
bash
undefinedbash
undefinedQueue a workflow
将工作流加入队列
cli-anything-comfyui queue prompt --workflow my_workflow.json
cli-anything-comfyui queue prompt --workflow my_workflow.json
Check queue status
检查队列状态
cli-anything-comfyui queue status
cli-anything-comfyui queue status
View execution history
查看执行历史
cli-anything-comfyui --json queue history
undefinedcli-anything-comfyui --json queue history
undefinedDownload Generated Images
下载生成图像
bash
undefinedbash
undefinedList generated images
列出生成图像
cli-anything-comfyui images list
cli-anything-comfyui images list
Download a specific image
下载指定图像
cli-anything-comfyui images download --filename ComfyUI_00001_.png --output ./out.png
cli-anything-comfyui images download --filename ComfyUI_00001_.png --output ./out.png
Download all images from a prompt
下载某次提示词生成的所有图像
cli-anything-comfyui images download-all --prompt-id <id> --output-dir ./outputs
undefinedcli-anything-comfyui images download-all --prompt-id <id> --output-dir ./outputs
undefinedOutput Formats
输出格式
All commands support dual output modes:
- Human-readable (default): Tables, colors, formatted text
- Machine-readable (flag): Structured JSON for agent consumption
--json
bash
undefined所有命令支持两种输出模式:
- 人类可读格式(默认):表格、彩色文本、格式化内容
- 机器可读格式(参数):结构化JSON,供Agent调用
--json
bash
undefinedHuman output
人类可读输出
cli-anything-comfyui system stats
cli-anything-comfyui system stats
JSON output for agents
供Agent调用的JSON输出
cli-anything-comfyui --json system stats
undefinedcli-anything-comfyui --json system stats
undefinedFor AI Agents
针对AI Agent的使用说明
When using this CLI programmatically:
- Always use flag for parseable output
--json - Check return codes - 0 for success, non-zero for errors
- Parse stderr for error messages on failure
- Use absolute paths for all file operations
- Verify ComfyUI is running with before other commands
system stats
以编程方式使用该CLI时:
- 始终使用参数以获取可解析的输出
--json - 检查返回码 - 0表示成功,非0表示错误
- 解析stderr以获取失败时的错误信息
- 文件操作使用绝对路径
- 执行其他命令前,先通过验证ComfyUI是否运行
system stats
More Information
更多信息
- Full documentation: See README.md in the package
- Test coverage: See TEST.md in the package
- Methodology: See HARNESS.md in the cli-anything-plugin
- 完整文档:查看包中的README.md
- 测试覆盖率:查看包中的TEST.md
- 实现方法:查看cli-anything-plugin中的HARNESS.md
Version
版本
1.0.0
1.0.0