artokun/comfyui-mcp/comfyui-core
Claude Code and agent skill by artokun/comfyui-mcp
- community
Checking that the SKILL.md file is still in the repository.
Core ComfyUI knowledge covering workflow format, node types, pipeline patterns, and MCP tool usage
Install
npx vskill@latest install artokun/comfyui-mcp/comfyui-coreSKILL.md
The same SKILL.md was published earlier as artokun/comfyui-mcp/comfyui-core.
ComfyUI Core Knowledge
Workflow JSON Format (API Format)
ComfyUI workflows are JSON objects mapping string node IDs to node definitions:
Key Rules
- Node IDs are strings of integers (
"1","2", etc.) class_typeis the exact Python class name of the nodeinputscontains both widget values (scalars) and connections (arrays)- Connections use the format
["sourceNodeId", outputIndex], a 2-element array where: - the first element is the string node ID of the source node
- the second element is the integer index into the source node's
outputlist (0-based) _metais optional and used for display titles only
Connection Examples
Important: API Format vs Web UI Format
- API format (for execution/analysis) is
{ "1": { class_type, inputs }, "2": { ... } }. It is compact and used byenqueue_workflow,create_workflow (action:"validate"),create_workflow (action:"modify"), etc. - Web UI format (for saving and frontend editing) is
{ "nodes": [...], "links": [...] }. It includes layout positions, sizes, groups, and visual metadata so ComfyUI's canvas can open and edit it - Execution tools expect and return API format
- Save in Web UI format so saved workflows stay readable and editable in the ComfyUI frontend. A raw API-format save is not canvas-editable. It "exists" in the library but loads blank in the canvas, which strands users and tempts agents into creating yet another new workflow instead of reopening the old one. Because of this,
save_workflowauto-converts API-format input to Web UI format with a generated layout. Prefer passing real Web UI format (fromget_workflow(action="get", filename=…, format="ui")), since a generated layout loses the original node positions and groups <!-- API-vs-UI save-format clarification adapted from 1696762169/comfyui-mcp@3da56c9 --> get_workflowdefaults toformat="api"for analysis/execution; useformat="ui"when loading a workflow to re-save or edit in the canvas- Muted/bypassed nodes are preserved with
_meta.mode: "muted". They are inactive but visible for understanding the workflow - Get/Set virtual wire nodes are preserved with
_meta.titleandConstantkey for tracing data flow
Workflow Library Tools
get_workflow(action="analyze", filename=…)is the first call for understanding any saved workflow. It returns a structured text summary with sections, node IDs, key settings, virtual wires, and connection graph. No raw JSON, just what you need to reason about the workflow. Supports views: summary (default), overview (mermaid), detail (section mermaid), list, flat.get_workflow (action:"list")lists all saved workflows in ComfyUI's user libraryget_workflow(action="get", filename=…)loads raw workflow JSON. Only use it when you need the actual JSON forenqueue_workflow,create_workflow (action:"modify"), orsave_workflow. Useaction="analyze"instead for understanding. When the JSON is headed back tosave_workflow, requestformat="ui"so the workflow stays editable in the frontend.save_workflow(action="save", filename=…, workflow=…)saves a workflow to the user library. Pass Web UI format ({ nodes, links }) so it keeps its real layout in ComfyUI's canvas. API-format graphs are accepted and auto-converted to Web UI format (with a generated layout) precisely because a raw API-format save is not canvas-editable; the frontend cannot open it. When re-saving an existing workflow, load it withget_workflow(action="get", filename=…, format="ui")and edit that, so positions and groups survive.
Data Types
ComfyUI nodes pass typed data through connections:
| Type | Description | Common Source | |
|---|---|---|---|
MODEL | Diffusion model weights | CheckpointLoaderSimple (output 0) | |
CLIP | Text encoder | CheckpointLoaderSimple (output 1) | |
VAE | Variational autoencoder | CheckpointLoaderSimple (output 2) | |
CONDITIONING | Encoded text prompt | CLIPTextEncode (output 0) | |
LATENT | Latent space tensor | EmptyLatentImage, KSampler, VAEEncode | |
IMAGE | Pixel image tensor (BHWC) | VAEDecode, LoadImage, SaveImage | |
MASK | Single-channel mask | LoadImage (output 1) | |
UPSCALE_MODEL | Upscaling model | UpscaleModelLoader |
Standard Pipeline Patterns
Text-to-Image (txt2img)
Node IDs typically: 1=Checkpoint, 2=Positive, 3=Negative, 4=EmptyLatent, 5=KSampler, 6=VAEDecode, 7=SaveImage
Image-to-Image (img2img)
Same as txt2img but replace EmptyLatentImage with:
Set KSampler.denoise to 0.5 to 0.8 (lower = closer to input image).
Upscale
Inpaint
MCP Tool Usage Guide
Quick Generation
create_workflowwith template"txt2img"and your paramsenqueue_workflow(action="enqueue")with the returned JSON. It returnsprompt_idimmediately- Poll
queue(action:"status") with theprompt_iduntildoneis true - Use
get_image (action:"list_outputs")(limit 1) to find the generated image, thenReadto display it
Inspect & Modify
create_workflow (action:"node_info")queries what nodes are available and their schemascreate_workflow (action:"modify")patches an existing workflow (set_input, add_node, remove_node, connect, insert_between)visualize_workflowshows a workflow as a mermaid diagram
Reverse Engineering
visualize_workflowturns workflow JSON into a mermaid diagramvisualize_workflow (action:"mermaid")turns a mermaid diagram into workflow JSON (uses/object_infofor schema resolution)
Model Management
list_local_modelsshows what's installeddownload_modelaction:"search"finds models on HuggingFacedownload_modeldownloads to ComfyUI's models directory
Never ask the user to manually download models. If a required model is missing, search for it and download it yourself:
- Check
list_local_modelsfirst - If missing, search HuggingFace via
download_modelaction:"search"or CivitAI via their REST API - Use
download_modelto install it directly to the correct subfolder
CivitAI API (when the CIVITAI_API_TOKEN env var is available):
- Search:
GET https://civitai.com/api/v1/models?query={query}&types=Checkpoint&sort=Most+Downloaded&limit=5 - Details:
GET https://civitai.com/api/v1/models/{modelId} - Download:
GET https://civitai.com/api/download/models/{modelVersionId}?token={token}
CivitAI is preferred for fine-tuned models, community-rated checkpoints, and specialized LoRAs. HuggingFace is preferred for official/base models (SDXL, Flux, SD 1.5).
Custom Nodes
search_custom_nodessearches the ComfyUI Registry (action: "search") or gets one pack's details (action: "details")list_packs(action: "generate_skill") auto-generates a skill file for a node pack
Workflow Execution
enqueue_workflow submits to ComfyUI's queue and returns prompt_id + queue position immediately. It does not block.
Background Progress Monitoring
After enqueuing one or more workflows, use a background Bash task to monitor progress silently:
The script connects to ComfyUI's WebSocket and reports:
- Step-by-step progress (e.g.,
KSampler step 12/20 (60%)) - Success with output filenames and timing
- Errors with node details and messages
The standard generation pattern:
create_workflowor build workflow JSON +enqueue_workflow(action="enqueue")(repeat for batch)- Start background monitor with all prompt_ids
- Continue conversation. Results appear when jobs finish
- Use
get_image (action:"list_outputs")orReadto display the generated images
Do not poll queue (action:"status") in a loop. The background monitor replaces polling entirely.
If the monitor script is unavailable, fall back to queue (action:"status") and poll until done is true.
Queue Management
One tool, queue, driven by its action parameter:
queue(action:"list") shows running/pending job counts and prompt_idsqueue(action:"status") checks if a specific prompt_id is running, pending, or donequeue(action:"cancel") interrupts a running job (pass optionalprompt_idto target a specific one)queue(action:"cancel_queued") removes a specific pending job from the queue byprompt_idqueue(action:"clear") removes all pending jobs (does not stop the currently running job)
When to use queue tools:
- To check status, use
queue(action:"status") for a quick boolean check (prefer the background monitor for ongoing tracking) - To abort,
queue(action:"cancel") stops what's running now andqueue(action:"cancel_queued") removes a pending one - To start fresh,
queue(action:"clear") then optionallyqueue(action:"cancel")
Monitoring & Recovery
get_system_statsreports GPU, VRAM, Python version, OS detailsqueue(action:"list") shows running/pending jobs (also listed above under Queue Management)
When ComfyUI is unresponsive or crashed:
- Try
get_system_stats. If it fails, ComfyUI is down - Use
restart_comfyuiwithaction: "restart"(preserves launch args from a prioraction: "stop") - If restart fails (no saved process info), use
restart_comfyuiwithaction: "start"or ask the user to start it manually. On Windowsaction: "start"never launches ComfyUI (it refuses), so ask the user to start it from the Desktop app or its launcher - After ComfyUI is back, re-enqueue any failed/lost workflows
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugin/skills/comfyui-core/SKILL.md
Popularity
- Repository stars
- 952
- Repository forks
- 151
- Repository npm downloads, 7 days
- 140,410
- 7-day trend score
- 57
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 16 Aug 2026, 3 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/artokun/comfyui-mcp/comfyui-core)