/comfyui:comfyui-expertfrom ComfyUI
ComfyUI graph design, custom nodes, workflow JSON, queue, API integration. Use when working with multimodal AI (images, audio, video) using ComfyUI — designing or editing node graphs, converting UI vs API workflow JSON, writing custom nodes in Python/JS, or driving ComfyUI from code.
Ships in ComfyUI. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert in ComfyUI - the node-based diffusion workflow editor that has become the de-facto production runtime for SDXL, SD3, Flux and video pipelines. You design clean graphs, write custom nodes in Python + JS, manage models, and ship workflows as APIs.
The user's server is ${user_config.comfyui_url}.
/prompt and /ws websocket.Prefer the comfyui MCP server over hand-written HTTP when it is available:
| Task | Tool / action |
|---|---|
| Inspect a node's live schema | create_workflow action:"node_info" (node_type filter) |
| Start from a template graph | create_workflow action:"create" |
| Patch a graph (set_input, add_node, connect, insert_between) | create_workflow action:"modify" |
| Preflight (missing nodes/models, broken links) | create_workflow action:"validate" |
| Read / convert a saved or UI workflow | get_workflow |
| Draw a graph as a diagram | visualize_workflow |
| Queue / monitor | enqueue_workflow action:"enqueue", queue action:"status" |
| Why did it fail | get_history action:"diagnose" |
| Author your own node pack | node_pack |
Live /object_info is the source of truth: never assume a class, input name or model filename
exists because it appeared in docs or on another machine.
┌──────────────────────────────────────────────────┐
│ Frontend (litegraph canvas, JS) │
│ ├── /ws -- progress, executing, executed │
│ └── /prompt POST -- enqueue workflow JSON │
├──────────────────────────────────────────────────┤
│ Backend (Python aiohttp) │
│ ├── PromptServer (queue, history, websocket) │
│ ├── nodes.py + custom_nodes/* (NODE_CLASS_*) │
│ └── Models on disk: models/{checkpoints,loras,…}│
└──────────────────────────────────────────────────┘
Each node is a Python class with these class attributes:
class MyAddNode:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"image": ("IMAGE",),
"strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 2.0, "step": 0.05}),
"mode": (["add", "multiply"], {"default": "add"}),
},
"optional": {"mask": ("MASK",)},
}
RETURN_TYPES = ("IMAGE",)
RETURN_NAMES = ("image_out",)
FUNCTION = "process"
CATEGORY = "vibe/image"
def process(self, image, strength, mode, mask=None):
out = image * strength if mode == "multiply" else image + strength
return (out,)
NODE_CLASS_MAPPINGS = {"VibeAddNode": MyAddNode}
NODE_DISPLAY_NAME_MAPPINGS = {"VibeAddNode": "Vibe Add"}
Drop the file under custom_nodes/vibe_pack/__init__.py and restart ComfyUI. Use WEB_DIRECTORY = "./web" to ship JS extensions for custom widgets. IMAGE tensors are [B, H, W, C] float32 in 0..1.
workflow.json): nodes + links with positions and widget values - what you save from the canvas.workflow_api.json): flat dict keyed by node id with class_type + inputs - what /prompt accepts. Export with Workflow → Export (API) (older frontends: enable Dev mode, then "Save (API Format)").[source_node_id, output_index].API JSON snippet:
{
"3": {"class_type": "KSampler", "inputs": {
"seed": 42, "steps": 28, "cfg": 4.5, "sampler_name": "dpmpp_2m", "scheduler": "karras",
"denoise": 1.0, "model": ["4", 0], "positive": ["6", 0], "negative": ["7", 0], "latent_image": ["5", 0]
}},
"4": {"class_type": "CheckpointLoaderSimple", "inputs": {"ckpt_name": "sd_xl_base_1.0.safetensors"}}
}
import json, uuid, urllib.request, websocket # pip install websocket-client
server = "127.0.0.1:8188" # host:port of ${user_config.comfyui_url}
client_id = str(uuid.uuid4())
ws = websocket.WebSocket()
ws.connect(f"ws://{server}/ws?clientId={client_id}", timeout=30)
def queue(workflow):
body = json.dumps({"prompt": workflow, "client_id": client_id}).encode()
req = urllib.request.Request(f"http://{server}/prompt", data=body,
headers={"Content-Type": "application/json"})
try:
resp = json.loads(urllib.request.urlopen(req, timeout=30).read())
except urllib.error.HTTPError as e: # 400 = validation error
raise RuntimeError(e.read().decode()) # contains `error` + `node_errors`
return resp["prompt_id"]
prompt_id = queue(json.load(open("workflow_api.json")))
ws.settimeout(600)
while True:
msg = ws.recv()
if not isinstance(msg, str):
continue # binary preview frames
evt = json.loads(msg)
data = evt.get("data", {})
if data.get("prompt_id") != prompt_id:
continue # messages from other jobs interleave
if evt["type"] == "execution_error":
raise RuntimeError(data)
if evt["type"] == "executing" and data.get("node") is None:
break # done
hist = json.loads(urllib.request.urlopen(f"http://{server}/history/{prompt_id}", timeout=30).read())
outputs = hist[prompt_id]["outputs"] # node-keyed; files under images/video/audio/gifs/...
Download files with GET /view?filename=…&subfolder=…&type=output using values from history.
Polling /history/{prompt_id} alone is a valid, simpler alternative to the websocket.
node_snapshot / comfy-cli snapshots).models/ as a shared volume to avoid re-downloading per replica.workflow.json instead of workflow_api.json) - /prompt will 400.LoraLoader chain (model and clip) breaks adapter weighting silently.prompt_id.images — video/audio nodes use other keys.extra_model_paths.yaml controls).What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ritvarsbiksis/comfyui-plugin --plugin comfyui5 skills in this plugin
/comfyui-localGenerate images on a local or LAN ComfyUI with a bundled, dependency-free Python script and API-format workflow files. Use when the user wants private image generation on their own hardware from a shell or script, wants to run a saved API-format workflow file, or when the comfyui MCP server is unavailable. Requires a reachable ComfyUI server./comfyui-troubleshootDiagnose ComfyUI connection failures, invalid workflows, unknown node classes, missing required inputs, missing models, queue and history problems, generation errors, VRAM pressure, remote-target confusion, and dependency issues without random installs or broad destructive changes./oc-comfy-ui