Stable diffusion helper

From jackspace/ClaudeSkillz · View interactive version

Stable diffusion helper is an AI agent skill from the GitHub repository jackspace/ClaudeSkillz. Generate and troubleshoot Stable Diffusion images: model installation and selection, prompt and negative-prompt engineering, CFG, sampler and step tuning, and VRAM optimization. Use when setting up SD models, improving photorealism, or diagnosing poor generation quality.

How to use this skill

Skill file

Stable Diffusion Helper Skill

Expert guidance for Stable Diffusion image generation, optimization, and troubleshooting.

Capabilities

This skill provides expert assistance with:

  1. Model Installation & Management
  1. Prompt Engineering
  1. Settings Optimization
  1. ADetailer Configuration
  1. Troubleshooting

Key Knowledge Base

Photorealism Breakthrough Configuration

Critical Settings:

Main Prompt Template:

RAW candid photograph, unfiltered reality, authentic skin texture with visible pores and fine lines, subsurface scattering, real human imperfections, natural uneven skin tone, professional photo shoot, [SUBJECT], documentary photography style, Leica M10, Summilux 50mm f/1.4, natural diffused lighting, overcast golden hour, real skin blemishes, subtle wrinkles, natural oiliness, lifelike, hyperrealistic not CGI, shot on Kodak Portra 400, muted colors, organic imperfections, tangible reality

Negative Prompt (Anti-Cartoon Shield):

cartoon, anime, 3D render, CGI, illustration, painting, drawing, airbrushed, smooth skin, plastic skin, doll-like, mannequin, wax figure, synthetic, artificial, digital art, cell shading, flat colors, oversaturated, oversharpened, unrealistic, fake, computer generated, video game, Unreal Engine, Unity, rendered, illustrated, drawn, painted, sketched, perfect skin, flawless skin, porcelain skin, baby smooth, blur tool, beauty filter, Facetune, Instagram filter, TikTok filter, makeup filter, ugly, distorted, deformed, bad anatomy, poorly drawn, extra limbs, disfigured, low quality, blurry

Model Comparison

SD 1.5 Base (v1-5-pruned-emaonly.safetensors):

Realistic Vision V5.1 (realisticVisionV51.safetensors):

VRAM Optimization Flags

For 2GB VRAM setups:

--lowvram --medvram --no-half-vae --enable-insecure-extension-access

Common Issues & Solutions

Problem: Glossy/Anime Eyes

Problem: Cartoonish Skin

Problem: OOM Errors

Problem: Poor Hand Generation

Usage Examples

Example 1: Portrait Setup

User: "Help me set up photorealistic portrait generation"

Assistant Response:

I'll help you configure photorealistic portrait generation. Here's the optimal setup:

1. Model Selection:

2. Settings:

CFG Scale: 4.5 (CRITICAL - this is the breakthrough setting)
Steps: 40
Sampler: DPM++ 2M Karras
Resolution: 512×512
Batch Size: 4

3. Prompt Formula:

RAW candid photograph, unfiltered reality, authentic skin texture with visible pores and fine lines, subsurface scattering, real human imperfections, natural uneven skin tone, professional photo shoot, [your subject here], documentary photography style, Leica M10, Summilux 50mm f/1.4, natural diffused lighting, overcast golden hour, real skin blemishes, subtle wrinkles, natural oiliness, lifelike, hyperrealistic not CGI, shot on Kodak Portra 400, muted colors, organic imperfections, tangible reality

4. Enable ADetailer:

This configuration achieves ~75% photorealistic success rate!

Example 2: Fixing Glossy Eyes

User: "My generated portraits have glossy, anime-like eyes. How do I fix this?"

Assistant Response:

Glossy eyes are a common issue. Here's the fix:

Critical Step: Lower CFG Scale to 4.5

This is THE most important change. CFG 7.0+ produces glossy eyes.

ADetailer Configuration:

  1. Enable ADetailer with face_yolov8n.pt
  2. Add to ADetailer positive prompt:

```

realistic eyes with matte finish, natural iris texture, subtle eye moisture, lifelike pupils, soft catchlight, natural eye appearance

```

  1. Add to ADetailer negative prompt:

```

glossy eyes, shiny eyes, glass eyes, reflective eyes, glowing eyes, anime eyes, oversaturated eyes, multiple catchlights

```

Additional Tips:

This combination eliminates the glossy eye problem in ~90% of generations.

Example 3: Full-Body Generation

User: "I want to generate full-body photorealistic images. What settings should I use?"

Assistant Response:

Full-body generation requires different settings than portraits:

1. Model: Use Realistic Vision V5.1 (REQUIRED)

SD 1.5 base struggles with full-body anatomy. RV5.1 is specifically trained for this.

2. Settings:

CFG Scale: 4.0 (lower than portrait's 4.5)
Steps: 30
Sampler: DPM++ SDE Karras
Resolution: 512×768 (vertical) or 768×512 (horizontal)
Batch Size: 2 (lower to avoid OOM)

3. Prompt Adjustments:

Add to your prompt:

full body shot, standing pose (or action pose), realistic hands and feet, natural body proportions

4. Multi-Pass ADetailer:

Tab 1 (Face):

Tab 2 (Hands):

Success Rate: ~60% (testing in progress)

Important: Test with single image first to verify no OOM errors before batch generation.

Best Practices

  1. Always start with CFG 4.5 - This is the photorealism breakthrough
  2. Use ADetailer - Essential for face quality
  3. Test resolution limits - Higher res may OOM on 2GB VRAM
  4. Generate batches - 4× gives better odds of great results
  5. Save successful seeds - Reuse for consistency
  6. Lower CFG for higher res - 768× images need CFG 4.0

Quick Reference

| Use Case | Model | CFG | Steps | Resolution | Batch |

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

| Portrait | SD 1.5 / RV5.1 | 4.5 | 40 | 512×512 | 4 |

| Full-Body Vertical | RV5.1 | 4.0 | 30 | 512×768 | 2 |

| Full-Body Horizontal | RV5.1 | 4.0 | 30 | 768×512 | 2 |

| Documentary | SD 1.5 / RV5.1 | 4.5 | 35 | 512×512 | 4 |

| Film Photography | SD 1.5 / RV5.1 | 4.5 | 40 | 512×512 | 4 |

Additional Resources

For complete documentation, see:

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.