Comfyui workflow helper

From jackspace/ClaudeSkillz · View interactive version

Comfyui workflow helper is an AI agent skill from the GitHub repository jackspace/ClaudeSkillz. Build and tune ComfyUI workflows: node graphs, model loaders, samplers and schedulers, conditioning, and ControlNet. Use when creating or debugging a ComfyUI workflow, configuring nodes, installing checkpoints or LoRAs, or optimizing VRAM and generation speed.

How to use this skill

Skill file

ComfyUI Workflow Helper Skill

Expert guidance for ComfyUI workflow creation, node configuration, and optimization.

Capabilities

This skill provides expert assistance with:

  1. Workflow Setup & Management
  1. Node Configuration
  1. Model Management
  1. Performance Optimization
  1. Troubleshooting

Key Knowledge Base

ComfyUI Directory Structure

/srv/comfyui/
├── models/
│   ├── checkpoints/          # SD models (.safetensors, .ckpt)
│   ├── vae/                  # VAE models
│   ├── loras/                # LoRA models
│   ├── text_encoders/        # Text encoder models
│   ├── diffusion_models/     # Diffusion models
│   ├── controlnet/           # ControlNet models
│   ├── upscale_models/       # Upscaler models
│   └── embeddings/           # Textual inversion embeddings
├── input/                    # Input images
├── output/                   # Generated images
└── custom_nodes/             # Custom node extensions

Essential Nodes

Loading Nodes:

Conditioning Nodes:

Sampling Nodes:

Image Nodes:

Model Nodes:

OmniGen2 Setup

Required Models:

  1. VAE: ae.safetensors → /srv/comfyui/models/vae/
  2. Text Encoder: qwen_2.5_vl_fp16.safetensors → /srv/comfyui/models/text_encoders/
  3. Diffusion Model: omnigen2_fp16.safetensors → /srv/comfyui/models/diffusion_models/

Download Script:

# Use the provided download script
/root/homelab/scripts/download-comfyui-omnigen2-models.sh

# Or manual download:
mkdir -p /srv/comfyui/models/{vae,text_encoders,diffusion_models}
wget -O /srv/comfyui/models/vae/ae.safetensors \
  "https://huggingface.co/Comfy-Org/Lumina_Image_2.0_Repackaged/resolve/main/split_files/vae/ae.safetensors"
# ... (similar for other models)

Common Workflows

Basic txt2img Workflow

Nodes Required:

  1. Load Checkpoint
  2. CLIP Text Encode (Prompt) x2 (positive & negative)
  3. Empty Latent Image
  4. KSampler
  5. VAE Decode
  6. Save Image

Connection Flow:

Load Checkpoint → CLIP (positive/negative) → KSampler
Empty Latent → KSampler → VAE Decode → Save Image
Load Checkpoint → VAE Decode

img2img Workflow

Additional Nodes:

  1. Load Image
  2. VAE Encode

Connection Flow:

Load Image → VAE Encode → KSampler
(Rest similar to txt2img)

ControlNet Workflow

Additional Nodes:

  1. Load ControlNet Model
  2. Apply ControlNet
  3. Preprocessor nodes (depends on ControlNet type)

Usage Examples

Example 1: Setting Up OmniGen2

User: "Help me set up OmniGen2 in ComfyUI"

Assistant Response:

I'll guide you through setting up OmniGen2 in ComfyUI.

Step 1: Download Models

Run the download script:

bash /root/homelab/scripts/download-comfyui-omnigen2-models.sh

Or download manually:

Step 2: Restart ComfyUI

# If using Docker:
docker restart comfyui-container

# If using systemd:
sudo systemctl restart comfyui

# If running manually:
# Stop and restart the ComfyUI process

Step 3: Verify in WebUI

  1. Open ComfyUI web interface
  2. Check that models appear in dropdowns:

Step 4: Create Workflow

Use OmniGen2-specific nodes:

Example 2: Creating a Basic Workflow

User: "How do I create a simple txt2img workflow in ComfyUI?"

Assistant Response:

I'll help you create a basic txt2img workflow.

Nodes to Add:

  1. Right-click → Add Node → loaders → Load Checkpoint
  1. Right-click → Add Node → conditioning → CLIP Text Encode (Prompt) × 2
  1. Right-click → Add Node → latent → Empty Latent Image
  1. Right-click → Add Node → sampling → KSampler
  1. Right-click → Add Node → latent → VAE Decode
  1. Right-click → Add Node → image → Save Image

Connections:

Load Checkpoint [MODEL] → KSampler [model]
Load Checkpoint [CLIP] → CLIP Text Encode (pos) [clip]
Load Checkpoint [CLIP] → CLIP Text Encode (neg) [clip]
Load Checkpoint [VAE] → VAE Decode [vae]

CLIP Text Encode (pos) [CONDITIONING] → KSampler [positive]
CLIP Text Encode (neg) [CONDITIONING] → KSampler [negative]

Empty Latent Image [LATENT] → KSampler [latent_image]

KSampler [LATENT] → VAE Decode [samples]
VAE Decode [IMAGE] → Save Image [images]

Usage:

  1. Enter your prompt in positive CLIP Text Encode
  2. Enter negative prompt in negative CLIP Text Encode
  3. Click "Queue Prompt" to generate

Example 3: Troubleshooting OOM Errors

User: "ComfyUI keeps crashing with out of memory errors. How do I fix this?"

Assistant Response:

OOM errors in ComfyUI can be resolved with these strategies:

1. Reduce Resolution

2. Reduce Batch Size

3. Use VRAM-Efficient Models

4. ComfyUI Launch Args

Add these flags when starting ComfyUI:

--lowvram          # Aggressive VRAM optimization
--medvram          # Moderate VRAM optimization
--normalvram       # Normal VRAM usage
--cpu              # Use CPU instead of GPU (slow but no VRAM)

5. Clear Cache

6. Check Node Efficiency

For 2GB VRAM:

Best Practices

  1. Workflow Organization
  1. Node Connections
  1. Model Management
  1. Performance
  1. Troubleshooting

Quick Reference

KSampler Settings for Photorealism

seed: -1 (random)
steps: 20-40
cfg: 4.5 (photorealism breakthrough)
sampler_name: dpmpp_2m_karras
scheduler: karras
denoise: 1.0

Resolution Limits by VRAM

| VRAM | Max Resolution | Batch Size |

|------|---------------|------------|

| 2GB | 512×512 | 1 |

| 4GB | 768×768 | 1-2 |

| 6GB | 1024×1024 | 1-2 |

| 8GB+ | 1024×1024+ | 2-4 |

Common Node Shortcuts

Advanced Techniques

Batch Processing

Use batch nodes to generate multiple variations:

Batch Size: 4 in Empty Latent Image
→ Generates 4 images per queue

Seed Control

For consistent results:

Fixed Seed: Use specific number (e.g., 12345)
Random Seed: Use -1
Seed Increment: Batch Size controls seed increment

LoRA Stacking

Apply multiple LoRAs:

Load Checkpoint → Load LoRA (1) → Load LoRA (2) → KSampler
Set strength: 0.5-1.0 per LoRA

Additional Resources

When to Invoke This Skill

Invoke this skill when users ask about:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.