twwch/workflow-skill/comfyui-workflow
Claude Code and agent skill by twwch/workflow-skill
- community
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install twwch/workflow-skill/comfyui-workflowSKILL.md
ComfyUI Workflow Generator
Description
Generate ready-to-use ComfyUI workflow JSON files through natural language conversation. Users describe what they want to create, and this skill produces valid ComfyUI API-format JSON that can be directly imported and executed.
Activation
Trigger when the user asks to:
- Create/generate a ComfyUI workflow
- Make an image generation workflow
- Build a video generation pipeline
- Set up txt2img, img2img, img2vid, txt2vid workflows
- Generate a ComfyUI JSON file
Trigger keywords: comfyui, workflow, 工作流, 文生图, 图生图, 文生视频, 图生视频, txt2img, img2img, txt2vid, img2vid, upscale, 放大, inpaint, 重绘, controlnet, lora, sd3, flux, ltxv, mochi, cosmos, stable audio, 音频生成, hunyuan3d, 3d生成, stable cascade, 图生3d
Instructions
Step 1: Understand User Intent
Ask the user what they want to create. Gather:
- Task type: txt2img / img2img / txt2vid / img2vid / upscale / inpaint / audio / 3d
- Model: SD1.5 / SDXL / FLUX / SD3 / Wan2.2 / HunyuanVideo / LTXV / Mochi / Cosmos / StableAudio / Hunyuan3D / StableCascade
- Key parameters: resolution, steps, CFG, sampler
- Optional modules: ControlNet, LoRA, IPAdapter, upscale model
- Prompt content: positive and negative prompts
If the user is vague, suggest the most common configuration for their task type.
Step 2: Select and Compose Template
Based on user intent, load the appropriate base template from templates/ directory and customize it:
- Read the matching template JSON file
- Modify parameters according to user requirements
- Add optional modules (ControlNet, LoRA, etc.) by inserting additional nodes and links
- Validate the workflow DAG structure
Fallback — Official Template Repository: If no matching template is found in the local templates/ directory, search the ComfyUI official template repository: https://github.com/Comfy-Org/workflow_templates/tree/main/templates . The official repo contains 443 templates across 9 categories (Image / Video / Audio / 3D / LLM / Utility / Use Cases / Getting Started / Node Basics). First read templates/index.json to find a matching template name, then download the corresponding JSON file to use as the base template. The official templates use the same format as this project (LiteGraph UI format, version 0.4).
Step 3: Generate and Deliver
- Output the complete workflow JSON (Litegraph UI format)
- Save final
.jsonfile to current working directory. Any intermediate/temp files go to/tmp/comfyui-workflow/. - MANDATORY: Add `models` array to the JSON top level — extract ALL model filenames from nodes (ckpt_name, unet_name, vae_name, clip_name, lora_name, etc.), look up their download URLs from the Model Download Guide below, and include them. This makes ComfyUI auto-prompt download for missing models on import.
- Provide a brief explanation of the workflow structure
- List any required custom nodes the user needs to install
Workflow JSON Format Rules
CRITICAL — follow these rules exactly:
- Use Litegraph UI format (NOT API format) — with
nodesarray,linksarray,version: 0.4 - Top-level MUST have:
id(UUID string),revision(0),last_node_id,last_link_id,nodes,links,groups([]),config({}),extra({}),version(0.4) - Each node has:
id(int),type,pos([x,y]),size([w,h]),flags({}),order(int),mode(0),inputs,outputs,properties,widgets_values - Node inputs include BOTH connection inputs (
{"name": "model", "type": "MODEL", "link": 4}) AND widget inputs ({"name": "seed", "type": "INT", "widget": {"name": "seed"}, "link": null}) - All inputs/outputs should have
labelandlocalized_namefields matchingname - Links format:
[link_id, source_node_id, source_slot, target_node_id, target_slot, "TYPE"] widgets_valuesarray order must match the widget inputs order- Every workflow MUST have at least one output node (SaveImage, PreviewImage, SaveVideo, etc.)
- All
requiredinputs must be provided (checkreferences/nodes/index.mdand the category files underreferences/nodes/, plusreferences/node-registry-additions.md) - Values must satisfy min/max constraints
- For model/file selection inputs (ckpt_name, lora_name, etc.), use the real model filenames from the Model Download Guide below
- MANDATORY: Every workflow JSON MUST include a top-level `models` array. Scan all nodes for model file references (ckpt_name, unet_name, vae_name, clip_name, clip_name1, clip_name2, clip_name3, control_net_name, lora_name, model_name) and add each referenced model to the
modelsarray withname,url(direct HuggingFace resolve link), anddirectory. This enables ComfyUI to auto-detect missing models and prompt the user to download them on import. Example:
Common Output Slot Mappings
LLM / Text Generation Nodes (comfyui_LLM_party)
ComfyUI integrates LLM via comfyui_LLM_party custom node package (需安装: https://github.com/heshengtao/comfyui_LLM_party).
IMPORTANT: When user requests a workflow with LLM (script generation, character parsing, storyboard breakdown, prompt enhancement), you MUST:
- Ask the user which LLM provider they want to use (OpenAI / Claude / Gemini / Ollama / DeepSeek / other)
- Ask for their model preference or recommend the latest best model for their use case
- Use the corresponding loader node and configure accordingly
Supported Providers & Loader Nodes
| Provider | Loader Node | base_url | Recommended Model | |
|---|---|---|---|---|
| OpenAI | LLM_api_loader | https://api.openai.com/v1 | gpt-4.1 | |
| Claude | aisuite_loader (provider="anthropic") | https://api.anthropic.com/v1 | claude-sonnet-4-20250514 | |
| Gemini | LLM_api_loader | https://generativelanguage.googleapis.com/v1beta/openai | gemini-2.5-flash | |
| DeepSeek | LLM_api_loader | https://api.deepseek.com/v1 | deepseek-chat | |
| Ollama (local) | LLM_api_loader (is_ollama=true) | http://127.0.0.1:11434/v1/ | qwen2.5:14b | |
| OpenAI-compatible | LLM_api_loader | user-provided | user-provided |
CRITICAL: Exact class_type Names (use these EXACTLY in workflow JSON)
DO NOT invent node names. Only use these exact class_type strings:
| class_type (exact) | Purpose | Source | |
|---|---|---|---|
LLM_api_loader | Load API LLM (OpenAI/Claude/Gemini/DeepSeek/Ollama) | llm.py | |
easy_LLM_api_loader | Simplified API LLM loader (preset models) | llm.py | |
aisuite_loader | Multi-provider loader (anthropic/aws/google/huggingface) | llm.py | |
LLM | Main LLM chat node (multi-turn, vision, tools) | llm.py | |
LLM_local | Local model chat node | llm.py | |
LLM_local_loader | Load local LLM model | llm.py | |
mini_party | Quick single-turn LLM call | custom_tool/miniparty.py | |
CLIPTextEncode_party | Convert STRING → CONDITIONING (bridge LLM→image) | llm.py | |
KSampler_party | KSampler variant for party workflows | llm.py | |
VAEDecode_party | VAEDecode variant for party workflows | llm.py | |
json_extractor | Clean/repair JSON from LLM output | custom_tool/json_extractor.py | |
json_get_value | Extract field from JSON by key | custom_tool/json_parser.py | |
text2json | Convert text lines to JSON | custom_tool/text2json.py | |
show_text_party | Display text (debug/preview) | llm.py | |
string_logic | Conditional string routing | llm.py | |
string_combine | Concatenate strings | llm.py | |
string_combine_plus | Concatenate many strings | llm.py | |
load_persona | Load preset persona/system prompt | llm.py | |
custom_persona | Custom persona with {variable} templates | llm.py | |
replace_string | Find and replace in strings | llm.py | |
substring | Extract substring | llm.py |
Core LLM Nodes — Detailed Specs
LLM_api_loader (class_type: LLM_api_loader)
- Inputs: model_name (STRING), base_url (STRING, optional), api_key (STRING, optional), is_ollama (BOOLEAN, optional)
- Outputs: model (CUSTOM) [slot 0]
- Widget values order: [model_name, base_url, api_key, is_ollama]
LLM (class_type: LLM)
- Inputs (required): system_prompt (STRING, widget), user_prompt (STRING, widget), model (CUSTOM, connection from loader), temperature (FLOAT, widget, default=0.7), is_memory (COMBO "enable"/"disable", widget), is_tools_in_sys_prompt (COMBO, widget), is_locked (COMBO, widget), main_brain (COMBO, widget), max_length (INT, widget, default=1920)
- Inputs (optional): system_prompt_input (STRING, connection), user_prompt_input (STRING, connection), tools (STRING), file_content (STRING), images (IMAGE)
- Outputs: assistant_response (STRING) [slot 0], history (STRING) [slot 1], tool (STRING) [slot 2], image (IMAGE) [slot 3]
mini_party (class_type: mini_party)
- Inputs: input_str (STRING, connection), prompt (STRING, widget), model_name (STRING, widget), base_url (STRING, widget), api_key (STRING, widget), is_enable (BOOLEAN, widget)
- Outputs: STRING [slot 0]
LLM Output → Image/Video Bridge Nodes
CLIPTextEncode_party (class_type: CLIPTextEncode_party)
- Inputs: clip (CLIP, connection), text (STRING, connection from LLM output)
- Outputs: CONDITIONING [slot 0]
- Usage: Bridge LLM text → image generation. Connect LLM.assistant_response → CLIPTextEncode_party.text
json_extractor (class_type: json_extractor)
- Inputs: input (STRING, connection)
- Outputs: STRING [slot 0] (cleaned/repaired JSON)
json_get_value (class_type: json_get_value)
- Inputs: text (STRING, connection), key (STRING, widget)
- Outputs: ANY [slot 0] (extracted value)
LLM Workflow Patterns
Pattern: Multi-stage video production pipeline
Pattern: Simple prompt enhancement
Node Reference
IMPORTANT: Do NOT read the entire node registry at once. Read only the category you need.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/comfyui-workflow/SKILL.md
Popularity
- Repository stars
- 56
- Repository forks
- 14
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 26 Apr 2026, 6 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/twwch/workflow-skill/comfyui-workflow)