Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
mckruz avatar

Comfyui Workflow Builder

  • 1.5k installs
  • 85 repo stars
  • Updated March 18, 2026
  • mckruz/comfyui-expert

comfyui-workflow-builder is an agent skill that generates valid ComfyUI workflow JSON from natural language with inventory validation.

About

The comfyui-workflow- skill translates natural language requests into executable ComfyUI workflow JSON with correct class_types, connections, and output indices. It reads state/inventory.json for available checkpoints, LoRAs, ControlNet models, and custom nodes before selecting pipeline patterns for txt2img, img2img, inpainting, identity preservation, video, upscale, and FaceDetailer flows. Workflow JSON uses string node IDs with array connection format source_id and output_index. Validation checks class_type existence, model filenames, required connections, VRAM estimates, and resolution compatibility such as 1024 for FLUX and SDXL. Use when developers need ComfyUI node graphs from prompts without installation or custom node development guidance.

  • Inventory-first: read state/inventory.json before generating workflows.
  • Pipeline patterns: txt2img, InstantID, LoRA, Wan I2V, inpaint, upscale.
  • JSON format: string node IDs with class_type and array connections.
  • VRAM estimation table for FLUX, SDXL, InstantID, ControlNet, Wan.
  • Validation: class_types, model files, connections, VRAM, resolution.

Comfyui Workflow Builder by the numbers

  • 1,492 all-time installs (skills.sh)
  • +56 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #798 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
At a glance

comfyui-workflow-builder capabilities & compatibility

Capabilities
natural language to workflow json · inventory aware model selection · pipeline pattern selection · node graph validation
Use cases
orchestration · research
From the docs

What comfyui-workflow-builder says it does

Translates natural language requests into executable ComfyUI workflow JSON.
SKILL.md
Always validates against inventory before generating.
SKILL.md
npx skills add https://github.com/mckruz/comfyui-expert --skill comfyui-workflow-builder

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.5k
repo stars85
Security audit2 / 3 scanners passed
Last updatedMarch 18, 2026
Repositorymckruz/comfyui-expert

How do I build a ComfyUI workflow JSON for txt2img, img2img, or video from a prompt?

Generate valid ComfyUI workflow JSON from natural language with inventory-aware node graphs.

Who is it for?

Developers and agents generating ComfyUI pipelines for image or video generation.

Skip if: Skip for ComfyUI installation, custom node development, or model training without workflow JSON needs.

When should I use this skill?

User asks to generate ComfyUI workflow, build node graph, or create txt2img img2img pipeline.

What you get

Validated ComfyUI workflow JSON with correct nodes, connections, and model filenames from inventory.

  • ComfyUI workflow JSON file
  • Validated node graph with correct output indices

By the numbers

  • Includes 7 evaluation test cases with 5 happy-path and 1 failure-mode case
  • Targets 85% workflow correctness versus a 30% baseline without the skill
  • Documents roughly 70% reduction in manual JSON correction

Files

SKILL.mdMarkdownGitHub ↗

ComfyUI Workflow Builder

Translates natural language requests into executable ComfyUI workflow JSON. Always validates against inventory before generating.

Workflow Generation Process

Step 1: Understand the Request

Parse the user's intent into:

  • Output type: Image, video, or audio
  • Source material: Text-only, reference image(s), existing video
  • Identity method: None, zero-shot (InstantID/PuLID), LoRA, Kontext
  • Quality level: Draft (fast iteration) vs production (maximum quality)
  • Special requirements: ControlNet, inpainting, upscaling, lip-sync

Step 2: Check Inventory

Read state/inventory.json to determine:

  • Available checkpoints → select best match for task
  • Available identity models → determine which methods are possible
  • Available ControlNet models → enable pose/depth control if available
  • Custom nodes installed → verify all required nodes exist
  • VRAM available → optimize settings accordingly

Step 3: Select Pipeline Pattern

Based on request + inventory, choose from:

PatternWhenKey Nodes
Text-to-ImageSimple generationCheckpoint → CLIP → KSampler → VAE
Identity-Preserved ImageCharacter consistency+ InstantID/PuLID/IP-Adapter
LoRA CharacterTrained character+ LoRA Loader
Image-to-Video (Wan)High-quality videoDiffusion Model → Wan I2V → Video Combine
Image-to-Video (AnimateDiff)Fast video, motion control+ AnimateDiff Loader + Motion LoRAs
Talking HeadCharacter speaksImage → Video → Voice → Lip-Sync
UpscaleEnhance resolutionImage → UltimateSDUpscale → Save
InpaintingEdit regionsImage + Mask → Inpaint Model → KSampler

Step 4: Generate Workflow JSON

ComfyUI workflow format:

{
  "{node_id}": {
    "class_type": "{NodeClassName}",
    "inputs": {
      "{param_name}": "{value}",
      "{connected_param}": ["{source_node_id}", {output_index}]
    }
  }
}

Rules:

  • Node IDs are strings (typically "1", "2", "3"...)
  • Connected inputs use array format: ["source_node_id", output_index]
  • Output index is 0-based integer
  • Filenames must match exactly what's in inventory
  • Seed values: use random large integer or fixed for reproducibility

Step 5: Validate

Before presenting to user:

1. Every class_type exists in inventory's node list 2. Every model filename exists in inventory's model list 3. All required connections are present (no dangling inputs) 4. VRAM estimate doesn't exceed available VRAM 5. Resolution is compatible with chosen model (512 for SD1.5, 1024 for SDXL/FLUX)

Step 6: Output

If online mode: Queue via comfyui-api skill If offline mode: Save JSON to projects/{project}/workflows/ with descriptive name

Workflow Templates

Basic Text-to-Image (FLUX)

{
  "1": {
    "class_type": "LoadCheckpoint",
    "inputs": {"ckpt_name": "flux1-dev.safetensors"}
  },
  "2": {
    "class_type": "CLIPTextEncode",
    "inputs": {"text": "{positive_prompt}", "clip": ["1", 1]}
  },
  "3": {
    "class_type": "CLIPTextEncode",
    "inputs": {"text": "{negative_prompt}", "clip": ["1", 1]}
  },
  "4": {
    "class_type": "EmptyLatentImage",
    "inputs": {"width": 1024, "height": 1024, "batch_size": 1}
  },
  "5": {
    "class_type": "KSampler",
    "inputs": {
      "seed": 42,
      "steps": 25,
      "cfg": 3.5,
      "sampler_name": "euler",
      "scheduler": "normal",
      "denoise": 1.0,
      "model": ["1", 0],
      "positive": ["2", 0],
      "negative": ["3", 0],
      "latent_image": ["4", 0]
    }
  },
  "6": {
    "class_type": "VAEDecode",
    "inputs": {"samples": ["5", 0], "vae": ["1", 2]}
  },
  "7": {
    "class_type": "SaveImage",
    "inputs": {"filename_prefix": "output", "images": ["6", 0]}
  }
}

With Identity Preservation (InstantID + IP-Adapter)

Extends basic template by adding:

  • Load reference image node
  • InstantID Model Loader + Apply InstantID
  • IPAdapter Unified Loader + Apply IPAdapter
  • FaceDetailer post-processing

See references/workflows.md for complete node settings.

Video Generation (Wan I2V)

Uses different loader chain:

  • Load Diffusion Model (not LoadCheckpoint)
  • Wan I2V Conditioning
  • EmptySD3LatentImage (with frame count)
  • Video Combine (VHS)

See references/workflows.md Workflow 4 for complete settings.

VRAM Estimation

ComponentApproximate VRAM
FLUX FP1616GB
FLUX FP88GB
SDXL6GB
SD1.54GB
InstantID+4GB
IP-Adapter+2GB
ControlNet (each)+1.5GB
Wan 14B20GB
Wan 1.3B5GB
AnimateDiff+3GB
FaceDetailer+2GB

Common Mistakes to Avoid

1. Wrong output index: CheckpointLoader outputs [model, clip, vae] at indices [0, 1, 2] 2. CFG too high for InstantID: Use 4-5, not default 7-8 3. Wrong resolution for model: FLUX/SDXL=1024, SD1.5=512 4. Missing VAE: FLUX needs explicit VAE (ae.safetensors) 5. Wrong model in wrong loader: Diffusion models need LoadDiffusionModel, not LoadCheckpoint

Reference Files

  • references/workflows.md - Detailed node-by-node templates
  • references/models.md - Model files and paths
  • references/prompt-templates.md - Model-specific prompts
  • state/inventory.json - Current inventory cache

Related skills

How it compares

Pick comfyui-workflow-builder when you need agent-generated ComfyUI JSON graphs validated for node names and output slots, not generic image prompts or UI-only tutorials.

FAQ

Does it check available models?

Yes — it reads state/inventory.json for checkpoints, LoRAs, ControlNet, custom nodes, and VRAM before generating.

What workflow format is used?

JSON with string node IDs, class_type, inputs with values or [source_id, output_index] connections.

Is comfyui-workflow-builder safe to install?

Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.