Communitygithub.com

cli-anything-comfyui

透過 ComfyUI REST API 進行 AI 圖像生成工作流程管理。專為 AI 代理和進階使用者設計,無需圖形介面即可排隊工作流程、管理模型、下載生成圖像及監控生成佇列。

cli-anything-comfyui 是什麼?

cli-anything-comfyui 是一個命令列工具,讓 AI 代理和進階使用者能透過 ComfyUI 的 REST API 直接管理 AI 圖像生成流程。它支援多種命令群組,包括工作流程管理(列出、載入、驗證)、生成佇列控制(排程、狀態、清除、中斷)、模型探索(檢查點、LoRA、VAE、ControlNet)、圖像下載以及伺服器系統監控(GPU、CPU、記憶體)。此工具可在任何支援 Python 3.10+ 的平台上運作,並要求 ComfyUI 在 http://localhost:8188 上執行。它提供人類可讀與機器可讀(--json)雙重輸出模式,特別適合整合至 CI/CD 管道或自動化腳本中,讓使用者無需開啟網頁介面即可高效操作。

相容平台~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
# 以標籤補全和歷史記錄互動輸入指令

指令群組

工作流程 (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. 在其他指令前先使用 system stats 驗證 ComfyUI 是否在執行

更多資訊

  • 完整文件:請參閱套件中的 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

>-

相關技能