Claude Code Plugins

Community-maintained marketplace

Feedback

Generates images and videos using ComfyUI node-based workflows. Use when creating AI-generated assets, text-to-image, text-to-video, image-to-video, running Stable Diffusion, Flux, HunyuanVideo, or when user mentions "comfy," "ComfyUI," "generate image," "generate video," "AI art," "diffusion model," or needs visual content for courses/projects.

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name comfyui
description Generates images and videos using ComfyUI node-based workflows. Use when creating AI-generated assets, text-to-image, text-to-video, image-to-video, running Stable Diffusion, Flux, HunyuanVideo, or when user mentions "comfy," "ComfyUI," "generate image," "generate video," "AI art," "diffusion model," or needs visual content for courses/projects.

Generating Assets with ComfyUI

This skill helps you generate images and videos using ComfyUI, the powerful node-based generative AI platform.

Prerequisites

ComfyUI must be running locally or accessible via network. Default: http://127.0.0.1:8188

Quick Setup:

# Install comfy-cli
pip install comfy-cli

# Install ComfyUI
comfy install

# Launch ComfyUI server
comfy launch

Core Capabilities

  1. Text-to-Image: Generate images from text prompts (Flux, SDXL, SD1.5)
  2. Text-to-Video: Generate videos from text (HunyuanVideo, Wan, LTX-Video)
  3. Image-to-Video: Animate images into video sequences
  4. Image-to-Image: Transform/enhance existing images
  5. Upscaling: Enhance resolution with ESRGAN/SwinIR
  6. LoRA Integration: Apply style/concept fine-tunes

Workflow Execution Process

Step 1: Check ComfyUI Status

curl -s http://127.0.0.1:8188/system_stats | jq .

Step 2: Choose Workflow Template

Select based on the user's needs:

  • Image Generation: See ./workflow-templates.md#text-to-image
  • Video Generation: See ./workflow-templates.md#text-to-video
  • Image Enhancement: See ./workflow-templates.md#upscaling

Step 3: Submit Workflow via API

Use the provided Node.js scripts in ./scripts/ or submit directly:

// See ./scripts/comfy-api.mjs for full implementation
const response = await fetch('http://127.0.0.1:8188/prompt', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ prompt: workflowJson, client_id: clientId })
});

Step 4: Monitor Progress

Connect to WebSocket for real-time updates:

ws://127.0.0.1:8188/ws?clientId={client_id}

Step 5: Retrieve Results

# Get execution history
curl http://127.0.0.1:8188/history/{prompt_id}

# Download generated image
curl "http://127.0.0.1:8188/view?filename={filename}&subfolder={subfolder}&type=output" -o output.png

Quick Commands

Task Script
Generate Image node ~/.claude/skills/generating-with-comfyui/scripts/comfy-api.mjs generate-image "prompt"
Generate Video node ~/.claude/skills/generating-with-comfyui/scripts/comfy-api.mjs generate-video "prompt"
Check Status node ~/.claude/skills/generating-with-comfyui/scripts/comfy-api.mjs status
List Models node ~/.claude/skills/generating-with-comfyui/scripts/comfy-api.mjs list-models

API Endpoints Reference

Endpoint Method Purpose
/prompt POST Submit workflow to queue
/prompt GET Get current queue status
/queue GET View execution queue
/queue POST Clear/manage queue
/history GET Get execution history
/history/{id} GET Get specific prompt history
/interrupt POST Stop current execution
/object_info GET List all available nodes
/models GET List available models
/view GET Retrieve generated outputs
/upload/image POST Upload input images

Model Recommendations

For Images

  • Flux.1 Dev/Schnell: Latest high-quality, fast generation
  • SDXL 1.0: Excellent quality, wide compatibility
  • SD 1.5: Fast, vast LoRA ecosystem

For Videos

  • HunyuanVideo 1.5: 8.3B params, consumer GPU friendly, 480p-1080p
  • Wan 2.1: High quality text-to-video
  • LTX-Video: Fast video generation

For Enhancement

  • 4x-UltraSharp: Best general upscaler
  • RealESRGAN x4: Realistic photo enhancement
  • SwinIR: High-quality restoration

Directory Structure

ComfyUI expects models in specific locations:

ComfyUI/
├── models/
│   ├── checkpoints/     # Main model files (.safetensors)
│   ├── vae/             # VAE models
│   ├── loras/           # LoRA fine-tunes
│   ├── controlnet/      # ControlNet models
│   ├── clip/            # CLIP text encoders
│   ├── upscale_models/  # Upscaler models
│   └── diffusion_models/ # Flux/video models
├── input/               # Input images
├── output/              # Generated outputs
└── custom_nodes/        # Extensions

Installing Models

# Download checkpoint
comfy model download <url> models/checkpoints

# Or manually with curl/wget
curl -L "https://huggingface.co/model/file.safetensors" -o models/checkpoints/model.safetensors

Custom Nodes Installation

# Install via comfy-cli
comfy node install ComfyUI-VideoHelperSuite
comfy node install ComfyUI-Manager

# Or git clone to custom_nodes/
cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-HunyuanVideoWrapper

Troubleshooting

Server Not Running

# Check if ComfyUI is running
curl -s http://127.0.0.1:8188/ > /dev/null && echo "Running" || echo "Not running"

# Start it
comfy launch

Out of Memory

  • Reduce resolution (512x512 for SD, 1024x1024 for SDXL)
  • Enable --lowvram or --cpu flags
  • Use FP8 quantized models

Missing Model

# List available models
curl http://127.0.0.1:8188/models | jq .

Best Practices

  1. Always check server status before submitting workflows
  2. Use unique client_id for WebSocket connections
  3. Monitor queue to avoid duplicate submissions
  4. Save successful workflows as JSON templates
  5. Use seed values for reproducible results

Reference Documentation

  • Workflow templates: ./workflow-templates.md
  • Video generation specifics: ./video-generation-guide.md
  • Full API script: ./scripts/comfy-api.mjs