Use for twwch__comfyui-workflow-skill workflows. Source sections include ComfyUI Workflow Generator, Description, Activation.
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Use for twwch__comfyui-workflow-skill workflows. Source sections include ComfyUI Workflow Generator, Description, Activation.
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
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 it to a .json file if the user requests
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 nodes array, links array, 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 label and localized_name fields matching name
widgets_values array order must match the widget inputs order
Every workflow MUST have at least one output node (SaveImage, PreviewImage, SaveVideo, etc.)
All required inputs must be provided (check references/nodes/index.md and the category files under references/nodes/, plus references/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 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:
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.
Quality Checklist
Before delivering a workflow, verify:
Top-level has id, revision, last_node_id, last_link_id, nodes, links, groups, config, extra, version
Every node has id, type, pos, size, flags, order, mode, inputs, outputs, properties
Widget inputs are included in inputs array with "widget": {"name": ...}, "link": null
widgets_values order matches widget inputs order
All links are [link_id, src_node_id, src_slot, tgt_node_id, tgt_slot, "TYPE"]
At least one output node exists (SaveImage/PreviewImage/SaveVideo)
No circular dependencies
Parameter values are within valid ranges
Step 4: Output Model Download Guide
After generating the workflow JSON, ALWAYS output a Model Download Guide section listing every model file referenced in the workflow. For each model, provide:
Model name — the exact filename used in widgets_values
What it is — checkpoint / VAE / CLIP / LoRA / ControlNet / Upscale model
Where to put it — the ComfyUI subdirectory (models/checkpoints/, models/vae/, etc.)