New: Earn 20% as an AgentAlley affiliate. Share your link and earn on every sale you refer. Join now New: Earn 20% as an affiliate. Join now

Core ComfyUI knowledge covering workflow format, node types

ComfyUI Core Knowledge

by artokun · MIT license · ★ 759 on GitHub · updated Sep 21

ComfyUI Core Knowledge cover

Core ComfyUI knowledge covering workflow format, node types, pipeline patterns, and MCP tool usage

---
name: comfyui-core
description: Core ComfyUI knowledge covering workflow format, node types, pipeline patterns, and MCP tool usage
globs:
  - "**/*.json"
---

# ComfyUI Core Knowledge

## Workflow JSON Format (API Format)

ComfyUI workflows are JSON objects mapping string node IDs to node definitions:

```json
{
  "1": {
    "class_type": "CheckpointLoaderSimple",
    "inputs": { "ckpt_name": "sd_xl_base_1.0.safetensors" },

Overview

ComfyUI workflows are JSON objects mapping string node IDs to node definitions:

Manual install (npx, ZIP)
Claude Codenpx skills add artokun/comfyui-mcp --skill comfyui-core -g -a claude-code
Claude Code (manual)mkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/artokun/comfyui-mcp/tar.gz/1d5b12b1b499 \ | tar -xz -C ~/.claude/skills --strip-components=3 comfyui-mcp-1d5b12b1b499/plugin/skills/comfyui-core
Windows (PowerShell)New-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/ecfb8384504ad390f904/comfyui-core.zip" -OutFile "$env:TEMP\comfyui-core.zip"; Expand-Archive "$env:TEMP\comfyui-core.zip" -DestinationPath "$HOME\.claude\skills" -Force
Claude.ai / desktopDownload the ZIP and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md13.1 KB
  • references/1 file · 6.8 KB
Read the files here
artokun/1d5b12b2 files
Shared references1SKILL.md reads these from elsewhere in the repo. Not in the ZIP.Get them on GitHub ↗
SKILL.md
Show the full text272 lines

ComfyUI Core Knowledge

Workflow JSON Format (API Format)

ComfyUI workflows are JSON objects mapping string node IDs to node definitions:

{
  "1": {
    "class_type": "CheckpointLoaderSimple",
    "inputs": { "ckpt_name": "sd_xl_base_1.0.safetensors" },
    "_meta": { "title": "Load Checkpoint" }
  },
  "2": {
    "class_type": "CLIPTextEncode",
    "inputs": { "text": "a cat", "clip": ["1", 1] },
    "_meta": { "title": "Positive Prompt" }
  }
}
Key Rules
  • Node IDs are strings of integers ("1", "2", etc.)
  • class_type is the exact Python class name of the node
  • inputs contains 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 output list (0-based)
  • _meta is optional and used for display titles only
Connection Examples
"model": ["1", 0]       // Connect to node 1's first output (MODEL)
"clip": ["1", 1]        // Connect to node 1's second output (CLIP)
"vae": ["1", 2]         // Connect to node 1's third output (VAE)
"positive": ["2", 0]    // Connect to node 2's first output (CONDITIONING)
"samples": ["5", 0]     // Connect to node 5's first output (LATENT)
"images": ["6", 0]      // Connect to node 6's first output (IMAGE)
Important: API Format vs Web UI Format
  • API format (for execution/analysis) is { "1": { class_type, inputs }, "2": { ... } }. It is compact and used by enqueue_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_workflow auto-converts API-format input to Web UI format with a generated layout. Prefer passing real Web UI format (from get_workflow(action="get", filename=…, format="ui")), since a generated layout loses the original node positions and groups
  • get_workflow defaults to format="api" for analysis/execution; use format="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.title and Constant key 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 library
  • get_workflow(action="get", filename=…) loads raw workflow JSON. Only use it when you need the actual JSON for enqueue_workflow, create_workflow (action:"modify"), or save_workflow. Use action="analyze" instead for understanding. When the JSON is headed back to save_workflow, request format="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 with get_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)
CheckpointLoaderSimple → MODEL, CLIP, VAE
  ├─ CLIP → CLIPTextEncode (positive) → CONDITIONING
  ├─ CLIP → CLIPTextEncode (negative) → CONDITIONING
  │
EmptyLatentImage → LATENT
  │
KSampler (model, positive, negative, latent_image) → LATENT
  │
VAEDecode (samples, vae) → IMAGE
  │
SaveImage (images)

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:

LoadImage → IMAGE
VAEEncode (pixels, vae) → LATENT → KSampler.latent_image

Set KSampler.denoise to 0.5 to 0.8 (lower = closer to input image).

Upscale
LoadImage → IMAGE
UpscaleModelLoader → UPSCALE_MODEL
ImageUpscaleWithModel (upscale_model, image) → IMAGE
SaveImage (images)
Inpaint
LoadImage (image) → IMAGE → VAEEncode → LATENT
LoadImage (mask) → MASK
SetLatentNoiseMask (samples, mask) → LATENT → KSampler.latent_image

MCP Tool Usage Guide

Quick Generation
  1. create_workflow with template "txt2img" and your params
  2. enqueue_workflow(action="enqueue") with the returned JSON. It returns prompt_id immediately
  3. Poll queue (action:"status") with the prompt_id until done is true
  4. Use get_image (action:"list_outputs") (limit 1) to find the generated image, then Read to display it
Inspect & Modify
  • create_workflow (action:"node_info") queries what nodes are available and their schemas
  • create_workflow (action:"modify") patches an existing workflow (set_input, add_node, remove_node, connect, insert_between)
  • visualize_workflow shows a workflow as a mermaid diagram
Reverse Engineering
  • visualize_workflow turns workflow JSON into a mermaid diagram
  • visualize_workflow (action:"mermaid") turns a mermaid diagram into workflow JSON (uses /object_info for schema resolution)
Model Management
  • list_local_models shows what's installed
  • download_model action:"search" finds models on HuggingFace
  • download_model downloads 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:

  1. Check list_local_models first
  2. If missing, search HuggingFace via download_model action:"search" or CivitAI via their REST API
  3. Use download_model to 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_nodes searches 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:

# Single job
Bash(run_in_background: true):
node "${CLAUDE_PLUGIN_ROOT}/scripts/monitor-progress.mjs" <prompt_id>

# Multiple jobs (batch)
Bash(run_in_background: true):
node "${CLAUDE_PLUGIN_ROOT}/scripts/monitor-progress.mjs" <id1> <id2> <id3>

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:

  1. create_workflow or build workflow JSON + enqueue_workflow(action="enqueue") (repeat for batch)
  2. Start background monitor with all prompt_ids
  3. Continue conversation. Results appear when jobs finish
  4. Use get_image (action:"list_outputs") or Read to 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_ids
  • queue (action:"status") checks if a specific prompt_id is running, pending, or done
  • queue (action:"cancel") interrupts a running job (pass optional prompt_id to target a specific one)
  • queue (action:"cancel_queued") removes a specific pending job from the queue by prompt_id
  • queue (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 and queue (action:"cancel_queued") removes a pending one
  • To start fresh, queue (action:"clear") then optionally queue (action:"cancel")
Monitoring & Recovery
  • get_system_stats reports GPU, VRAM, Python version, OS details
  • queue (action:"list") shows running/pending jobs (also listed above under Queue Management)

When ComfyUI is unresponsive or crashed:

  1. Try get_system_stats. If it fails, ComfyUI is down
  2. Use restart_comfyui with action: "restart" (preserves launch args from a prior action: "stop")
  3. If restart fails (no saved process info), use restart_comfyui with action: "start" or ask the user to start it manually
  4. After ComfyUI is back, re-enqueue any failed/lost workflows

When a job appears hung (monitor shows [STALL]):

  1. Check get_system_stats and look at VRAM usage (OOM causes hangs)
  2. Try queue (action:"cancel") to interrupt the stuck job
  3. If cancel fails, use restart_comfyui to force-restart
  4. Use clear_vram after restart to free GPU memory before retrying

KSampler Parameters

Parameter Type Common Values
seed int Random (0 to 2^48). Omit to auto-randomize.
steps int 20 (standard), 4-8 (turbo/lightning models)
cfg float 7-8 (SD 1.5/SDXL), 1.0 (Flux), 3.5 (turbo)
sampler_name string "euler", "euler_ancestral", "dpmpp_2m", "dpmpp_sde"
scheduler string "normal", "karras", "sgm_uniform"
denoise float 1.0 (txt2img), 0.5-0.8 (img2img), 0.75-0.9 (inpaint)

Mermaid Visualization Conventions

The visualize_workflow tool produces mermaid flowcharts with:

  • Subgraphs grouping nodes by category: loading, conditioning, sampling, image, output
  • Edge labels showing data types: -->|MODEL|, -->|CLIP|, -->|LATENT|, etc.
  • Node labels showing class_type and optionally widget values
  • Direction LR (left-to-right) by default, TB (top-to-bottom) for large workflows

The visualize_workflow (action:"mermaid") tool parses mermaid back into workflow JSON, using connection type labels to resolve the correct input/output slots via /object_info schemas.

Common Mistakes to Avoid

  1. Wrong connection format. Use ["1", 0] not [1, 0]; node IDs are strings
  2. Web UI format. Don't pass { nodes: [], links: [] }; use API format
  3. Missing VAE. CheckpointLoaderSimple has 3 outputs: MODEL(0), CLIP(1), VAE(2)
  4. Wrong output index. Check the node's output list order via create_workflow (action:"node_info")
  5. Seed handling. enqueue_workflow randomizes seeds by default unless disable_random_seed: true

Sources

1---
2name: comfyui-core
3description: Core ComfyUI knowledge covering workflow format, node types, pipeline patterns, and MCP tool usage
4globs:
5 - "**/*.json"
6---
7 
8# ComfyUI Core Knowledge
9 
10## Workflow JSON Format (API Format)
11 
12ComfyUI workflows are JSON objects mapping string node IDs to node definitions:
13 
14```json
15{
16 "1": {
17 "class_type": "CheckpointLoaderSimple",
18 "inputs": { "ckpt_name": "sd_xl_base_1.0.safetensors" },
19 "_meta": { "title": "Load Checkpoint" }
20 },
21 "2": {
22 "class_type": "CLIPTextEncode",
23 "inputs": { "text": "a cat", "clip": ["1", 1] },
24 "_meta": { "title": "Positive Prompt" }
25 }
26}
27```
28 
29### Key Rules
30 
31- Node IDs are strings of integers (`"1"`, `"2"`, etc.)
32- `class_type` is the exact Python class name of the node
33- `inputs` contains both widget values (scalars) and connections (arrays)
34- Connections use the format `["sourceNodeId", outputIndex]`, a 2-element array where:
35 - the first element is the string node ID of the source node
36 - the second element is the integer index into the source node's `output` list (0-based)
37- `_meta` is optional and used for display titles only
38 
39### Connection Examples
40 
41```json
42"model": ["1", 0] // Connect to node 1's first output (MODEL)
43"clip": ["1", 1] // Connect to node 1's second output (CLIP)
44"vae": ["1", 2] // Connect to node 1's third output (VAE)
45"positive": ["2", 0] // Connect to node 2's first output (CONDITIONING)
46"samples": ["5", 0] // Connect to node 5's first output (LATENT)
47"images": ["6", 0] // Connect to node 6's first output (IMAGE)
48```
49 
50### Important: API Format vs Web UI Format
51 
52- API format (for execution/analysis) is `{ "1": { class_type, inputs }, "2": { ... } }`. It is compact and used by `enqueue_workflow`, `create_workflow (action:"validate")`, `create_workflow (action:"modify")`, etc.
53- 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
54- Execution tools expect and return API format
55- 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_workflow` auto-converts API-format input to Web UI format with a generated layout. Prefer passing real Web UI format (from `get_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 -->
56- `get_workflow` defaults to `format="api"` for analysis/execution; use `format="ui"` when loading a workflow to re-save or edit in the canvas
57- Muted/bypassed nodes are preserved with `_meta.mode: "muted"`. They are inactive but visible for understanding the workflow
58- Get/Set virtual wire nodes are preserved with `_meta.title` and `Constant` key for tracing data flow
59 
60### Workflow Library Tools
61 
62- `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.
63- `get_workflow (action:"list")` lists all saved workflows in ComfyUI's user library
64- `get_workflow(action="get", filename=…)` loads raw workflow JSON. Only use it when you need the actual JSON for `enqueue_workflow`, `create_workflow (action:"modify")`, or `save_workflow`. Use `action="analyze"` instead for understanding. When the JSON is headed back to `save_workflow`, request `format="ui"` so the workflow stays editable in the frontend.
65- `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 with `get_workflow(action="get", filename=…, format="ui")` and edit that, so positions and groups survive.
66 
67## Data Types
68 
69ComfyUI nodes pass typed data through connections:
70 
71| Type | Description | Common Source |
72|------|-------------|---------------|
73| `MODEL` | Diffusion model weights | CheckpointLoaderSimple (output 0) |
74| `CLIP` | Text encoder | CheckpointLoaderSimple (output 1) |
75| `VAE` | Variational autoencoder | CheckpointLoaderSimple (output 2) |
76| `CONDITIONING` | Encoded text prompt | CLIPTextEncode (output 0) |
77| `LATENT` | Latent space tensor | EmptyLatentImage, KSampler, VAEEncode |
78| `IMAGE` | Pixel image tensor (BHWC) | VAEDecode, LoadImage, SaveImage |
79| `MASK` | Single-channel mask | LoadImage (output 1) |
80| `UPSCALE_MODEL` | Upscaling model | UpscaleModelLoader |
81 
82## Standard Pipeline Patterns
83 
84### Text-to-Image (txt2img)
85 
86```
87CheckpointLoaderSimple → MODEL, CLIP, VAE
88 ├─ CLIP → CLIPTextEncode (positive) → CONDITIONING
89 ├─ CLIP → CLIPTextEncode (negative) → CONDITIONING
90 │
91EmptyLatentImage → LATENT
92 │
93KSampler (model, positive, negative, latent_image) → LATENT
94 │
95VAEDecode (samples, vae) → IMAGE
96 │
97SaveImage (images)
98```
99 
100Node IDs typically: 1=Checkpoint, 2=Positive, 3=Negative, 4=EmptyLatent, 5=KSampler, 6=VAEDecode, 7=SaveImage
101 
102### Image-to-Image (img2img)
103 
104Same as txt2img but replace `EmptyLatentImage` with:
105```
106LoadImage → IMAGE
107VAEEncode (pixels, vae) → LATENT → KSampler.latent_image
108```
109Set `KSampler.denoise` to 0.5 to 0.8 (lower = closer to input image).
110 
111### Upscale
112 
113```
114LoadImage → IMAGE
115UpscaleModelLoader → UPSCALE_MODEL
116ImageUpscaleWithModel (upscale_model, image) → IMAGE
117SaveImage (images)
118```
119 
120### Inpaint
121 
122```
123LoadImage (image) → IMAGE → VAEEncode → LATENT
124LoadImage (mask) → MASK
125SetLatentNoiseMask (samples, mask) → LATENT → KSampler.latent_image
126```
127 
128## MCP Tool Usage Guide
129 
130### Quick Generation
131 
1321. `create_workflow` with template `"txt2img"` and your params
1332. `enqueue_workflow(action="enqueue")` with the returned JSON. It returns `prompt_id` immediately
1343. Poll `queue` (action:"status") with the `prompt_id` until `done` is true
1354. Use `get_image (action:"list_outputs")` (limit 1) to find the generated image, then `Read` to display it
136 
137### Inspect & Modify
138 
139- `create_workflow (action:"node_info")` queries what nodes are available and their schemas
140- `create_workflow (action:"modify")` patches an existing workflow (set_input, add_node, remove_node, connect, insert_between)
141- `visualize_workflow` shows a workflow as a mermaid diagram
142 
143### Reverse Engineering
144 
145- `visualize_workflow` turns workflow JSON into a mermaid diagram
146- `visualize_workflow (action:"mermaid")` turns a mermaid diagram into workflow JSON (uses `/object_info` for schema resolution)
147 
148### Model Management
149 
150- `list_local_models` shows what's installed
151- `download_model` `action:"search"` finds models on HuggingFace
152- `download_model` downloads to ComfyUI's models directory
153 
154Never ask the user to manually download models. If a required model is missing, search for it and download it yourself:
155 
1561. Check `list_local_models` first
1572. If missing, search HuggingFace via `download_model` `action:"search"` or CivitAI via their REST API
1583. Use `download_model` to install it directly to the correct subfolder
159 
160CivitAI API (when the `CIVITAI_API_TOKEN` env var is available):
161- Search: `GET https://civitai.com/api/v1/models?query={query}&types=Checkpoint&sort=Most+Downloaded&limit=5`
162- Details: `GET https://civitai.com/api/v1/models/{modelId}`
163- Download: `GET https://civitai.com/api/download/models/{modelVersionId}?token={token}`
164 
165CivitAI is preferred for fine-tuned models, community-rated checkpoints, and specialized LoRAs.
166HuggingFace is preferred for official/base models (SDXL, Flux, SD 1.5).
167 
168### Custom Nodes
169 
170- `search_custom_nodes` searches the ComfyUI Registry (`action: "search"`) or gets one pack's details (`action: "details"`)
171- `list_packs` (`action: "generate_skill"`) auto-generates a skill file for a node pack
172 
173### Workflow Execution
174 
175`enqueue_workflow` submits to ComfyUI's queue and returns `prompt_id` + queue position immediately. It does not block.
176 
177### Background Progress Monitoring
178 
179After enqueuing one or more workflows, use a background Bash task to monitor progress silently:
180 
181```bash
182# Single job
183Bash(run_in_background: true):
184node "${CLAUDE_PLUGIN_ROOT}/scripts/monitor-progress.mjs" <prompt_id>
185 
186# Multiple jobs (batch)
187Bash(run_in_background: true):
188node "${CLAUDE_PLUGIN_ROOT}/scripts/monitor-progress.mjs" <id1> <id2> <id3>
189```
190 
191The script connects to ComfyUI's WebSocket and reports:
192- Step-by-step progress (e.g., `KSampler step 12/20 (60%)`)
193- Success with output filenames and timing
194- Errors with node details and messages
195 
196The standard generation pattern:
1971. `create_workflow` or build workflow JSON + `enqueue_workflow(action="enqueue")` (repeat for batch)
1982. Start background monitor with all prompt_ids
1993. Continue conversation. Results appear when jobs finish
2004. Use `get_image (action:"list_outputs")` or `Read` to display the generated images
201 
202Do not poll `queue` (action:"status") in a loop. The background monitor replaces polling entirely.
203 
204If the monitor script is unavailable, fall back to `queue` (action:"status") and poll until `done` is true.
205 
206### Queue Management
207 
208One tool, `queue`, driven by its `action` parameter:
209 
210- `queue` (action:"list") shows running/pending job counts and prompt_ids
211- `queue` (action:"status") checks if a specific prompt_id is running, pending, or done
212- `queue` (action:"cancel") interrupts a running job (pass optional `prompt_id` to target a specific one)
213- `queue` (action:"cancel_queued") removes a specific pending job from the queue by `prompt_id`
214- `queue` (action:"clear") removes all pending jobs (does not stop the currently running job)
215 
216When to use queue tools:
217- To check status, use `queue` (action:"status") for a quick boolean check (prefer the background monitor for ongoing tracking)
218- To abort, `queue` (action:"cancel") stops what's running now and `queue` (action:"cancel_queued") removes a pending one
219- To start fresh, `queue` (action:"clear") then optionally `queue` (action:"cancel")
220 
221### Monitoring & Recovery
222 
223- `get_system_stats` reports GPU, VRAM, Python version, OS details
224- `queue` (action:"list") shows running/pending jobs (also listed above under Queue Management)
225 
226When ComfyUI is unresponsive or crashed:
2271. Try `get_system_stats`. If it fails, ComfyUI is down
2282. Use `restart_comfyui` with `action: "restart"` (preserves launch args from a prior `action: "stop"`)
2293. If restart fails (no saved process info), use `restart_comfyui` with `action: "start"` or ask the user to start it manually
2304. After ComfyUI is back, re-enqueue any failed/lost workflows
231 
232When a job appears hung (monitor shows `[STALL]`):
2331. Check `get_system_stats` and look at VRAM usage (OOM causes hangs)
2342. Try `queue` (action:"cancel") to interrupt the stuck job
2353. If cancel fails, use `restart_comfyui` to force-restart
2364. Use `clear_vram` after restart to free GPU memory before retrying
237 
238## KSampler Parameters
239 
240| Parameter | Type | Common Values |
241|-----------|------|---------------|
242| `seed` | int | Random (0 to 2^48). Omit to auto-randomize. |
243| `steps` | int | 20 (standard), 4-8 (turbo/lightning models) |
244| `cfg` | float | 7-8 (SD 1.5/SDXL), 1.0 (Flux), 3.5 (turbo) |
245| `sampler_name` | string | `"euler"`, `"euler_ancestral"`, `"dpmpp_2m"`, `"dpmpp_sde"` |
246| `scheduler` | string | `"normal"`, `"karras"`, `"sgm_uniform"` |
247| `denoise` | float | 1.0 (txt2img), 0.5-0.8 (img2img), 0.75-0.9 (inpaint) |
248 
249## Mermaid Visualization Conventions
250 
251The `visualize_workflow` tool produces mermaid flowcharts with:
252 
253- Subgraphs grouping nodes by category: `loading`, `conditioning`, `sampling`, `image`, `output`
254- Edge labels showing data types: `-->|MODEL|`, `-->|CLIP|`, `-->|LATENT|`, etc.
255- Node labels showing class_type and optionally widget values
256- Direction `LR` (left-to-right) by default, `TB` (top-to-bottom) for large workflows
257 
258The `visualize_workflow (action:"mermaid")` tool parses mermaid back into workflow JSON, using connection type labels to resolve the correct input/output slots via `/object_info` schemas.
259 
260## Common Mistakes to Avoid
261 
2621. **Wrong connection format.** Use `["1", 0]` not `[1, 0]`; node IDs are strings
2632. **Web UI format.** Don't pass `{ nodes: [], links: [] }`; use API format
2643. **Missing VAE.** CheckpointLoaderSimple has 3 outputs: MODEL(0), CLIP(1), VAE(2)
2654. **Wrong output index.** Check the node's output list order via `create_workflow (action:"node_info")`
2665. **Seed handling.** `enqueue_workflow` randomizes seeds by default unless `disable_random_seed: true`
267 
268## Sources
269 
270- **Official:** ComfyUI workflow/API conventions from https://github.com/comfyanonymous/ComfyUI and https://docs.comfy.org
271- **Empirical:** MCP tool recipes and KSampler default tables are product/empirical notes, not a vendor prompting guide.
272 
View all files on GitHub →

Details

Updated
Sep 21, 2026
License
MIT
Stars on the repo
★ 759
Checked
Source
artokun/comfyui-mcp ↗
Creator
artokun · 44 listings
View creator

Similar skills

See all →
SkillMake Japanese TV-anime style videos with codeAnime celedenfunf/reelmimic · by edenfunfMake Japanese TV-anime style videos (MP4) with code — cel-shaded characters with tapered line art, big detailed eyes, hair clumps with a specular band, comedic anime reactions (sweat drop, anger vein, sparkle eyes, ≥< eyes, dot eyes, tears), painted skies with cumulus clouds, school/street/classroom/rooftop sets with time-of-day palettes, speed/focus lines, impact frames, dramatic zooms, smears, sakura petals and anime subtitles (CJK). Canvas 2D rendered frame by frame in headless Chrome, encoded with ffmpeg. Use when a reference video or brief calls for anime / 動畫 / 日系動畫 / アニメ / cel-shaded / slice-of-life / school romance / shōnen-style reactions, or when the video-clone router picks the anime-cel style. 2D only; characters are original (Hina, Ren) or new ones built on the same rig.★ 3.6k GitHub starsSkillDirect and produce a short film made entirely in codeLemo opuscarlemomo-ai/lemo-opuscar · by lemomo-aiDirect and produce a short film made entirely in code, in one of the styles of the Lemo-Opuscar library (e.g. Impasto Oil Painting 油画厚涂, Watercolor Brush 水彩笔刷, Ukiyo-e 浮世绘, Satellite Briefing 卫星简报, Exploded Teardown 产品拆解, Microscope Story 显微叙事). Use when the user asks for a video, film, short, promo, explainer or animation (视频、短片、动画、宣传片) in a named style, including data, science and product explainers built from real material such as satellite imagery, laser scans, CAD files or archive scans (数据解说、科普、产品拆解); when they want a film made about their own topic and haven't chosen a style (help them choose); or when they ask which film styles there are. Not for editing or converting existing video files.★ 3k GitHub starsSkillGenerate Ian-style Xiaohei illustrations for articles, postsdzhng/skills · by dzhngGenerate Ian-style Xiaohei illustrations for articles, posts, blogs, Notion documents, workflows, methods, processes, structures, states, metaphors, and opinions. Use when the user asks for weird, hand-drawn, Xiaohei, article, editorial, body illustrations, illustration ideas, shot lists, title removal, image edits, or image regeneration. By default, all image text and annotations are English, even when the source article is Chinese; only use another language when the user explicitly asks.★ 1.3k GitHub starsSkillCreating game art through Scenario MCP: spritesScenario game assetsscenario-labs/skills · by scenario-labsUse when creating game art through Scenario MCP: sprites, sprite sheets, icons, props, loot, tilesets and autotile terrain transitions, seamless tiles, isometric buildings, top-down maps, pixel art, UI buttons and panels, parallax background layers or depth planes for side-scrollers, and character or concept art; or when assets need transparent backgrounds, background removal, style-consistent variation batches, upscaling, pixel-grid cleanup, or PNG export for Unity, Godot, or Unreal.★ 854 GitHub starsSkillTrain custom LoRAs with ostris AI-ToolkitAI-Toolkit LoRA Trainer (WAN 2.2 & Z-Image)artokun/comfyui-mcp · by artokunTrain custom LoRAs with ostris AI-Toolkit. Covers WAN 2.2/2.1 (people, styles, video motion) and Z-Image (Turbo & Base, low-VRAM image LoRAs). Use when the user wants to train a WAN or Z-Image LoRA; covers local + RunPod setup, dataset prep, key params, and using the result in a ComfyUI workflow.★ 759 GitHub starsSkillAnime/illustration text-to-imageANIMA 1.0 (Anima Base Ultra) Text-to-Image Workflowsartokun/comfyui-mcp · by artokunAnime/illustration text-to-image (ANIMA 1.0, ~2B Cosmos DiT). Use for anime, manga, illustrated characters; accepts Danbooru tags + natural language; runs/trains on <6GB VRAM; includes anime inpainting via Anima-LLLite ControlNet★ 759 GitHub stars

More from artokun

SkillTrain custom LoRAs with ostris AI-ToolkitAI-Toolkit LoRA Trainer (WAN 2.2 & Z-Image)artokun/comfyui-mcp · by artokunTrain custom LoRAs with ostris AI-Toolkit. Covers WAN 2.2/2.1 (people, styles, video motion) and Z-Image (Turbo & Base, low-VRAM image LoRAs). Use when the user wants to train a WAN or Z-Image LoRA; covers local + RunPod setup, dataset prep, key params, and using the result in a ComfyUI workflow.★ 759 GitHub starsSkillAnime/illustration text-to-imageANIMA 1.0 (Anima Base Ultra) Text-to-Image Workflowsartokun/comfyui-mcp · by artokunAnime/illustration text-to-image (ANIMA 1.0, ~2B Cosmos DiT). Use for anime, manga, illustrated characters; accepts Danbooru tags + natural language; runs/trains on <6GB VRAM; includes anime inpainting via Anima-LLLite ControlNet★ 759 GitHub starsSkillAuthoring & Publishing ComfyUI Custom Nodesartokun/comfyui-mcp · by artokunAuthoring & publishing ComfyUI custom nodes to the Comfy Registry, covering node structure, pyproject.toml spec, comfy-cli publishing, and CI★ 759 GitHub starsSkillTrain a custom anime LoRA on the ANIMA base modelCitron Anima LoRA Trainerartokun/comfyui-mcp · by artokunTrain a custom anime LoRA on the ANIMA base model with Citron's local Gradio trainer (kohya sd-scripts), <6GB VRAM, character/style LoRAs; covers setup, dataset prep, training params, and using the result in the anima-base workflow★ 759 GitHub starsSkillDiscover Civitai models with the BUILT-IN downloadmodelCivitai + comfyui-mcpartokun/comfyui-mcp · by artokunDiscover Civitai models with the BUILT-IN download_model action:"search_civitai" and install/generate them locally. Find a checkpoint/LoRA/embedding on Civitai, download it into ComfyUI, and use its trigger words. Optionally pair the official Civitai MCP for community features (images browsing, posting, collections).★ 759 GitHub starsSkillDiagnose and fix video/image color OBJECTIVELYColor Correction (measure, don't eyeball)artokun/comfyui-mcp · by artokunDiagnose and fix video/image color OBJECTIVELY with the get_image (action:"analyze_color") tool (scopes/stats such as black/white points, contrast, saturation, clipping, cast) instead of eyeballing a contact sheet. Covers the "washed out" signature, why reference color-match (mkl/ColorMatch/ColorMatchAdobe) CAN'T add contrast a flat source lacks, the levels/contrast-stretch fix (core AdjustContrast / CurveEditor), the measure→fix→re-measure loop, the side-by-side sandbox pattern, and where to place the fix in a render graph (after decode, before save). Use when a render looks washed out / flat / dull / over-saturated / color-cast, or when deciding between a color-match and a contrast/levels fix.★ 759 GitHub stars