comfyui-skill-openclaw
Skill405 starsChanged 8 months agoMITView on GitHub
Run registered ComfyUI workflows through the fast comfyui-skill CLI, and use the official local Comfy MCP for live template, node, model, validation, and orchestration capabilities.
- Installs packages
In this repository2 other files it gives its agents.
- docs/llms-full.txtllms.txt
- docs/llms.txtllms.txt
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. About 0 are common, 12 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 61
When the Agent host exposes the official Comfy MCP tools, call those tools directly.
- Distinctive: line 63
When the host does not expose MCP tools but can run shell commands, use the included stdio bridge:
- Distinctive: line 73
Read references/comfy-mcp.md when the request needs MCP discovery, raw-workflow validation, template adaptation, job management, …
- Very specific: line 77
Prefer CLI for a known <server_id>/<workflow_id>.
- Distinctive: line 78
Prefer MCP when the answer depends on the currently installed templates, nodes, models, hardware, or official tool contract.
- Very specific: line 81
Never set confirm_spend=true without the user's explicit approval for that paid call.
- Distinctive: line 118
Never expose node IDs; only use business parameter names (e.g., prompt, style).
- Distinctive: line 119
If multiple workflows match, pick the most relevant one or list candidates.
- Distinctive: line 128
If critical parameters are missing, ask the user (e.g., "What visual style would you like?").
- Distinctive: line 132
Always: run before first execution of a workflow:
- Very specific: line 138
If is_ready is true → proceed to Step 4.
- Very specific: line 139
If is_ready is false:
- Distinctive: line 141
If user agrees to install, run:
- Very specific: line 145
Use source_repo URLs from the check report as --repos values.
- Very specific: line 146
If needs_restart is true, inform the user to restart ComfyUI, then re-check.
- Very specific: line 174
Run status as a standalone bash command.
- Distinctive: line 175
Read the returned JSON.
- Very specific: line 176
If queued or running: send a text message to the user with progress, then run status again.
- Very specific: line 177
If success: proceed to Step 5.
- Very specific: line 178
If error: report the error.
- Distinctive: line 190
Use your native capabilities to present the files to the user (e.g., image preview, file path).
- Distinctive: line 196
When the user wants to add new workflows (not execute existing ones):
- Distinctive: line 204
After import, check dependencies before first execution.
- Very specific: line 210
ComfyUI Offline: Run comfyui-skill --json server status.
- Very specific: line 211
Workflow Not Found: Run comfyui-skill --json list to see available workflows.
- Very specific: line 212
Parameter Format Error: Ensure --args is valid JSON wrapped in single quotes.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ComfyUI Agent SKILL
Prerequisites: Install the CLI:
pip install -U comfyui-skill-cli. The official local Comfy MCP is optional and should be connected using the official guide when MCP capabilities are needed. All shell commands must run from this project's root directory (where thisSKILL.mdis located).[!IMPORTANT] Directory Sensitivity: The CLI reads
config.jsonanddata/from the current directory. You MUSTcdinto the project root before running any command. Symptom:listreturns[]orserver statusreports not found → you are in the wrong directory.
Quick Decision
- A matching registered workflow exists → use the CLI Execution Flow (Step 1-4). This is the default for repeated, batch, and latency-sensitive work.
- The request has no matching workflow, or requires live template/model/node discovery → use the official local Comfy MCP.
- The user supplies a raw workflow that needs real environment validation → use MCP
validate_workflow; use CLIrun --validatefor a registered workflow. - The user asks to install nodes, download models, restart, update, or switch versions → use MCP only after explaining the effect and getting confirmation.
- User says "generate image / draw a picture" → first inspect registered workflows; if none fit, discover a current MCP template instead of guessing a model name.
- User says "import workflow / add workflow" →
comfyui-skill --json workflow import <path> - User says "img2img / use this image" → first
comfyui-skill --json upload <image>, then execute - User says "inpainting / mask this area" →
comfyui-skill --json upload <mask> --mask, then execute - User says "show previous results" →
comfyui-skill --json history list <id> - User says "what failed / check job status" →
comfyui-skill --json jobs list --status failed - User says "which server has more VRAM" →
comfyui-skill --json server stats --all - User says "what nodes are available" → use MCP
nodesfor live ecosystem discovery; usecomfyui-skill --json nodes listwhen only the CLI inventory is needed. - User says "dry run / test without executing" →
comfyui-skill --json run <id> --validate - User says "open management UI" →
python3 ./ui/open_ui.py
Core Concepts
- Skill ID:
<server_id>/<workflow_id>(e.g.,local/txt2img). If server is omitted, the default server is used. - Schema: Each workflow has a
schema.jsonthat maps business parameter names (e.g.,prompt,seed) to internal ComfyUI node fields. Never expose node IDs to the user. - Server: One or more ComfyUI instances configured in
config.json. Check health withserver status. - Two interfaces, one Skill: CLI is the efficient execution path for known workflows. Official MCP is the adaptive path for discovering and orchestrating the current ComfyUI ecosystem. They share the same business intent and must not submit the same job twice.
Official Local Comfy MCP
When the Agent host exposes the official Comfy MCP tools, call those tools directly. Start every MCP flow with server_info and use the live tool schemas instead of assuming parameters or tool availability.
When the host does not expose MCP tools but can run shell commands, use the included stdio bridge:
python ./scripts/comfy_mcp.py probe
python ./scripts/comfy_mcp.py tools
python ./scripts/comfy_mcp.py call search_templates --arguments '{"query":"background removal"}'The bridge reads mcp_command, mcp_args, mcp_python, mcp_cwd, and mcp_env from the selected server in config.json. probe and tools are read-only. A call has the side effects of the named official tool.
Read references/comfy-mcp.md when the request needs MCP discovery, raw-workflow validation, template adaptation, job management, installation, lifecycle control, or partner models.
Routing invariants:
- Prefer CLI for a known
<server_id>/<workflow_id>; MCP is not a mandatory extra hop. - Prefer MCP when the answer depends on the currently installed templates, nodes, models, hardware, or official tool contract.
- For long MCP runs:
run_workflow(wait=false)orrun_template(wait=false)->job(action="wait"|"status")->fetch_outputs. - Once either path returns a
prompt_id, continue polling that path. Never fall back by submitting again. - Never set
confirm_spend=truewithout the user's explicit approval for that paid call.
Command Reference
| Command | Purpose |
comfyui-skill --json server status | Check if ComfyUI server is online |
comfyui-skill --json server stats | Show VRAM, RAM, GPU, versions (--all for multi-server) |
comfyui-skill --json list | List all available workflows and parameters |
comfyui-skill --json info <id> | Show workflow details and parameter schema |
comfyui-skill --json submit <id> --args '{...}' | Submit a workflow (non-blocking) |
comfyui-skill --json status <prompt_id> | Check execution status |
comfyui-skill --json run <id> --args '{...}' | Execute a workflow (blocking, real-time streaming) |
comfyui-skill --json run <id> --validate | Validate workflow without executing |
comfyui-skill --json upload <path> | Upload image to ComfyUI (for img2img workflows) |
comfyui-skill --json upload <path> --mask | Upload mask image (for inpainting workflows) |
comfyui-skill --json nodes list | List all available ComfyUI nodes |
comfyui-skill --json jobs list | List server-side job history (--status failed to filter) |
comfyui-skill --json deps check <id> | Check missing dependencies |
comfyui-skill --json deps install <id> --repos '[...]' | Install missing custom nodes |
comfyui-skill --json workflow import <path> | Import workflow (auto-detect, warns about deprecated nodes) |
comfyui-skill --json history list <id> | List execution history for a workflow |
Execution Flow
Step 1: Query Available Workflows
comfyui-skill --json listReturns a JSON array of all enabled workflows with their parameters.
required: trueparameters → ask the user if not provided.required: falseparameters → infer from context (e.g.,seed= random number), or omit.- Never expose node IDs; only use business parameter names (e.g., prompt, style).
- If multiple workflows match, pick the most relevant one or list candidates.
Step 2: Parameter Assembly
Assemble parameters into a JSON string. Example:
{"prompt": "A beautiful landscape, high quality, masterpiece", "seed": 40128491}If critical parameters are missing, ask the user (e.g., "What visual style would you like?").
Step 3: Pre-flight Dependency Check
Always run before first execution of a workflow:
comfyui-skill --json deps check <server_id>/<workflow_id>- If
is_readyistrue→ proceed to Step 4. - If
is_readyisfalse:- Present missing nodes and models to the user.
- If user agrees to install, run:
Usecomfyui-skill --json deps install <id> --repos '["https://github.com/repo1"]'source_repoURLs from the check report as--reposvalues. - If
needs_restartistrue, inform the user to restart ComfyUI, then re-check. - Missing models must be downloaded manually — tell the user which folder to place them in (e.g.,
checkpoints).
Step 4: Execute the Workflow
Note: JSON args must be wrapped in single quotes to prevent bash from parsing double quotes.
Choose the execution mode based on your environment:
Interactive mode: submit + status (recommended for chat)
Step 4a — Submit:
comfyui-skill --json submit <id> --args '{"prompt": "..."}'Returns: {"status": "submitted", "prompt_id": "..."}. Tell the user generation has started.
Step 4b — Poll:
comfyui-skill --json status <prompt_id>Status values: queued (with position) → running → success (with outputs) or error.
Polling pattern — critical for real-time feedback:
Each status call must be a separate tool invocation (a separate bash command). Do NOT write a shell loop. The correct pattern is:
- Run
statusas a standalone bash command. - Read the returned JSON.
- If
queuedorrunning: send a text message to the user with progress, then runstatusagain. - If
success: proceed to Step 5. - If
error: report the error.
Non-interactive mode: one-shot blocking (for scripts/CI)
comfyui-skill --json run <id> --args '{"prompt": "..."}'Blocks until finished. Returns the same result format as status with success.
Step 5: Present Results
On success, the result contains an outputs array with file references (filename, subfolder, type).
Use your native capabilities to present the files to the user (e.g., image preview, file path).
Workflow Import
When the user wants to add new workflows (not execute existing ones):
comfyui-skill --json workflow import <json_path>- Supports both API format and editor format (auto-detected, auto-converted).
- Automatically generates
schema.jsonwith smart parameter extraction. - After import, check dependencies before first execution.
For bulk import from ComfyUI server or local folders, see references/workflow-import.md.
Troubleshooting
- ComfyUI Offline: Run
comfyui-skill --json server status. If offline, ask the user to start ComfyUI. - Workflow Not Found: Run
comfyui-skill --json listto see available workflows. If missing, the user needs to import it first. - Parameter Format Error: Ensure
--argsis valid JSON wrapped in single quotes. - Cloud Node Unauthorized: Workflow uses cloud API nodes (Kling, Sora, etc.). Guide user to: (1) Generate an API Key at https://platform.comfy.org, (2) Open Web UI → Server Settings → fill in "ComfyUI API Key".
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

