Loading...
Loading...
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 skill4agent add mckruz/comfyui-expert comfyui-apihttp://127.0.0.1:8188GET /system_statscomfyui-inventoryPOST /promptGET /history/{prompt_id}GET /view?filename=...projects/{project}/workflows/{name}.jsoncurl http://127.0.0.1:8188/system_statssystem.ossystem.comfyui_versiondevices[0].namedevices[0].vram_totaldevices[0].vram_freecurl -X POST http://127.0.0.1:8188/prompt \
-H "Content-Type: application/json" \
-d '{"prompt": WORKFLOW_JSON, "client_id": "video-agent"}'{
"1": {
"class_type": "LoadCheckpoint",
"inputs": {
"ckpt_name": "flux1-dev.safetensors"
}
},
"2": {
"class_type": "CLIPTextEncode",
"inputs": {
"text": "photorealistic portrait...",
"clip": ["1", 1]
}
}
}["{node_id}", {output_index}]{"prompt_id": "abc-123-def", "number": 1}curl http://127.0.0.1:8188/history/abc-123-def{}{
"abc-123-def": {
"outputs": {
"9": {
"images": [{"filename": "ComfyUI_00001.png", "subfolder": "", "type": "output"}]
}
},
"status": {"completed": true}
}
}curl "http://127.0.0.1:8188/view?filename=ComfyUI_00001.png&subfolder=&type=output" -o output.pngcurl -X POST http://127.0.0.1:8188/upload/image \
-F "image=@reference.png" \
-F "subfolder=input" \
-F "type=input"curl -X POST http://127.0.0.1:8188/interruptcurl -X POST http://127.0.0.1:8188/free \
-H "Content-Type: application/json" \
-d '{"unload_models": true}'POST /promptprompt_idGET /history/{prompt_id}status.completedcompleted: truecomfyui-troubleshooterstate/inventory.jsoncomfyui-inventoryclass_typeComfyUI-Managerreferences/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 |
foundation/api-quick-ref.md