
ComfyUI CLI
FreeManage AI image generation workflows from the command line.
Free · Opens the source repo
What ComfyUI CLI does
The ComfyUI CLI is a command-line interface designed for managing AI image generation workflows through the ComfyUI REST API. It is particularly useful for AI agents and power users who prefer a non-GUI environment for queuing workflows, managing models, and monitoring image generation. With this CLI, users can efficiently handle tasks such as downloading generated images and checking the status of their generation queue.
This tool is installed via pip and requires Python 3.10 or higher, along with a running instance of ComfyUI. Once set up, users can access a variety of commands organized into groups such as Workflow, Queue, Models, Images, and System. Each command serves a specific purpose, allowing users to list workflows, queue tasks, check system stats, and manage generated images seamlessly.
The CLI also features an interactive REPL mode for exploratory use, providing tab-completion and command history. For programmatic use, it supports dual output formats—human-readable and machine-readable JSON—making it suitable for integration with other tools and scripts. This flexibility makes it a powerful option for developers looking to automate their image generation processes without relying on a graphical interface.
Overall, the ComfyUI CLI is an essential tool for anyone working extensively with ComfyUI, enabling streamlined workflow management and enhanced productivity in AI image generation tasks.
When to use it
Use this CLI when you need to manage AI image generation tasks programmatically or prefer command-line operations over GUI.
When not to use it
This tool is not suitable for users who require a graphical interface or are unfamiliar with command-line operations.
What you can build with it
Queue Image Generation
Use the CLI to queue a workflow for image generation by specifying a JSON file.
Monitor Generation Status
Check the current status of your generation queue and view execution history directly from the command line.
Download Generated Images
List and download specific generated images or all images from a prompt execution easily.
How to install ComfyUI CLI
View source1. Install with the skills CLI
npx skills add hkuds/cli-anything/skills --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by hkudscli-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:
- Python 3.10+
- ComfyUI must be installed and running at http://localhost:8188
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.
| Command | Description |
|---|---|
list | List saved workflows |
load | Load a workflow from a JSON file |
validate | Validate a workflow JSON against the ComfyUI node graph |
Queue
Generation queue management.
| Command | Description |
|---|---|
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 |
Models
Model discovery commands.
| Command | Description |
|---|---|
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 |
Images
Generated image management.
| Command | Description |
|---|---|
list | List generated images on the server |
download | Download a specific generated image |
download-all | Download all images from a prompt execution |
System
Server status and information.
| Command | Description |
|---|---|
stats | Show ComfyUI system statistics (GPU, CPU, memory) |
info | Show 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 (
--jsonflag): 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:
- Always use
--jsonflag for parseable output - 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
system statsbefore 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
Frequently asked questions about ComfyUI CLI
Similar skills
AI Studio Image
Generate realistic human-like images effortlessly.
Image Generation
Generate high-quality images from structured prompts.
ComfyUI Gateway
Efficiently manage ComfyUI image generation workflows.
ComfyUI
Generate images, video, audio, and 3D content effortlessly.
Inference.sh CLI
Run 150+ AI apps effortlessly from the terminal.
Luma Image Generation
Effortlessly generate images using Luma AI's Photon model.
