mcpField
C
cli-anything-comfyui

cli-anything-comfyui

github.com/hkudsCreative & media57.6k556 installsUpdated 5w ago
Repository

About cli-anything-comfyui

cli-anything-comfyui is a command-line tool for AI agents and power users to manage image-generation workflows through the ComfyUI REST API. It handles queue monitoring, model discovery, and image downloads, with JSON output for agent workflows.

Key features

  1. 01Create and validate workflows
  2. 02Queue and monitor generations
  3. 03Inspect models and node types
  4. 04List and download generated images
  5. 05Check server status and resource usage

Use cases

  1. 01Submit image-generation jobs from a terminal
  2. 02Review pending jobs and execution history
  3. 03Find available models or node types
  4. 04Download images from a specific run

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/hkuds/cli-anything --skill cli-anything-comfyui

After installing, type/cli-anything-comfyuiin Claude Code to confirm it loaded.

Details

From the project README

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.

Installation

This CLI is installed as part of the cli-anything-comfyui package:

pip install cli-anything-comfyui

Prerequisites:

Usage

Basic Commands
# Show help
cli-anything-comfyui --help

# Start interactive REPL mode
cli-anything-comfyui repl

# Check server stats
cli-anything-comfyui system stats

# Run with JSON output (for agent consumption)
cli-anything-comfyui --json system stats
REPL Mode

Start an interactive session for exploratory use:

cli-anything-comfyui repl
# Enter commands interactively with tab-completion and history

Command Groups

Workflow

Workflow management commands.

CommandDescription
listList saved workflows
loadLoad a workflow from a JSON file
validateValidate a workflow JSON against the ComfyUI node graph
Queue

Generation queue management.

CommandDescription
promptQueue a workflow for execution
statusShow current queue status (running and pending)
clearClear the generation queue
historyShow prompt execution history
interruptInterrupt the currently running generation
Models

Model discovery commands.

CommandDescription
checkpointsList available checkpoint models
lorasList available LoRA models
vaesList available VAE models
controlnetsList available ControlNet models
node-infoShow detailed info for a specific node type
list-nodesList all available node types
Images

Generated image management.

CommandDescription
listList generated images on the server
downloadDownload a specific generated image
download-allDownload all images from a prompt execution
System

Server status and information.

CommandDescription
statsShow ComfyUI system statistics (GPU, CPU, memory)
infoShow ComfyUI server info and extensions

Examples

Check System Status
# Server stats
cli-anything-comfyui system stats

# Server info
cli-anything-comfyui system info
Discover Available Models
# List checkpoints
cli-anything-comfyui models checkpoints

# List LoRAs
cli-anything-comfyui models loras

# List all node types
cli-anything-comfyui models list-nodes
Queue and Monitor Generation
# Queue a workflow
cli-anything-comfyui queue prompt --workflow my_workflow.json

# Check queue status
cli-anything-comfyui queue status

# View execution history
cli-anything-comfyui --json queue history
Download Generated Images
# List generated images
cli-anything-comfyui images list

# Download a specific image
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

Output Formats

All commands support dual output modes:

  • Human-readable (default): Tables, colors, formatted text
  • Machine-readable (--json flag): Structured JSON for agent consumption
# Human output
cli-anything-comfyui system stats

# JSON output for agents
cli-anything-comfyui --json system stats

For AI Agents

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

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

Version

1.0.0

Comments

Markdown supported