Communitygithub.com

cli-anything-comfyui

通过ComfyUI REST API管理AI图像生成工作流,专为AI代理和高级用户设计,无需图形界面即可排队工作流、管理模型、下载图像并监控生成队列。

cli-anything-comfyui 是什么?

这是一个基于命令行的AI图像生成工作流管理工具,通过ComfyUI REST API实现与ComfyUI的无缝交互。它的核心价值在于让AI代理和高级用户无需图形界面即可完成工作流排队、模型管理、图像下载和队列监控等操作,特别适合自动化脚本和集成场景。该工具支持多种命令组:工作流管理(列出、加载、验证JSON)、生成队列控制(排队、查看状态、清除历史)、模型发现(检查点、LoRA、VAE、ControlNet等)以及图像管理(列出、下载、批量下载)。输出格式支持人类可读(表格、颜色)和机器可读(--json标志)两种模式,建议AI代理始终使用--json标志以获得可解析的结构化输出。最终,它降低了ComfyUI的运营门槛,使图像生成任务可以完全通过命令行完成,适用于批量处理、自动化流水线和AI代理系统集成。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/HKUDS/CLI-Anything/tree/main/skills/cli-anything-comfyui

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

cli-anything-comfyui 是做什么的?

通过ComfyUI REST API进行AI图像生成工作流管理。专为AI代理和高级用户设计,无需图形界面即可排队工作流、管理模型、下载生成图像并监控生成队列。

安装

此CLI作为cli-anything-comfyui包的一部分安装:

pip install cli-anything-comfyui

先决条件:

用法

基本命令

# 显示帮助
cli-anything-comfyui --help

# 启动交互式REPL模式
cli-anything-comfyui repl

# 检查服务器统计信息
cli-anything-comfyui system stats

# 使用JSON输出运行(供代理使用)
cli-anything-comfyui --json system stats

REPL模式

启动交互式会话以进行探索性使用:

cli-anything-comfyui repl
# 以交互方式输入命令,支持Tab补全和历史记录

命令组

Workflow

工作流管理命令。

命令描述
list列出已保存的工作流
load从JSON文件加载工作流
validate根据ComfyUI节点图验证工作流JSON

Queue

生成队列管理。

命令描述
prompt排队一个工作流以供执行
status显示当前队列状态(正在运行和等待中)
clear清除生成队列
history显示提示执行历史
interrupt中断当前正在运行的生成

Models

模型发现命令。

命令描述
checkpoints列出可用的检查点模型
loras列出可用的LoRA模型
vaes列出可用的VAE模型
controlnets列出可用的ControlNet模型
node-info显示特定节点类型的详细信息
list-nodes列出所有可用的节点类型

Images

生成的图像管理。

命令描述
list列出服务器上生成的图像
download下载特定的生成图像
download-all下载某个提示执行的所有图像

System

服务器状态和信息。

命令描述
stats显示ComfyUI系统统计信息(GPU、CPU、内存)
info显示ComfyUI服务器信息和扩展

示例

检查系统状态

# 服务器统计信息
cli-anything-comfyui system stats

# 服务器信息
cli-anything-comfyui system info

发现可用模型

# 列出检查点
cli-anything-comfyui models checkpoints

# 列出LoRA
cli-anything-comfyui models loras

# 列出所有节点类型
cli-anything-comfyui models list-nodes

排队并监控生成

# 排队一个工作流
cli-anything-comfyui queue prompt --workflow my_workflow.json

# 检查队列状态
cli-anything-comfyui queue status

# 查看执行历史
cli-anything-comfyui --json queue history

下载生成的图像

# 列出生成的图像
cli-anything-comfyui images list

# 下载特定图像
cli-anything-comfyui images download --filename ComfyUI_00001_.png --output ./out.png

# 下载某个提示的所有图像
cli-anything-comfyui images download-all --prompt-id <id> --output-dir ./outputs

输出格式

所有命令均支持双输出模式:

  • 人类可读(默认):表格、颜色、格式化文本
  • 机器可读(--json标志):结构化JSON,供代理使用
# 人类输出
cli-anything-comfyui system stats

# 供代理使用的JSON输出
cli-anything-comfyui --json system stats

对于AI代理

以编程方式使用此CLI时:

  1. 始终使用 --json 标志 以获得可解析的输出
  2. 检查返回码 - 0表示成功,非零表示错误
  3. 解析stderr 以获取失败时的错误信息
  4. 使用绝对路径 进行所有文件操作
  5. 验证ComfyUI正在运行,在执行其他命令前使用 system stats

更多信息

  • 完整文档:参见包中的README.md
  • 测试覆盖:参见包中的TEST.md
  • 方法论:参见cli-anything-plugin中的HARNESS.md

版本

1.0.0

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cli-anything-adguardhome

>-

cli-anything-anygen

>-

cli-anything-audacity

>-

cli-anything-blender

>-

cli-anything-browser

Browser automation CLI using DOMShell MCP server. Maps Chrome

cli-anything-calibre

>-

cli-anything-ccswitch

CLI interface for CC Switch — manage AI coding tool configurations from the terminal

cli-anything-chromadb

>-

cli-anything-cloudanalyzer

Command-line interface for CloudAnalyzer — Agent-friendly harness for CloudAnalyzer, a QA platform for mapping, localization, and perception outputs. Supports 27 commands across 8 groups: point cloud evaluation, trajectory evaluation, ground segmentation QA, config-driven quality gates, baseline evolution, processing, visualization, and interactive REPL.

cli-anything-cloudcompare

Command-line interface for CloudCompare — Agent-friendly harness for CloudCompare, the open-source 3D point cloud and mesh processing software. Supports 41 commands across 9 groups: project management, session control, point cloud operations (subsample, filter, segment, analyze), mesh operations, distance computation (C2C, C2M), transformations (ICP, matrix), export (LAS/LAZ/PLY/PCD/OBJ/STL/E57), and interactive REPL.

cli-anything-dify-workflow

Wrapper for the Dify workflow DSL CLI. Create, inspect, validate, edit, and export Dify workflow files through a CLI-Anything harness.

cli-anything-drawio

>-

cli-anything-eez-studio

Use EEZ Studio from the command line: inspect and modify native .eez-project files, edit LVGL screens/widgets, manage SCPI commands, and invoke the real EEZ Studio backend for LVGL builds.

cli-anything-eth2-quickstart

>-

cli-anything-exa

>-

cli-anything-firefly-iii

Firefly III CLI - Personal finance management via CLI-Anything

cli-anything-freecad

Complete CLI harness for FreeCAD parametric 3D CAD modeler (258 commands). Covers ALL workbenches: Part (29 primitives + boolean + mirror + loft + sweep), Sketcher (26 cmds: geometry + constraints + editing), PartDesign (38 cmds: pad/pocket/groove/fillet/chamfer/patterns/hole/datum), Assembly (11 cmds), Mesh (16 cmds), TechDraw (15 cmds: views + dimensions + PDF/SVG), Draft (33 cmds: 2D shapes + arrays + transforms), FEM (12 cmds), CAM/CNC (10 cmds), Surface (6 cmds), Spreadsheet (7 cmds), Import (13 formats), Export (17 formats), Measure (12 cmds), Materials (21 presets). Headless FreeCAD export to STEP/IGES/STL/OBJ/DXF/PDF/glTF/3MF.

cli-anything-gimp

>-

cli-anything-godot

>-

cli-anything-inkscape

>-

相关技能