Stable Diffusion Cheat Sheet
title: Stable Diffusion date: 2024-12-01 10:00:00 background: bg-[#A855F7] tags: - AI - Image - Open Source - Generation categories: - AI intro: Stable Diffusion cheat sheet with WebUI usage, prompt techniques, samplers and model configuration plugins: - copyCode
Overview
What is Stable Diffusion
- Open source AI image generation model
- Can run locally
- Supports multiple models and extensions
- Highly customizable
Main UI Tools
| Tool | Features |
|---|---|
| AUTOMATIC1111 | Most comprehensive |
| ComfyUI | Node-based workflow |
| Fooocus | Simple and easy |
| SD.Next | Modern interface |
Main Models
| Model | Features |
|---|---|
| SD 1.5 | Classic, most resources |
| SDXL | High quality, 1024x1024 |
| SD 3 | Latest, improved text |
| Flux | High quality new model |
Prompt Basics
Basic Format
[subject], [description], [environment], [style], [quality]
Positive Prompt Example
1girl, long hair, blue eyes,
white dress, standing in garden,
detailed background, soft lighting,
masterpiece, best quality, 8k
Negative Prompt Example
lowres, bad anatomy, bad hands,
text, error, missing fingers,
extra digit, fewer digits, cropped,
worst quality, low quality,
normal quality, jpeg artifacts,
signature, watermark, username, blurry
Weight Syntax
Increase weight
(beautiful:1.3)
((important)) # ~1.21x
(((very important))) # ~1.33x
Decrease weight
(unwanted:0.7)
[less important] # ~0.9x
Prompt Blending
AND association
cat AND dog # Generate both cat and dog
BREAK separation
portrait BREAK landscape
Generation Parameters
Samplers {.row-span-2}
| Sampler | Features | Recommended Steps |
|---|---|---|
| Euler | Fast, good results | 20-30 |
| Euler a | Creative variation | 20-40 |
| DPM++ 2M | Balanced | 20-30 |
| DPM++ 2M Karras | Better details | 20-30 |
| DPM++ SDE | High quality | 25-40 |
| DPM++ 2M SDE Karras | Recommended | 20-35 |
| UniPC | Fast, high quality | 15-25 |
| DDIM | Stable, consistent | 50+ |
Sampling Steps
| Steps | Effect |
|---|---|
| 15-20 | Quick preview |
| 20-30 | Normal use |
| 30-50 | High quality |
| 50+ | Fine details |
CFG Scale
| Value | Effect |
|---|---|
| 1-5 | More creative, may deviate |
| 7-8 | Balanced (recommended) |
| 9-12 | Strict prompt following |
| 15+ | Oversaturated, artifacts |
Resolution
SD 1.5
512x512 # Default
512x768 # Portrait
768x512 # Landscape
SDXL
1024x1024 # Default
1024x1536 # Portrait
1536x1024 # Landscape
Seed
-1 # Random seed
Fixed # Reproducible results
Models & LoRA
Checkpoint Models
Realistic
Realistic Vision
SDXL Realistic
Juggernaut XL
Anime
Anything V5
Counterfeit
Animagine XL
LoRA Usage
Basic format
<lora:lora_name:weight>
Example
1girl, <lora:koreanDollLikeness:0.7>,
detailed face, masterpiece
Multiple LoRAs
portrait, <lora:styleA:0.6>,
<lora:styleB:0.4>, best quality
Embeddings (Textual Inversion)
Negative embeddings
(in negative prompt)
EasyNegative, badhandv4, ng_deepnegative
VAE
Recommended
vae-ft-mse-840000
sdxl_vae
Purpose
Improve colors and details
Reduce grayish appearance
Common Features
Hires. Fix
Settings
Upscaler: R-ESRGAN 4x+
Hires steps: 10-20
Denoising strength: 0.3-0.5
Upscale by: 1.5-2
Inpainting
Steps
- Upload image to img2img
- Select Inpaint
- Draw mask area
- Set Denoising 0.4-0.7
- Generate
ControlNet
Common Preprocessors
Canny # Edge detection
OpenPose # Pose control
Depth # Depth map
Lineart # Line art
Tile # Detail enhancement
IP-Adapter # Image reference
img2img
Parameters
Denoising strength:
0.1-0.3 # Minor changes
0.4-0.6 # Medium changes
0.7-0.9 # Major changes
Quality Prompts
Quality Positive
masterpiece, best quality,
ultra detailed, 8k uhd,
high resolution, intricate details,
sharp focus, photorealistic
Quality Negative
worst quality, low quality,
normal quality, lowres,
bad anatomy, bad hands,
text, error, cropped,
jpeg artifacts, signature,
watermark, username
SDXL Recommended
Positive
score_9, score_8_up, score_7_up
detailed, masterpiece
Negative
score_6, score_5, score_4,
low quality, blurry
Prompt Templates {.cols-2}
Portrait
Template
Positive:
1girl, solo, portrait, looking at viewer,
[hair color] hair, [hairstyle], [eye color] eyes,
[clothing], detailed face, beautiful eyes,
natural lighting, soft shadows,
masterpiece, best quality, 8k
Negative:
lowres, bad anatomy, bad hands, text,
error, missing fingers, extra digit,
fewer digits, cropped, worst quality,
low quality, normal quality
Example
1girl, solo, portrait, looking at viewer,
blonde hair, long wavy hair, green eyes,
white blouse, detailed face, beautiful eyes,
natural lighting, soft shadows,
masterpiece, best quality, 8k
Landscape
Template
Positive:
landscape, [scene type],
[time] sky, [weather],
volumetric lighting, atmospheric,
detailed environment, high detail,
masterpiece, best quality, 8k
Negative:
blurry, low quality, text, watermark,
ugly, deformed, oversaturated
Example
landscape, mountain lake at sunset,
orange sky, scattered clouds,
volumetric lighting, atmospheric,
detailed environment, high detail,
masterpiece, best quality, 8k
Anime Character
Template
Positive:
1girl, anime style, [character description],
[clothing], [pose/action],
detailed, vibrant colors,
masterpiece, best quality
Negative:
lowres, bad anatomy, bad hands,
worst quality, low quality,
extra limbs, missing limbs
Example
1girl, anime style, silver hair, red eyes,
black gothic dress, holding umbrella,
standing in rain, detailed, vibrant colors,
masterpiece, best quality
Product Photo
Template
Positive:
product photography, [product],
studio lighting, white background,
professional, commercial,
high detail, 8k uhd
Negative:
blurry, low quality, shadows,
text, watermark, cluttered
More Prompt Examples
Fantasy Characters
Wizard
old wizard with long white beard,
wearing purple robes with golden stars,
holding glowing staff, magical aura,
fantasy art style, detailed,
dramatic lighting, masterpiece
Warrior
female warrior in ornate armor,
battle stance, sword drawn,
wind blowing through hair,
epic fantasy, cinematic lighting,
detailed armor, masterpiece, 8k
Sci-Fi Scenes
Space Station
interior of futuristic space station,
large observation window showing Earth,
clean white surfaces, holographic displays,
sci-fi movie style, cinematic,
volumetric lighting, 8k
Robot
advanced humanoid robot,
sleek chrome design, glowing blue eyes,
standing in laboratory,
sci-fi concept art, highly detailed,
studio lighting, 8k
Nature & Animals
Wildlife
majestic lion in savanna,
golden hour lighting, dramatic sky,
wildlife photography style,
sharp focus, detailed fur,
National Geographic quality
Underwater
coral reef teeming with tropical fish,
sunlight rays through water,
underwater photography, vivid colors,
sharp focus, detailed, 8k
Food Photography
Dessert
chocolate lava cake with molten center,
fresh raspberries, mint leaf garnish,
dark slate plate, food photography,
shallow depth of field, studio lighting,
professional, appetizing
Asian Cuisine
bowl of ramen with soft-boiled egg,
steam rising, chopsticks, detailed noodles,
overhead shot, food photography style,
warm lighting, professional, 8k
Architecture
Modern Interior
minimalist living room interior,
floor to ceiling windows, city view,
neutral colors, designer furniture,
architectural photography, natural light,
clean lines, interior design magazine
Historical
gothic cathedral interior,
sunlight streaming through stained glass,
stone pillars, vaulted ceiling,
architectural photography, dramatic lighting,
detailed stonework, 8k
WebUI Extensions
Recommended Extensions
Image Enhancement
Ultimate SD Upscale
Tiled Diffusion
ADetailer (face fix)
Prompt Tools
Dynamic Prompts
Prompt All-in-one
ControlNet
sd-webui-controlnet
ADetailer Settings
Model: face_yolov8n.pt
Confidence: 0.3
Denoising: 0.4
Performance Optimization
VRAM Optimization
Command line args
--medvram # Medium VRAM
--lowvram # Low VRAM
--xformers # VRAM optimization
--opt-sdp-attention # PyTorch 2.0
Speed Settings
--api # Enable API
--no-half-vae # Avoid black images
--precision full # Precision issues
Recommended Config
| VRAM | Suggested Settings |
|---|---|
| 4GB | --lowvram |
| 6GB | --medvram |
| 8GB | Default |
| 12GB+ | SDXL capable |
Troubleshooting
Gray/Dark Images
Solutions
1. Change VAE
2. Use --no-half-vae
3. Adjust CFG to 7-8
Hand Issues
Solutions
Negative: bad hands, extra fingers
Use ADetailer
Use ControlNet OpenPose
Face Issues
Solutions
Use ADetailer extension
Use face_yolov8n model
Add "detailed face" to prompt
Slow Generation
Solutions
Lower resolution
Reduce steps to 20-25
Use UniPC sampler
Enable xformers
ComfyUI Basics
Basic Nodes
Load Checkpoint # Load model
CLIP Text Encode # Text encoding
KSampler # Sampler
VAE Decode # VAE decode
Save Image # Save image
Basic Workflow
Checkpoint → CLIP → KSampler → VAE Decode → Save
↑
Empty Latent
Advantages
- Node-based workflow
- Highly customizable
- Better memory management
- Complex workflow support