一键导入
comfyui-core
Core ComfyUI knowledge — workflow format, node types, pipeline patterns, and MCP tool usage
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Core ComfyUI knowledge — workflow format, node types, pipeline patterns, and MCP tool usage
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Drive the LTX Director (Timeline) node — its Add Image/Text/Audio buttons are DOM-only and cannot be clicked by an agent; edit the hidden timeline_data JSON widget instead. Load when a workflow contains LTXDirector / LTXDirectorGuide / PromptRelayEncodeTimeline, or when asked to add, move, retime, or remove timeline segments (image / text / audio / motion).
Train a character/identity LoRA locally on FLUX.1-dev via the comfyui-mcp train_* tools (GPU Docker + ostris ai-toolkit). Use when the user wants to train a LoRA of a person/character from their photos on the local GPU — covers dataset prep, launch, monitoring, and using the result in ComfyUI. For WAN/Z-Image training via the ai-toolkit UI see ai-toolkit-trainer.
Discover Civitai models with the BUILT-IN search_civitai_models tool 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).
Run the ComfyUI agent locally for FREE — no subscription, no API key, fully offline — using our gemma4 models fine-tuned on the comfyui-mcp tool suite via Ollama. Use when the user asks about running locally, running for free, offline use, avoiding API costs, Ollama setup, or which local model to pick.
Debug a WRONG or imperfect render (not a hard error) by inspecting inputs and intermediate steps with run-to-node — render one branch up to an output, preview-tap latents/masks/preprocessor maps, localize the first bad stage, then fix. Use when a final image/video comes out wrong — artifacts, wrong subject/pose/composition/color, blur, a ControlNet/IPAdapter/mask/LoRA not taking, a two-stage refiner or upscale degrading the result — rather than the run failing with an error (for errors/OOM/missing nodes use the troubleshooting skill).
Full production pipeline — story to scenes, Z-Image start frames, Qwen Edit end frames, WAN FLF video clips, ffmpeg concatenation
| name | comfyui-core |
| description | Core ComfyUI knowledge — workflow format, node types, pipeline patterns, and MCP tool usage |
| globs | ["**/*.json"] |
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" }
}
}
"1", "2", etc.)class_type is the exact Python class name of the nodeinputs contains both widget values (scalars) and connections (arrays)["sourceNodeId", outputIndex] — a 2-element array where:
output list (0-based)_meta is optional, used for display titles only"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)
{ "1": { class_type, inputs }, "2": { ... } } — compact, used by enqueue_workflow, validate_workflow, modify_workflow, etc.{ "nodes": [...], "links": [...] } — includes layout positions, sizes, groups, and visual metadata so ComfyUI's canvas can open and edit itsave_workflow auto-converts API-format input to Web UI format with a generated layout — but prefer passing real Web UI format (from get_workflow format="ui") since a generated layout loses the original node positions/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_meta.mode: "muted" — these are inactive but visible for understanding the workflow_meta.title and Constant key for tracing data flowanalyze_workflow(filename) — use this first to understand any saved workflow. 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.list_workflows — list all saved workflows in ComfyUI's user libraryget_workflow(filename) — load raw workflow JSON. Only use when you need the actual JSON for enqueue_workflow, modify_workflow, or save_workflow. Use analyze_workflow instead for understanding. For save_workflow, request format="ui" so the workflow stays editable in the frontend.save_workflow(filename, workflow) — save 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 are 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 format="ui" and edit that, so positions/groups survive.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 |
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
Same as txt2img but replace EmptyLatentImage with:
LoadImage → IMAGE
VAEEncode (pixels, vae) → LATENT → KSampler.latent_image
Set KSampler.denoise to 0.5–0.8 (lower = closer to input image).
LoadImage → IMAGE
UpscaleModelLoader → UPSCALE_MODEL
ImageUpscaleWithModel (upscale_model, image) → IMAGE
SaveImage (images)
LoadImage (image) → IMAGE → VAEEncode → LATENT
LoadImage (mask) → MASK
SetLatentNoiseMask (samples, mask) → LATENT → KSampler.latent_image
create_workflow with template "txt2img" and your paramsenqueue_workflow with the returned JSON — returns prompt_id immediatelyget_job_status with the prompt_id until done is truelist_output_images (limit 1) to find the generated image, then Read to display itget_node_info — query what nodes are available and their schemasmodify_workflow — patch an existing workflow (set_input, add_node, remove_node, connect, insert_between)visualize_workflow — see a workflow as a mermaid diagramvisualize_workflow — workflow JSON → mermaid diagrammermaid_to_workflow — mermaid diagram → workflow JSON (uses /object_info for schema resolution)list_local_models — see what's installedsearch_models — find models on HuggingFacedownload_model — download to ComfyUI's models directoryImportant: Never ask the user to manually download models. If a required model is missing, proactively search for it and download it yourself:
list_local_models firstsearch_models or CivitAI via their REST APIdownload_model to install it directly to the correct subfolderCivitAI API (when CIVITAI_API_TOKEN env var is available):
GET https://civitai.com/api/v1/models?query={query}&types=Checkpoint&sort=Most+Downloaded&limit=5GET https://civitai.com/api/v1/models/{modelId}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).
search_custom_nodes — search the ComfyUI Registryget_node_pack_details — get details about a specific packgenerate_node_skill — auto-generate a skill file for a node packenqueue_workflow submits to ComfyUI's queue and returns prompt_id + queue position immediately. It does NOT block.
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:
KSampler step 12/20 (60%))Standard generation pattern:
create_workflow or build workflow JSON + enqueue_workflow (repeat for batch)list_output_images or Read to display the generated imagesDo NOT poll get_job_status in a loop. The background monitor replaces polling entirely.
Fallback: If the monitor script is unavailable, use get_job_status to poll until done is true.
get_queue — shows running/pending job counts and prompt_idsget_job_status — check if a specific prompt_id is running, pending, or donecancel_job — interrupt a running job (pass optional prompt_id to target a specific one)cancel_queued_job — remove a specific pending job from the queue by prompt_idclear_queue — remove all pending jobs (does NOT stop the currently running job)When to use queue tools:
get_job_status for a quick boolean check (prefer background monitor for ongoing tracking)cancel_job stops what's running now; cancel_queued_job removes a pending oneclear_queue then optionally cancel_jobget_system_stats — GPU, VRAM, Python version, OS detailsget_queue — see running/pending jobs (also listed above under Queue Management)When ComfyUI is unresponsive or crashed:
get_system_stats — if it fails, ComfyUI is downrestart_comfyui to restart it (preserves launch args from prior stop_comfyui)start_comfyui or ask the user to start it manuallyWhen a job appears hung (monitor shows [STALL]):
get_system_stats — look at VRAM usage (OOM causes hangs)cancel_job to interrupt the stuck jobrestart_comfyui to force-restartclear_vram after restart to free GPU memory before retrying| 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) |
The visualize_workflow tool produces mermaid flowcharts with:
loading, conditioning, sampling, image, output-->|MODEL|, -->|CLIP|, -->|LATENT|, etc.LR (left-to-right) by default, TB (top-to-bottom) for large workflowsThe mermaid_to_workflow tool parses mermaid back into workflow JSON, using connection type labels to resolve the correct input/output slots via /object_info schemas.
["1", 0] not [1, 0] — node IDs are strings{ nodes: [], links: [] } — use API formatget_node_infoenqueue_workflow randomizes seeds by default unless disable_random_seed: true