Skip to content

Guide · Agent skill

How to use the ComfyUI Command-Line Control agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

This skill lets an AI agent operate a ComfyUI image generator through a command-line tool instead of the browser interface. It is for people who already run ComfyUI on their own machine and want an agent to queue saved workflows, watch progress and collect finished images. After following this guide you will have the skill installed, know how to confirm the server is reachable, and know how to ask the agent for generations in plain language.

ComfyUI Command-Line ControlHKUDS/CLI-Anything · Apache-2.0

Quick start

  1. 1Confirm requirements. Install Python 3.10 or newer and make sure ComfyUI is running at http://localhost:8188.
  2. 2Download and unzip the skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder.
  3. 3Install the CLI package. Run pip install cli-anything-comfyui in your terminal.
  4. 4Check the server. Run cli-anything-comfyui system stats to confirm ComfyUI responds.
  5. 5Ask in plain language. Request a task such as queuing a saved workflow, naming the full file path.
  6. 6Collect the results. Ask the agent to check queue status and history, then download images to an output folder.

What an agent skill is and what this one does

An agent skill is a folder containing a SKILL.md file that tells an AI agent when and how to use a tool. This skill's SKILL.md describes a command-line interface, cli-anything-comfyui, that talks to the ComfyUI REST API.

With the skill available, the agent can check the server, list checkpoint, LoRA, VAE and ControlNet models and node types, load and validate workflow JSON files, submit workflows to the generation queue, check queue status and history, interrupt a running generation, and download generated images to a folder.

  • Works only with a ComfyUI server running at http://localhost:8188
  • Output can be requested as JSON so the agent can parse results
  • The skill does not generate images on its own and does not manage cloud image services

Install the skill from the ZIP

Download the ZIP for this skill from this page and unzip it. The folder contains SKILL.md. Choose one of two locations depending on how you want to use it: a personal skills folder at ~/.claude/skills/ makes the skill available across your projects, while a project folder at .claude/skills/ inside a specific project limits it to that project.

If you use the Claude apps instead of a local setup, you can upload the skill under Settings → Capabilities → Skills.

  • Personal: unzip into ~/.claude/skills/
  • Per project: unzip into .claude/skills/ in the project root
  • Claude apps: Settings → Capabilities → Skills

Install the command-line package and check ComfyUI

The skill calls a command-line tool that is distributed as a pip package. You need Python 3.10 or newer, and ComfyUI must already be installed and running at http://localhost:8188 before any command will return useful results.

Install the package, then confirm both the tool and the server respond. The system stats command is the check the source recommends before any other command.

  • Requirements: Python 3.10+, ComfyUI installed and running at http://localhost:8188
  • If the stats command fails, start ComfyUI first; the tool cannot generate images without it
pip install cli-anything-comfyui cli-anything-comfyui system stats

Trigger the skill with natural requests

You do not need to type commands yourself. Once the skill is installed, ask the agent for what you want in plain language and mention ComfyUI so the agent knows which tool to use. The agent chooses the matching commands from the skill's command groups.

Be specific about the workflow file and the output location. The source says to use absolute paths for file operations, so giving the agent a full path avoids ambiguity.

  • Check that ComfyUI is running and report GPU and memory stats
  • List the checkpoint models I have installed in ComfyUI
  • Queue /home/me/workflows/portrait.json in ComfyUI and tell me when it finishes
  • Download all images from prompt ID <id> into /home/me/outputs

Run the commands yourself

You can also run the commands directly, which is useful for testing or for scripts. Help is available with --help, and the repl subcommand starts an interactive session with tab-completion and history.

The --json flag switches any command to structured output. The source shows the prompt, status, history and image download commands used in this way.

  • cli-anything-comfyui --help shows available commands
  • cli-anything-comfyui repl starts interactive mode
  • cli-anything-comfyui queue prompt --workflow my_workflow.json queues a workflow
  • cli-anything-comfyui queue status shows running and pending items
  • cli-anything-comfyui --json queue history returns history as JSON
  • cli-anything-comfyui images download --filename ComfyUI_00001_.png --output ./out.png saves one image
  • cli-anything-comfyui images download-all --prompt-id <id> --output-dir ./outputs saves every image from a prompt
cli-anything-comfyui queue prompt --workflow my_workflow.json cli-anything-comfyui queue status cli-anything-comfyui --json queue history cli-anything-comfyui images download-all --prompt-id <id> --output-dir ./outputs

Safety notes: scripts and network access

This skill runs scripts and uses the network. The network use is to the local ComfyUI REST API at localhost:8188, as described in the source. Review the SKILL.md and the package before installing, and be aware that an agent running commands can queue work, interrupt generations and clear the queue.

The source's agent guidance asks the agent to check return codes, read stderr on failure and verify the server before other commands. Keep those behaviours in mind when you give the agent broad instructions.

  • Runs scripts: yes
  • Uses network: yes, to the local ComfyUI API only as described in the source
  • Commands such as queue clear and interrupt change the state of the queue

Tips for reliable results

Always verify the server first. If results look wrong, ask the agent to run system stats before anything else. For agent use, JSON output is the recommended format.

Keep workflow files as JSON that you have already tested in the ComfyUI interface, and use validate on them before queuing. Use absolute paths for input and output.

  • Run system stats before other commands
  • Validate workflow JSON before queuing it
  • Request JSON output for anything the agent must parse
  • Use absolute paths for workflows and output folders

What people use it for

  • Queue a saved portrait or landscape workflow overnight and download the finished PNGs to a folder
  • Check which checkpoint and LoRA models are installed before choosing settings for a batch
  • Build a scripted pipeline that calls the CLI with --json and parses the history output
  • Monitor a long generation queue and interrupt a run that has gone wrong

Frequently asked questions

How do I install the ComfyUI agent skill?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use or .claude/skills/ inside a project. In the Claude apps you can upload it under Settings → Capabilities → Skills. Separately, install the command-line tool with pip install cli-anything-comfyui.

What do I need to run it?

The source lists Python 3.10 or newer, the pip package cli-anything-comfyui, and ComfyUI installed and running at http://localhost:8188. The skill does not generate images without a running ComfyUI server.

Is the skill free?

The source states the project is licensed under Apache-2.0. It does not describe pricing, so check the repository for licence terms before using it commercially.

Does it work with cloud image generators?

No. The source says the tool only targets a local ComfyUI REST API at localhost:8188 and is not meant to manage cloud image services.

Why does the command fail with a connection error?

The most likely cause is that ComfyUI is not running at http://localhost:8188. Start ComfyUI and run cli-anything-comfyui system stats again. The source recommends this check before other commands.

How is this different from using the ComfyUI browser interface?

The skill lets an agent or terminal user queue workflows, monitor history and download images without the graphical interface. The source notes that all commands offer a human-readable mode and a JSON mode for agents.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits people who already run ComfyUI locally and want an agent or script to queue workflows and collect images from the terminal. It is not a good fit if you lack a local ComfyUI installation with a capable GPU, or if you want a hosted image service.

Download the skill