comfyui-execution

Submits ComfyUI workflows over HTTP and WebSocket, then fetches execution results and errors.

Updated Apr 8, 2026
One-click install
npx skills add https://github.com/ShinyGua/ComfyUI-Agent --skill comfyui-execution-shinygua
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: comfyui-execution
Source: https://github.com/ShinyGua/ComfyUI-Agent/tree/main/.claude/skills/comfyui-execution
Command: npx skills add https://github.com/ShinyGua/ComfyUI-Agent --skill comfyui-execution-shinygua

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires websocket-client, and includes scripts (resource) and references (resource) components.

What problem does it solve? Running and observing ComfyUI workflows programmatically requires juggling the POST /prompt endpoint, the /ws event stream, and /history lookups, plus decoding two distinct error channels. This Skill wraps that entire control surface in standalone scripts so an agent can submit, monitor, interrupt, and partially re-execute prompts without hand-writing protocol code. ## Core Features & Use Cases - Prompt submission and targeted reruns: Submit prompt JSON via POST /prompt, including partial_execution_targets to re-run only specific output nodes during repair loops. - Live execution monitoring: Subscribe to the /ws WebSocket and stream typed events (executing, progress, executed, execution_error, execution_interrupted) as JSON lines until a terminal frame. - Result and schema retrieval: Fetch outputs from /history/{prompt_id} and query /object_info node schemas with a filesystem cache, plus interrupt running prompts and free VRAM. - Use Case: An agent submits a txt2img prompt, watches the WebSocket until the graph finishes, pulls the generated images from history, and—on an execution_error—feeds the node_id, exception_message, and current_inputs triple into a repair loop that resubmits only the affected output node. ## Quick Start Ask the agent to submit your ComfyUI prompt JSON, watch its execution events, and return the output images from history.

Frequently Asked Questions about comfyui-execution

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I submit a ComfyUI workflow programmatically?▼

Pipe a JSON body containing the prompt graph to submit_prompt.py, which POSTs it to ComfyUI's /prompt endpoint. The script returns the prompt_id, queue number, and any node_errors from validation as JSON on stdout.

How to monitor ComfyUI execution progress via WebSocket?▼

Run subscribe_ws.py with a --prompt-id to stream typed events like executing, progress, and executed as JSON lines. It exits when the prompt reaches a terminal state: executing with node=null, execution_error, or execution_interrupted.

Can I re-run only part of a ComfyUI workflow?▼

Yes, submit_prompt.py accepts partial_execution_targets in the request body, which tells ComfyUI to execute only the listed output nodes. This is the mechanism used for targeted reruns after a repair patch.

What dependencies does the ComfyUI WebSocket subscriber need?▼

subscribe_ws.py requires the websocket-client Python package installed in the local virtual environment. All other scripts use only the Python standard library for HTTP calls.

Why does my ComfyUI prompt submission return node_errors?▼

node_errors comes from ComfyUI's validate_prompt before execution, indicating issues like missing required inputs, bad links, type mismatches, or values not in allowed lists. Each entry includes the error type, message, and extra_info needed to patch the prompt.

Does this work with a remote ComfyUI instance?▼

Yes, set the COMFYUI_BASE_URL and COMFYUI_WS_URL environment variables to point at any reachable ComfyUI backend; the defaults target http://127.0.0.1:8188. No API key or custom node installation is required.