cli-anything-comfyui

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

cli-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-comfyui
Prerequisites:
该CLI作为cli-anything-comfyui包的一部分进行安装:
bash
pip install cli-anything-comfyui
前置要求:

Usage

使用方法

Basic Commands

基础命令

bash
undefined
bash
undefined

Show 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
undefined
cli-anything-comfyui --json system stats
undefined

REPL Mode

REPL模式

Start an interactive session for exploratory use:
bash
cli-anything-comfyui repl
启动交互式会话用于探索性操作:
bash
cli-anything-comfyui repl

Enter commands interactively with tab-completion and history

交互式输入命令,支持自动补全和历史记录

undefined
undefined

Command Groups

命令组

Workflow

Workflow(工作流)

Workflow management commands.
CommandDescription
list
List saved workflows
load
Load a workflow from a JSON file
validate
Validate a workflow JSON against the ComfyUI node graph
工作流管理命令。
命令描述
list
列出已保存的工作流
load
从JSON文件加载工作流
validate
验证工作流JSON是否符合ComfyUI节点图规范

Queue

Queue(队列)

Generation queue management.
CommandDescription
prompt
Queue a workflow for execution
status
Show current queue status (running and pending)
clear
Clear the generation queue
history
Show prompt execution history
interrupt
Interrupt the currently running generation
生成队列管理命令。
命令描述
prompt
将工作流加入队列等待执行
status
显示当前队列状态(运行中与待处理任务)
clear
清空生成队列
history
显示提示词执行历史
interrupt
中断当前正在运行的生成任务

Models

Models(模型)

Model discovery commands.
CommandDescription
checkpoints
List available checkpoint models
loras
List available LoRA models
vaes
List available VAE models
controlnets
List available ControlNet models
node-info
Show detailed info for a specific node type
list-nodes
List all available node types
模型查询命令。
命令描述
checkpoints
列出可用的Checkpoint模型
loras
列出可用的LoRA模型
vaes
列出可用的VAE模型
controlnets
列出可用的ControlNet模型
node-info
显示特定节点类型的详细信息
list-nodes
列出所有可用的节点类型

Images

Images(图像)

Generated image management.
CommandDescription
list
List generated images on the server
download
Download a specific generated image
download-all
Download all images from a prompt execution
生成图像管理命令。
命令描述
list
列出服务器上的生成图像
download
下载指定的生成图像
download-all
下载某次提示词执行生成的所有图像

System

System(系统)

Server status and information.
CommandDescription
stats
Show ComfyUI system statistics (GPU, CPU, memory)
info
Show ComfyUI server info and extensions
服务器状态与信息查询命令。
命令描述
stats
显示ComfyUI系统统计信息(GPU、CPU、内存)
info
显示ComfyUI服务器信息及扩展

Examples

示例

Check System Status

检查系统状态

bash
undefined
bash
undefined

Server stats

服务器统计信息

cli-anything-comfyui system stats
cli-anything-comfyui system stats

Server info

服务器信息

cli-anything-comfyui system info
undefined
cli-anything-comfyui system info
undefined

Discover Available Models

查询可用模型

bash
undefined
bash
undefined

List 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
undefined
cli-anything-comfyui models list-nodes
undefined

Queue and Monitor Generation

排队并监控生成任务

bash
undefined
bash
undefined

Queue 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
undefined
cli-anything-comfyui --json queue history
undefined

Download Generated Images

下载生成图像

bash
undefined
bash
undefined

List 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
undefined
cli-anything-comfyui images download-all --prompt-id <id> --output-dir ./outputs
undefined

Output Formats

输出格式

All commands support dual output modes:
  • Human-readable (default): Tables, colors, formatted text
  • Machine-readable (
    --json
    flag): Structured JSON for agent consumption
bash
undefined
所有命令支持两种输出模式:
  • 人类可读格式(默认):表格、彩色文本、格式化内容
  • 机器可读格式
    --json
    参数):结构化JSON,供Agent调用
bash
undefined

Human output

人类可读输出

cli-anything-comfyui system stats
cli-anything-comfyui system stats

JSON output for agents

供Agent调用的JSON输出

cli-anything-comfyui --json system stats
undefined
cli-anything-comfyui --json system stats
undefined

For AI Agents

针对AI Agent的使用说明

When using this CLI programmatically:
  1. Always use
    --json
    flag
    for parseable output
  2. Check return codes - 0 for success, non-zero for errors
  3. Parse stderr for error messages on failure
  4. Use absolute paths for all file operations
  5. Verify ComfyUI is running with
    system stats
    before other commands
以编程方式使用该CLI时:
  1. 始终使用
    --json
    参数
    以获取可解析的输出
  2. 检查返回码 - 0表示成功,非0表示错误
  3. 解析stderr以获取失败时的错误信息
  4. 文件操作使用绝对路径
  5. 执行其他命令前,先通过
    system stats
    验证ComfyUI是否运行

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