Skip to content
Back to search

comfyui-workflow-skill

Natural language → ComfyUI workflow JSON. 34 built-in templates, 360+ node definitions, auto model download. Supports txt2img, img2img, txt2vid, img2vid, audio, 3D generation across SD1.5/SDXL/SD3/FLUX/Wan2.2/HunyuanVideo/LTXV/Mochi/Cosmos + LLM integration. Works as a skill for Claude Code, Cursor, and other AI coding agents.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/lingyichen-ai--comfyui-workflow-skill/badge.svg)](/listings/lingyichen-ai--comfyui-workflow-skill)

HTML

<a href="/listings/lingyichen-ai--comfyui-workflow-skill"><img src="/api/listings/lingyichen-ai--comfyui-workflow-skill/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

前置条件

- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) 已安装 - Git 已安装

方法一:Git Clone + 符号链接(推荐,自动同步更新)

# 1. Clone 项目到本地
git clone https://github.com/twwch/comfyui-workflow-skill.git ~/codes/comfyui-workflow-skill

# 2. 创建符号链接到 Claude Code skills 目录
ln -s ~/codes/comfyui-workflow-skill ~/.claude/skills/comfyui-workflow

方法二:直接 Clone 到 skills 目录

git clone https://github.com/twwch/comfyui-workflow-skill.git ~/.claude/skills/comfyui-workflow

方法三:手动复制

cp -r comfyui-workflow-skill/ ~/.claude/skills/comfyui-workflow

验证安装

ls ~/.claude/skills/comfyui-workflow/SKILL.md
# 应该输出文件路径,说明安装成功

卸载

rm -rf ~/.claude/skills/comfyui-workflow

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 400 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # ComfyUI Workflow Generator
  2. ## Description
  3. 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.
  4. ## Activation
  5. Trigger when the user asks to:
  6. - Create/generate a ComfyUI workflow
  7. - Make an image generation workflow
  8. - Build a video generation pipeline
  9. - Set up txt2img, img2img, img2vid, txt2vid workflows
  10. - Generate a ComfyUI JSON file
  11. Trigger keywords: comfyui, workflow, 工作流, 文生图, 图生图, 文生视频, 图生视频, txt2img, img2img, txt2vid, img2vid, upscale, 放大, inpaint, 重绘, controlnet, lora, sd3, flux, ltxv, mochi, cosmos, stable audio, 音频生成, hunyuan3d, 3d生成, stable cascade, 图生3d
  12. ## Instructions
  13. ### Step 1: Understand User Intent
  14. Ask the user what they want to create. Gather:
  15. 1. **Task type**: txt2img / img2img / txt2vid / img2vid / upscale / inpaint / audio / 3d
  16. 2. **Model**: SD1.5 / SDXL / FLUX / SD3 / Wan2.2 / HunyuanVideo / LTXV / Mochi / Cosmos / StableAudio / Hunyuan3D / StableCascade
  17. 3. **Key parameters**: resolution, steps, CFG, sampler
  18. 4. **Optional modules**: ControlNet, LoRA, IPAdapter, upscale model
  19. 5. **Prompt content**: positive and negative prompts
  20. If the user is vague, suggest the most common configuration for their task type.
  21. ### Step 2: Select and Compose Template
  22. Based on user intent, load the appropriate base template from `templates/` directory and customize it:
  23. 1. Read the matching template JSON file
  24. 2. Modify parameters according to user requirements
  25. 3. Add optional modules (ControlNet, LoRA, etc.) by inserting additional nodes and links
  26. 4. Validate the workflow DAG structure
  27. **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).
  28. ### Step 3: Generate and Deliver
  29. 1. Output the complete workflow JSON (Litegraph UI format)
  30. 2. Save it to a `.json` file if the user requests
  31. 3. **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.
  32. 4. Provide a brief explanation of the workflow structure
  33. 5. List any required custom nodes the user needs to install
  34. ### Workflow JSON Format Rules
  35. **CRITICAL — follow these rules exactly:**
  36. - Use **Litegraph UI format** (NOT API format) — with `nodes` array, `links` array, `version: 0.4`
  37. - Top-level MUST have: `id` (UUID string), `revision` (0), `last_node_id`, `last_link_id`, `nodes`, `links`, `groups` ([]), `config` ({}), `extra` ({}), `version` (0.4)
  38. - Each node has: `id` (int), `type`, `pos` ([x,y]), `size` ([w,h]), `flags` ({}), `order` (int), `mode` (0), `inputs`, `outputs`, `properties`, `widgets_values`
  39. - Node inputs include BOTH connection inputs (`{"name": "model", "type": "MODEL", "link": 4}`) AND widget inputs (`{"name": "seed", "type": "INT", "widget": {"name": "seed"}, "link": null}`)
  40. - All inputs/outputs should have `label` and `localized_name` fields matching `name`
  41. - Links format: `[link_id, source_node_id, source_slot, target_node_id, target_slot, "TYPE"]`
  42. - `widgets_values` array order must match the widget inputs order
  43. - Every workflow MUST have at least one output node (SaveImage, PreviewImage, SaveVideo, etc.)
  44. - All `required` inputs must be provided (check `references/nodes/index.md` and the category files under `references/nodes/`, plus `references/node-registry-additions.md`)
  45. - Values must satisfy min/max constraints
  46. - For model/file selection inputs (ckpt_name, lora_name, etc.), use the real model filenames from the Model Download Guide below
  47. - **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 `models` array with `name`, `url` (direct HuggingFace resolve link), and `directory`. This enables ComfyUI to auto-detect missing models and prompt the user to download them on import. Example:
  48. ```json
  49. "models": [
  50. {"name": "flux1-dev.safetensors", "url": "https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/flux1-dev.safetensors", "directory": "diffusion_models"},
  51. {"name": "clip_l.safetensors", "url": "https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors", "directory": "text_encoders"}
  52. ]
  53. ```
  54. ### Common Output Slot Mappings
  55. ```
  56. CheckpointLoaderSimple: 0=MODEL, 1=CLIP, 2=VAE
  57. UNETLoader: 0=MODEL
  58. CLIPLoader: 0=CLIP
  59. DualCLIPLoader: 0=CLIP
  60. VAELoader: 0=VAE
  61. LoraLoader: 0=MODEL, 1=CLIP
  62. CLIPTextEncode: 0=CONDITIONING
  63. EmptyLatentImage: 0=LATENT
  64. KSampler: 0=LATENT
  65. VAEDecode: 0=IMAGE
  66. LoadImage: 0=IMAGE, 1=MASK
  67. ControlNetLoader: 0=CONTROL_NET
  68. UpscaleModelLoader: 0=UPSCALE_MODEL
  69. ImageUpscaleWithModel: 0=IMAGE
  70. CLIPVisionLoader: 0=CLIP_VISION
  71. CLIPVisionEncode: 0=CLIP_VISION_OUTPUT
  72. ```
  73. ### LLM / Text Generation Nodes (comfyui_LLM_party)
  74. ComfyUI integrates LLM via **comfyui_LLM_party** custom node package (需安装: https://github.com/heshengtao/comfyui_LLM_party).
  75. **IMPORTANT:** When user requests a workflow with LLM (script generation, character parsing, storyboard breakdown, prompt enhancement), you MUST:
  76. 1. **Ask the user which LLM provider they want to use** (OpenAI / Claude / Gemini / Ollama / DeepSeek / other)
  77. 2. **Ask for their model preference** or recommend the latest best model for their use case
  78. 3. Use the corresponding loader node and configure accordingly
  79. #### Supported Providers & Loader Nodes
  80. | Provider | Loader Node | base_url | Recommended Model |
  81. |----------|------------|----------|-------------------|
  82. | OpenAI | `LLM_api_loader` | `https://api.openai.com/v1` | gpt-4.1 |
  83. | Claude | `aisuite_loader` (provider="anthropic") | `https://api.anthropic.com/v1` | claude-sonnet-4-20250514 |
  84. | Gemini | `LLM_api_loader` | `https://generativelanguage.googleapis.com/v1beta/openai` | gemini-2.5-flash |
  85. | DeepSeek | `LLM_api_loader` | `https://api.deepseek.com/v1` | deepseek-chat |
  86. | Ollama (local) | `LLM_api_loader` (is_ollama=true) | `http://127.0.0.1:11434/v1/` | qwen2.5:14b |
  87. | OpenAI-compatible | `LLM_api_loader` | user-provided | user-provided |
  88. #### CRITICAL: Exact class_type Names (use these EXACTLY in workflow JSON)
  89. **DO NOT invent node names. Only use these exact class_type strings:**
  90. | class_type (exact) | Purpose | Source |
  91. |---------------------|---------|--------|
  92. | `LLM_api_loader` | Load API LLM (OpenAI/Claude/Gemini/DeepSeek/Ollama) | llm.py |
  93. | `easy_LLM_api_loader` | Simplified API LLM loader (preset models) | llm.py |
  94. | `aisuite_loader` | Multi-provider loader (anthropic/aws/google/huggingface) | llm.py |
  95. | `LLM` | Main LLM chat node (multi-turn, vision, tools) | llm.py |
  96. | `LLM_local` | Local model chat node | llm.py |
  97. | `LLM_local_loader` | Load local LLM model | llm.py |
  98. | `mini_party` | Quick single-turn LLM call | custom_tool/miniparty.py |
  99. | `CLIPTextEncode_party` | Convert STRING → CONDITIONING (bridge LLM→image) | llm.py |
  100. | `KSampler_party` | KSampler variant for party workflows | llm.py |
  101. | `VAEDecode_party` | VAEDecode variant for party workflows | llm.py |
  102. | `json_extractor` | Clean/repair JSON from LLM output | custom_tool/json_extractor.py |
  103. | `json_get_value` | Extract field from JSON by key | custom_tool/json_parser.py |
  104. | `text2json` | Convert text lines to JSON | custom_tool/text2json.py |
  105. | `show_text_party` | Display text (debug/preview) | llm.py |
  106. | `string_logic` | Conditional string routing | llm.py |
  107. | `string_combine` | Concatenate strings | llm.py |
  108. | `string_combine_plus` | Concatenate many strings | llm.py |
  109. | `load_persona` | Load preset persona/system prompt | llm.py |
  110. | `custom_persona` | Custom persona with {variable} templates | llm.py |
  111. | `replace_string` | Find and replace in strings | llm.py |
  112. | `substring` | Extract substring | llm.py |
  113. #### Core LLM Nodes — Detailed Specs
  114. **LLM_api_loader** (class_type: `LLM_api_loader`)
  115. - **Inputs:** model_name (STRING), base_url (STRING, optional), api_key (STRING, optional), is_ollama (BOOLEAN, optional)
  116. - **Outputs:** model (CUSTOM) [slot 0]
  117. - **Widget values order:** [model_name, base_url, api_key, is_ollama]
  118. **LLM** (class_type: `LLM`)
  119. - **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)
  120. - **Inputs (optional):** system_prompt_input (STRING, connection), user_prompt_input (STRING, connection), tools (STRING), file_content (STRING), images (IMAGE)
  121. - **Outputs:** assistant_response (STRING) [slot 0], history (STRING) [slot 1], tool (STRING) [slot 2], image (IMAGE) [slot 3]
  122. **mini_party** (class_type: `mini_party`)
  123. - **Inputs:** input_str (STRING, connection), prompt (STRING, widget), model_name (STRING, widget), base_url (STRING, widget), api_key (STRING, widget), is_enable (BOOLEAN, widget)
  124. - **Outputs:** STRING [slot 0]
  125. #### LLM Output → Image/Video Bridge Nodes
  126. **CLIPTextEncode_party** (class_type: `CLIPTextEncode_party`)
  127. - **Inputs:** clip (CLIP, connection), text (STRING, connection from LLM output)
  128. - **Outputs:** CONDITIONING [slot 0]
  129. - **Usage:** Bridge LLM text → image generation. Connect LLM.assistant_response → CLIPTextEncode_party.text
  130. **json_extractor** (class_type: `json_extractor`)
  131. - **Inputs:** input (STRING, connection)
  132. - **Outputs:** STRING [slot 0] (cleaned/repaired JSON)
  133. **json_get_value** (class_type: `json_get_value`)
  134. - **Inputs:** text (STRING, connection), key (STRING, widget)
  135. - **Outputs:** ANY [slot 0] (extracted value)
  136. #### LLM Workflow Patterns
  137. **Pattern: Multi-stage video production pipeline**
  138. ```
  139. LLM_api_loader(model, base_url, api_key) → model
  140. ↓
  141. LLM(model, system="You are a screenwriter", user="Write a script about: {input}") → script
  142. ↓
  143. LLM(model, system="Extract all characters as JSON", user=script) → characters_json
  144. ↓
  145. json_extractor(characters_json) → clean JSON → json_get_value(key="character_1.appearance") → prompt
  146. ↓
  147. CLIPTextEncode_party(prompt) or CLIPTextEncodeFlux(prompt) → CONDITIONING → FLUX → character_ref_image
  148. ↓
  149. LLM(model, system="Break into 10 shots with video prompts", user=script) → shots_json
  150. ↓
  151. For each shot:
  152. json_get_value(shots_json, "shot_N.description") → scene_prompt
  153. FLUX(scene_prompt + IP-Adapter(character_ref)) → shot_ref_image
  154. WanImageToVideo(shot_ref_image + video_prompt) → 10s video clip
  155. ```
  156. **Pattern: Simple prompt enhancement**
  157. ```
  158. mini_party(input="a cat", prompt="Enhance this into a detailed image prompt") → enhanced_prompt
  159. ↓
  160. CLIPTextEncode_party(enhanced_prompt) → CONDITIONING → KSampler → image
  161. ```
  162. ### Node Reference
  163. **IMPORTANT: Do NOT read the entire node registry at once. Read only the category you need.**
  164. 1. First read the index: `references/nodes/index.md` — lists all 42 categories with file pointers
  165. 2. Then read only the specific category file you need, e.g.:
  166. - `references/nodes/01-loaders.md` — CheckpointLoaderSimple, UNETLoader, VAELoader, CLIPLoader, LoraLoader
  167. - `references/nodes/02-conditioning.md` — CLIPTextEncode, CLIPTextEncodeFlux, CLIPTextEncodeSD3
  168. - `references/nodes/07-video-wan.md` — WanImageToVideo, WanCameraImageToVideo, WanFirstLastFrameToVideo
  169. - `references/nodes/09-flux.md` — CLIPTextEncodeFlux, BasicGuider, SamplerCustomAdvanced
  170. - `references/nodes/15-custom-samplers.md` — BasicScheduler, KSamplerSelect, RandomNoise
  171. - `references/nodes/21-audio.md` — StableAudio, EmptyLatentAudio, VAEDecodeAudio
  172. - `references/nodes/22-ltxv.md` — EmptyLTXVLatentVideo, LTXVImgToVideo
  173. - `references/nodes/25-cosmos.md` — EmptyCosmosLatentVideo, CosmosImageToVideoLatent
  174. - `references/nodes/31-hunyuan-3d.md` — Hunyuan3Dv2Conditioning, VAEDecodeHunyuan3D, SaveGLB
  175. 3. Also available:
  176. - `references/workflow-format.md` — JSON format specification
  177. - `references/common-workflows.md` — common workflow patterns and best practices
  178. ### Available Templates
  179. #### Text-to-Image
  180. | Template | File | Description |
  181. |----------|------|-------------|
  182. | SD 1.5 Text to Image | `templates/sd15-txt2img.json` | Basic SD 1.5 text-to-image |
  183. | SDXL Text to Image | `templates/sdxl-txt2img.json` | SDXL with dual CLIP encoding |
  184. | SD3 Text to Image | `templates/sd3-txt2img.json` | SD3 with TripleCLIPLoader + CLIPTextEncodeSD3 |
  185. | FLUX Text to Image | `templates/flux-txt2img.json` | FLUX.1 with guidance, advanced sampling |
  186. #### Image-to-Image
  187. | Template | File | Description |
  188. |----------|------|-------------|
  189. | SD 1.5 Image to Image | `templates/sd15-img2img.json` | SD 1.5 img2img with VAEEncode |
  190. | SDXL Image to Image | `templates/sdxl-img2img.json` | SDXL img2img |
  191. | FLUX Image to Image | `templates/flux-img2img.json` | FLUX img2img with advanced sampling |
  192. #### LoRA
  193. | Template | File | Description |
  194. |----------|------|-------------|
  195. | SD 1.5 + LoRA | `templates/sd15-lora.json` | SD 1.5 with LoRA loading |
  196. | SDXL + LoRA | `templates/sdxl-lora.json` | SDXL with LoRA loading |
  197. | FLUX + LoRA | `templates/flux-lora.json` | FLUX.1 with LoRA loading |
  198. #### ControlNet
  199. | Template | File | Description |
  200. |----------|------|-------------|
  201. | SD 1.5 + ControlNet | `templates/sd15-controlnet.json` | SD 1.5 with ControlNet |
  202. | SDXL + ControlNet | `templates/sdxl-controlnet.json` | SDXL with ControlNetApplyAdvanced |
  203. #### Inpainting
  204. | Template | File | Description |
  205. |----------|------|-------------|
  206. | SD 1.5 Inpaint | `templates/sd15-inpaint.json` | SD 1.5 inpainting workflow |
  207. | SDXL Inpaint | `templates/sdxl-inpaint.json` | SDXL inpainting with VAEEncodeForInpaint |
  208. #### Video Generation
  209. | Template | File | Description |
  210. |----------|------|-------------|
  211. | Wan 2.2 Text to Video | `templates/wan22-txt2vid.json` | Wan 2.2 text-to-video (832x480, 81 frames) |
  212. | Wan 2.2 Image to Video | `templates/wan22-img2vid.json` | Wan 2.2 image-to-video with CLIP vision |
  213. | Wan 2.2 First-Last Frame | `templates/wan22-first-last.json` | Wan 2.2 first+last frame interpolation |
  214. | Wan 2.2 Fun Control | `templates/wan22-fun-control.json` | Wan 2.2 control video + reference image |
  215. | Wan 2.2 Camera Control | `templates/wan22-camera.json` | Wan 2.2 camera motion control |
  216. | HunyuanVideo T2V | `templates/hunyuan-video.json` | HunyuanVideo text-to-video |
  217. | HunyuanVideo I2V | `templates/hunyuan-video-i2v.json` | HunyuanVideo image-to-video |
  218. | LTXV Text to Video | `templates/ltxv-txt2vid.json` | LTXV text-to-video (768x512, 97 frames) |
  219. | LTXV Image to Video | `templates/ltxv-img2vid.json` | LTXV image-to-video with LTXVImgToVideo |
  220. | Mochi Text to Video | `templates/mochi-txt2vid.json` | Mochi text-to-video (848x480, 25 frames) |
  221. | Cosmos Text to Video | `templates/cosmos-txt2vid.json` | Cosmos text-to-video (1280x704, 121 frames) |
  222. | Cosmos Image to Video | `templates/cosmos-img2vid.json` | Cosmos image-to-video with start frame |
  223. #### Upscale
  224. | Template | File | Description |
  225. |----------|------|-------------|
  226. | Image Upscale | `templates/upscale-model.json` | Upscale with model (RealESRGAN etc.) |
  227. #### Audio
  228. | Template | File | Description |
  229. |----------|------|-------------|
  230. | Stable Audio | `templates/stable-audio.json` | Stable Audio generation (47s audio) |
  231. #### 3D Generation
  232. | Template | File | Description |
  233. |----------|------|-------------|
  234. | Hunyuan3D v2 | `templates/hunyuan3d-v2.json` | Image to 3D mesh with Hunyuan3D v2 |
  235. #### Special Architectures
  236. | Template | File | Description |
  237. |----------|------|-------------|
  238. | Stable Cascade | `templates/stable-cascade.json` | Two-stage (Stage C + Stage B) generation |
  239. #### LLM Integration (requires comfyui_LLM_party)
  240. | Template | File | Description |
  241. |----------|------|-------------|
  242. | LLM Chat (API) | `templates/comfyui_LLM_party/llm-chat-api.json` | API LLM chat (OpenAI/Gemini/DeepSeek) |
  243. | LLM Chat (Ollama) | `templates/comfyui_LLM_party/llm-chat-ollama.json` | Local Ollama LLM chat |
  244. | LLM Prompt Enhance | `templates/comfyui_LLM_party/llm-prompt-enhance.json` | LLM enhances prompt → FLUX generates image |
  245. | LLM Script to Video | `templates/comfyui_LLM_party/llm-script-to-video.json` | LLM script → characters → storyboard pipeline |
  246. **CRITICAL RULE: ComfyUI auto-adds a hidden `control_after_generate` widget after every seed INT that has `control_after_generate: True`. You MUST include `"randomize"` in widgets_values right after every seed value. This applies to KSampler, RandomNoise, and any node with a seed INT.**
  247. ### Quality Checklist
  248. Before delivering a workflow, verify:
  249. - [ ] Top-level has `id`, `revision`, `last_node_id`, `last_link_id`, `nodes`, `links`, `groups`, `config`, `extra`, `version`
  250. - [ ] Every node has `id`, `type`, `pos`, `size`, `flags`, `order`, `mode`, `inputs`, `outputs`, `properties`
  251. - [ ] Widget inputs are included in `inputs` array with `"widget": {"name": ...}, "link": null`
  252. - [ ] `widgets_values` order matches widget inputs order
  253. - [ ] All links are `[link_id, src_node_id, src_slot, tgt_node_id, tgt_slot, "TYPE"]`
  254. - [ ] At least one output node exists (SaveImage/PreviewImage/SaveVideo)
  255. - [ ] No circular dependencies
  256. - [ ] Parameter values are within valid ranges
  257. ### Step 4: Output Model Download Guide
  258. After generating the workflow JSON, ALWAYS output a **Model Download Guide** section listing every model file referenced in the workflow. For each model, provide:
  259. 1. **Model name** — the exact filename used in `widgets_values`
  260. 2. **What it is** — checkpoint / VAE / CLIP / LoRA / ControlNet / Upscale model
  261. 3. **Where to put it** — the ComfyUI subdirectory (`models/checkpoints/`, `models/vae/`, etc.)
  262. 4. **Download source** — HuggingFace or CivitAI URL
  263. Use this reference table for common models:
  264. #### SD 1.5
  265. | Model | Directory | Download |
  266. |-------|-----------|----------|
  267. | v1-5-pruned-emaonly.safetensors | models/checkpoints/ | https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5 |
  268. | sd-v1-5-inpainting.ckpt | models/checkpoints/ | https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-inpainting |
  269. #### SDXL
  270. | Model | Directory | Download |
  271. |-------|-----------|----------|
  272. | sd_xl_base_1.0.safetensors | models/checkpoints/ | https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0 |
  273. #### FLUX
  274. | Model | Directory | Download |
  275. |-------|-----------|----------|
  276. | flux1-dev.safetensors | models/diffusion_models/ | https://huggingface.co/black-forest-labs/FLUX.1-dev |
  277. | clip_l.safetensors | models/text_encoders/ | https://huggingface.co/comfyanonymous/flux_text_encoders |
  278. | t5xxl_fp16.safetensors | models/text_encoders/ | https://huggingface.co/comfyanonymous/flux_text_encoders |
  279. | ae.safetensors | models/vae/ | https://huggingface.co/black-forest-labs/FLUX.1-dev (in ae.safetensors) |
  280. #### Wan 2.2
  281. | Model | Directory | Download |
  282. |-------|-----------|----------|
  283. | wan2.2_t2v_14b.safetensors | models/diffusion_models/ | https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged |
  284. | wan2.2_i2v_480p_14b.safetensors | models/diffusion_models/ | https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged |
  285. | wan2.2_i2v_720p_14b.safetensors | models/diffusion_models/ | https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged |
  286. | umt5_xxl_fp16.safetensors | models/text_encoders/ | https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged |
  287. | open_clip_vit_h.safetensors | models/text_encoders/ | https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged |
  288. | wan_2.1_vae.safetensors | models/vae/ | https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged |
  289. | clip_vision_h.safetensors | models/clip_vision/ | https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged |
  290. #### HunyuanVideo
  291. | Model | Directory | Download |
  292. |-------|-----------|----------|
  293. | hunyuan_video_t2v_720p_bf16.safetensors | models/diffusion_models/ | https://huggingface.co/Comfy-Org/HunyuanVideo_repackaged |
  294. | hunyuan_video_vae_bf16.safetensors | models/vae/ | https://huggingface.co/Comfy-Org/HunyuanVideo_repackaged |
  295. | llava_llama3_fp16.safetensors | models/text_encoders/ | https://huggingface.co/Comfy-Org/HunyuanVideo_repackaged |
  296. | clip_l.safetensors | models/text_encoders/ | https://huggingface.co/Comfy-Org/HunyuanVideo_repackaged |
  297. #### ControlNet (SD 1.5)
  298. | Model | Directory | Download |
  299. |-------|-----------|----------|
  300. | control_v11p_sd15_canny.safetensors | models/controlnet/ | https://huggingface.co/lllyasviel/ControlNet-v1-1 |
  301. | control_v11p_sd15_openpose.safetensors | models/controlnet/ | https://huggingface.co/lllyasviel/ControlNet-v1-1 |
  302. | control_v11f1p_sd15_depth.safetensors | models/controlnet/ | https://huggingface.co/lllyasviel/ControlNet-v1-1 |
  303. #### Upscale Models
  304. | Model | Directory | Download |
  305. |-------|-----------|----------|
  306. | RealESRGAN_x4plus.pth | models/upscale_models/ | https://huggingface.co/ai-forever/Real-ESRGAN |
  307. | RealESRGAN_x4plus_anime_6B.pth | models/upscale_models/ | https://huggingface.co/ai-forever/Real-ESRGAN |
  308. | 4x-UltraSharp.pth | models/upscale_models/ | https://huggingface.co/Kim2091/UltraSharp |
  309. #### Output Format Example
  310. After the workflow JSON, output like this:
  311. ```
  312. ## 模型下载指南
  313. 本工作流需要以下模型文件:
  314. 1. **wan2.2_t2v_14b.safetensors** (扩散模型)
  315. - 放置目录: `ComfyUI/models/diffusion_models/`
  316. - 下载地址: https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged
  317. 2. **umt5_xxl_fp16.safetensors** (文本编码器)
  318. - 放置目录: `ComfyUI/models/text_encoders/`
  319. - 下载地址: https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged
  320. ...
  321. 💡 提示: 可使用 `huggingface-cli download` 命令批量下载
  322. ```
README.md · README · 262 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # ComfyUI Workflow Skill
  2. > 用自然语言生成可直接导入 ComfyUI 的工作流 JSON 文件。
  3. **无需 API 费用,无需后端。描述你想要的 → 生成有效的工作流 JSON → 导入 ComfyUI 运行。**
  4. [![Linux.do](https://img.shields.io/badge/Linux.do-Discussion-blue)](https://linux.do/t/topic/1896794)
  5. ## 效果展示
  6. ### 安装 Skill
  7. ![安装skills](images/安装skills.png)
  8. ### AI 生成工作流 → 导入 ComfyUI → 运行出图
  9. ![生图转视频workflow](images/生图转视频workflow.png)
  10. ![图生视频流程](images/图生视频流程.png)
  11. ### 生成的图片 & 视频
  12. ![生成的图片](images/生成的图片.jpg)
  13. ![运行结果](images/运行结果.png)
  14. https://github.com/user-attachments/assets/831e8453-d3fa-41ad-99f6-39b13ce498d0
  15. ### 多个 Workflow 合并更新
  16. ![多个workflow合并更新](images/多个workflow合并更新.png)
  17. ### 动作迁移
  18. 原视频:
  19. https://github.com/user-attachments/assets/8a0affa3-ff07-449e-9ec5-c6ca8c37ba0f
  20. 迁移后(显存限制,按低分辨率跑的):
  21. https://github.com/user-attachments/assets/5420d74e-18eb-4a72-8819-3138d7353edf
  22. ![动作迁移workflow](images/动作迁移workflow.png)
  23. ![动作迁移流程](images/动作迁移流程.png)
  24. ![动作迁移修复](images/动作迁移修复.png)
  25. ![动作迁移音频还原](images/动作迁移音频还原.png)
  26. ## 这是什么?
  27. 一个 Claude Code skill,通过对话生成 ComfyUI 工作流 JSON。不用在 ComfyUI 节点编辑器里手动连线,直接用自然语言描述需求即可。
  28. ## 功能特性
  29. - **34 个内置模板** — 覆盖所有主流模型和任务类型
  30. - **360+ 节点定义** — 从 ComfyUI 源码提取,确保字段类型和范围准确
  31. - **自动模型下载** — 工作流包含原生 `models` 字段,导入时 ComfyUI 自动检测缺失模型并弹窗下载
  32. - **LLM 集成** — 支持 comfyui_LLM_party 节点 (OpenAI / Claude / Gemini / Ollama / DeepSeek)
  33. - **按需加载节点参考** — 节点注册表拆分为 42 个分类文件,避免一次性加载 4000 行
  34. ## 安装
  35. ### 前置条件
  36. - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) 已安装
  37. - Git 已安装
  38. ### 方法一:Git Clone + 符号链接(推荐,自动同步更新)
  39. ```bash
  40. # 1. Clone 项目到本地
  41. git clone https://github.com/twwch/comfyui-workflow-skill.git ~/codes/comfyui-workflow-skill
  42. # 2. 创建符号链接到 Claude Code skills 目录
  43. ln -s ~/codes/comfyui-workflow-skill ~/.claude/skills/comfyui-workflow
  44. ```
  45. ### 方法二:直接 Clone 到 skills 目录
  46. ```bash
  47. git clone https://github.com/twwch/comfyui-workflow-skill.git ~/.claude/skills/comfyui-workflow
  48. ```
  49. ### 方法三:手动复制
  50. ```bash
  51. cp -r comfyui-workflow-skill/ ~/.claude/skills/comfyui-workflow
  52. ```
  53. ### 验证安装
  54. ```bash
  55. ls ~/.claude/skills/comfyui-workflow/SKILL.md
  56. # 应该输出文件路径,说明安装成功
  57. ```
  58. ### 卸载
  59. ```bash
  60. rm -rf ~/.claude/skills/comfyui-workflow
  61. ```
  62. ## 使用方法
  63. ### 基本用法
  64. 安装后,在 Claude Code 中直接用自然语言描述需求:
  65. ```
  66. "帮我生成一个 FLUX 文生图工作流"
  67. "创建一个 Wan 2.2 图生视频工作流,带相机控制"
  68. "生成一个 SDXL 重绘工作流"
  69. "用 LLM 生成剧本,然后生成角色图和视频"
  70. ```
  71. ### 使用 slash 命令
  72. ```
  73. /comfyui-workflow 生成一个 SD3 文生图工作流
  74. ```
  75. ### 生成的文件如何使用
  76. 1. 工作流 JSON 文件会保存到当前目录
  77. 2. 在 ComfyUI 中点击 **Load** 或直接将 JSON 文件拖入界面
  78. 3. 如果缺少模型,ComfyUI 会自动弹窗提示下载
  79. 4. 点击 **Queue** 运行
  80. ## 示例工作流
  81. - [`flux-txt2img-wan22-img2vid.json`](flux-txt2img-wan22-img2vid.json) — **FLUX 文生图 → Wan2.2 图生视频** 全流程工作流
  82. - [`wan22-motion-transfer.json`](wan22-motion-transfer.json) — **Wan2.2 动作迁移** 工作流(参考视频动作 → 生成新视频)
  83. ## 可选:安装 LLM 集成
  84. 如果需要在工作流中使用 LLM 节点(剧本生成、角色解析、提示词增强等),需要在 ComfyUI 中安装 [comfyui_LLM_party](https://github.com/heshengtao/comfyui_LLM_party):
  85. ```bash
  86. cd ComfyUI/custom_nodes
  87. git clone https://github.com/heshengtao/comfyui_LLM_party.git
  88. pip install -r comfyui_LLM_party/requirements.txt
  89. ```
  90. 支持的 LLM 提供商:OpenAI、Claude、Gemini、DeepSeek、Ollama 及任何 OpenAI 兼容 API。
  91. ## 支持的模板 (34)
  92. ### 文生图 / 图生图
  93. | 模板 | 文件 | 说明 |
  94. |------|------|------|
  95. | SD 1.5 文生图 | `sd15-txt2img.json` | 基础 SD 1.5 |
  96. | SD 1.5 图生图 | `sd15-img2img.json` | SD 1.5 img2img |
  97. | SD 1.5 + LoRA | `sd15-lora.json` | SD 1.5 加载 LoRA |
  98. | SD 1.5 + ControlNet | `sd15-controlnet.json` | SD 1.5 ControlNet |
  99. | SD 1.5 重绘 | `sd15-inpaint.json` | SD 1.5 Inpainting |
  100. | SDXL 文生图 | `sdxl-txt2img.json` | SDXL 基础 |
  101. | SDXL 图生图 | `sdxl-img2img.json` | SDXL img2img |
  102. | SDXL + LoRA | `sdxl-lora.json` | SDXL 加载 LoRA |
  103. | SDXL + ControlNet | `sdxl-controlnet.json` | SDXL ControlNet |
  104. | SDXL 重绘 | `sdxl-inpaint.json` | SDXL Inpainting |
  105. | SD3 文生图 | `sd3-txt2img.json` | SD3 + TripleCLIPLoader |
  106. | FLUX 文生图 | `flux-txt2img.json` | FLUX.1 高级采样 |
  107. | FLUX 图生图 | `flux-img2img.json` | FLUX.1 img2img |
  108. | FLUX + LoRA | `flux-lora.json` | FLUX.1 加载 LoRA |
  109. ### 视频生成
  110. | 模板 | 文件 | 说明 |
  111. |------|------|------|
  112. | Wan 2.2 文生视频 | `wan22-txt2vid.json` | 832x480, 81 帧 |
  113. | Wan 2.2 图生视频 | `wan22-img2vid.json` | CLIP Vision 编码 |
  114. | Wan 2.2 首尾帧插值 | `wan22-first-last.json` | 首帧+尾帧生成视频 |
  115. | Wan 2.2 控制视频 | `wan22-fun-control.json` | 控制视频 + 参考图 |
  116. | Wan 2.2 相机控制 | `wan22-camera.json` | 相机运动控制 |
  117. | HunyuanVideo 文生视频 | `hunyuan-video.json` | HunyuanVideo T2V |
  118. | HunyuanVideo 图生视频 | `hunyuan-video-i2v.json` | HunyuanVideo I2V |
  119. | LTXV 文生视频 | `ltxv-txt2vid.json` | 768x512, 97 帧 |
  120. | LTXV 图生视频 | `ltxv-img2vid.json` | LTXV img2vid |
  121. | Mochi 文生视频 | `mochi-txt2vid.json` | 848x480 |
  122. | Cosmos 文生视频 | `cosmos-txt2vid.json` | 1280x704 |
  123. | Cosmos 图生视频 | `cosmos-img2vid.json` | Cosmos img2vid |
  124. ### 音频 / 3D / 特殊
  125. | 模板 | 文件 | 说明 |
  126. |------|------|------|
  127. | 图片放大 | `upscale-model.json` | RealESRGAN 等 |
  128. | Stable Audio | `stable-audio.json` | 音频生成 (47s) |
  129. | Hunyuan3D v2 | `hunyuan3d-v2.json` | 图片转 3D 模型 |
  130. | Stable Cascade | `stable-cascade.json` | 两阶段生成 |
  131. ### LLM 集成
  132. | 模板 | 文件 | 说明 |
  133. |------|------|------|
  134. | LLM 对话 (API) | `comfyui_LLM_party/llm-chat-api.json` | API LLM 对话 |
  135. | LLM 对话 (Ollama) | `comfyui_LLM_party/llm-chat-ollama.json` | 本地 Ollama 对话 |
  136. | LLM 提示词增强 | `comfyui_LLM_party/llm-prompt-enhance.json` | LLM 增强 → FLUX 生图 |
  137. | LLM 剧本流水线 | `comfyui_LLM_party/llm-script-to-video.json` | 剧本 → 角色 → 分镜 |
  138. ## 自动模型下载
  139. 所有模板都包含 ComfyUI 原生 `models` 字段。导入工作流时,ComfyUI 自动检测缺失模型并弹窗提示下载:
  140. ```json
  141. {
  142. "models": [
  143. {
  144. "name": "flux1-dev.safetensors",
  145. "url": "https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/flux1-dev.safetensors",
  146. "directory": "diffusion_models"
  147. }
  148. ]
  149. }
  150. ```
  151. 支持 HuggingFace 和 CivitAI 下载源。
  152. ## 项目结构
  153. ```
  154. comfyui-workflow-skill/
  155. ├── SKILL.md # Skill 定义(入口文件)
  156. ├── README.md # 本文件
  157. ├── flux-txt2img-wan22-img2vid.json # AI 生成的示例:FLUX 生图 + Wan2.2 图生视频
  158. ├── images/ # 示例截图和演示视频
  159. ├── wechat-article.md # 微信推文
  160. ├── references/
  161. │ ├── nodes/ # 42 个节点分类文件 + 索引
  162. │ ├── node-registry-additions.md # 附加节点定义 (音频、3D 等)
  163. │ ├── workflow-format.md # JSON 格式规范
  164. │ └── common-workflows.md # 常见模式
  165. └── templates/ # 34 个工作流模板
  166. ├── sd15-txt2img.json
  167. ├── flux-txt2img.json
  168. ├── wan22-img2vid.json
  169. ├── ... (30 个核心模板)
  170. └── comfyui_LLM_party/ # 4 个 LLM 集成模板
  171. ```
  172. ## 常见问题
  173. ### 导入后提示缺失节点
  174. 工作流中使用了自定义节点(如 LLM Party),需要先在 ComfyUI 中安装对应的自定义节点包。
  175. ### 导入后模型缺失
  176. ComfyUI 会自动弹窗提示下载。如果没有弹窗,手动从 HuggingFace 下载对应模型文件到 `ComfyUI/models/` 对应子目录。
  177. ### widgets_values 报错
  178. 如果出现类似 `Value not in list` 的错误,通常是 widget 值类型或范围不对。检查:
  179. - COMBO 类型的值必须是允许列表中的字符串
  180. - seed 后面必须跟 `"randomize"`(ComfyUI 自动添加的 `control_after_generate` 字段)
  181. - FLOAT/INT 值必须在 min/max 范围内
  182. ## Contributing
  183. 欢迎 PR:
  184. - 新的工作流模板
  185. - 支持更多自定义节点
  186. - 修复生成的 JSON bug
  187. - 文档改进
  188. ## License
  189. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.