npx skills add ...
npx skills add mckruz/comfyui-expert --skill comfyui-api
Connect to a running ComfyUI instance, queue workflows, monitor execution, and retrieve results. Supports both online (REST API) and offline (JSON export) modes. Use when executing ComfyUI workflows or checking server status.
npx skills add mckruz/comfyui-expert --skill comfyui-api
Connect to ComfyUI's REST API to execute workflows, monitor progress, and retrieve outputs.
http://127.0.0.1:8188Full API access. Preferred mode for interactive work.
GET /system_statscomfyui-inventory skillPOST /promptGET /history/{prompt_id} every 5 secondsGET /view?filename=...Export workflow JSON for manual loading in ComfyUI.
projects/{project}/workflows/{name}.jsonResponse fields:
system.os: Operating systemsystem.comfyui_version: Version stringdevices[0].name: GPU namedevices[0].vram_total: Total VRAM bytesdevices[0].vram_free: Free VRAM bytesWORKFLOW_JSON format:
Each node is keyed by a string ID. Inputs reference other nodes as ["{node_id}", {output_index}].
Response:
Incomplete: Returns {} (empty object)
Complete: Returns execution data with outputs:
ComfyUI doesn't support WebSocket in CLI context. Use REST polling:
POST /prompt → get prompt_idGET /history/{prompt_id} every 5 secondsstatus.completedcompleted: true, extract outputscomfyui-troubleshooterTimeout: Warn user after 10 minutes of polling. Video generation (Wan 14B) can take 15-30 minutes.
Before queuing any workflow:
state/inventory.json (via comfyui-inventory)class_type exists in installed nodesComfyUI-Manager install commandreferences/models.md| Error | Cause | Action |
|---|---|---|
| Connection refused | ComfyUI not running | Switch to offline mode, save JSON |
| 400 Bad Request | Invalid workflow JSON | Validate node connections |
| 500 Internal Error | ComfyUI crash | Suggest restart, check logs |
| Timeout (no response) | Server overloaded | Wait and retry once |
Full API documentation: foundation/api-quick-ref.md