comfyui-skill-openclaw
git clone https://github.com/HuangYuChuh/ComfyUI_Skills_OpenClaw
git clone --depth=1 https://github.com/HuangYuChuh/ComfyUI_Skills_OpenClaw ~/.claude/skills/huangyuchuh-comfyui-skills-openclaw-comfyui-skill-openclaw
git clone --depth=1 https://github.com/HuangYuChuh/ComfyUI_Skills_OpenClaw ~/.openclaw/skills/huangyuchuh-comfyui-skills-openclaw-comfyui-skill-openclaw
SKILL.mdComfyUI Agent SKILL
Prerequisites: Install the CLI:
. All commands must run from this project's root directory (where thispip install -U comfyui-skill-cliis located).SKILL.md[!IMPORTANT] Directory Sensitivity: The CLI reads
andconfig.jsonfrom the current directory. You MUSTdata/into the project root before running any command. Symptom:cdreturnslistor[]reports not found → you are in the wrong directory.server status
Quick Decision
- User says "generate image / draw a picture" → Execution Flow (Step 1–4)
- User says "import workflow / add workflow" →
comfyui-skill --json workflow import <path> - User says "img2img / use this image" → first
, then executecomfyui-skill --json upload <image> - User says "inpainting / mask this area" →
, then executecomfyui-skill --json upload <mask> --mask - 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" →
comfyui-skill --json nodes list - 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:
(e.g.,<server_id>/<workflow_id>
). If server is omitted, the default server is used.local/txt2img - Schema: Each workflow has a
that maps business parameter names (e.g.,schema.json
,prompt
) to internal ComfyUI node fields. Never expose node IDs to the user.seed - Server: One or more ComfyUI instances configured in
. Check health withconfig.json
.server status
Command Reference
| Command | Purpose |
|---|---|
| Check if ComfyUI server is online |
| Show VRAM, RAM, GPU, versions ( for multi-server) |
| List all available workflows and parameters |
| Show workflow details and parameter schema |
| Submit a workflow (non-blocking) |
| Check execution status |
| Execute a workflow (blocking, real-time streaming) |
| Validate workflow without executing |
| Upload image to ComfyUI (for img2img workflows) |
| Upload mask image (for inpainting workflows) |
| List all available ComfyUI nodes |
| List server-side job history ( to filter) |
| Check missing dependencies |
| Install missing custom nodes |
| Import workflow (auto-detect, warns about deprecated nodes) |
| List execution history for a workflow |
Execution Flow
Step 1: Query Available Workflows
comfyui-skill --json list
Returns a JSON array of all enabled workflows with their parameters.
parameters → ask the user if not provided.required: true
parameters → infer from context (e.g.,required: false
= random number), or omit.seed- 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
isis_ready
→ proceed to Step 4.true - If
isis_ready
:false- 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"]'
URLs from the check report assource_repo
values.--repos - If
isneeds_restart
, inform the user to restart ComfyUI, then re-check.true - 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)
submitstatusStep 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
as a standalone bash command.status - Read the returned JSON.
- If
orqueued
: send a text message to the user with progress, then runrunning
again.status - If
: proceed to Step 5.success - If
: report the error.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
with smart parameter extraction.schema.json - 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
. If offline, ask the user to start ComfyUI.comfyui-skill --json server status - Workflow Not Found: Run
to see available workflows. If missing, the user needs to import it first.comfyui-skill --json list - Parameter Format Error: Ensure
is valid JSON wrapped in single quotes.--args - 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".