Advanced
AI Image Generation
12 min read

Stable Diffusion Parameter Guide

Understanding Key Parameters

Several critical parameters determine image quality in Stable Diffusion. CFG Scale (Classifier Free Guidance) determines how strictly the AI follows the prompt; values between 7-12 are ideal for most cases. Low values (1-5) produce more creative but prompt-deviating results, while high values (15+) can produce oversaturated and artifacted images. Sampling Steps determine how long the image is processed; 20-30 steps are generally sufficient, with 50+ steps providing marginal improvement.

Sampler Selection

Each sampler produces different visual characteristics. DPM++ 2M Karras is the most popular choice for high-quality and consistent results. Euler A is useful for creative and diverse outputs but can show seed-based inconsistency. DDIM is suitable for more deterministic results and interpolation. UniPC is a standout option as of 2023 for its speed-quality balance. For sampler experimentation, comparing different samplers with the same seed and prompt is recommended.

Model and LoRA Usage

The power of Stable Diffusion comes from different checkpoint models and LoRA (Low-Rank Adaptation) weights. Civitai.com hosts thousands of user-trained models and LoRAs. For realistic photography, you can use Realistic Vision or epiCRealism models; for anime style, ToonYou or Counterfeit models. LoRAs fine-tune the model for specific characters, styles, or concepts; for example, used to reproduce an artist's style or a specific character.

Precise Control with ControlNet

ControlNet is an extension that revolutionizes visual production. With Canny edge detection, you can preserve the main lines of an image and generate new content. For pose control, you can lock a character's body position using OpenPose. With a depth map, you can apply style transfer while preserving the depth structure of the image. With inpainting, you can change specific parts of an image while preserving the rest. Combining these tools gives you complete control over human anatomy, architectural consistency, and composition.

Parameter Combination Guide

We have tested hundreds of combinations and identified ideal setting presets for different use cases:

**Photorealistic Portrait:** - Model: Realistic Vision v5.1 or epiCRealism - Sampler: DPM++ 2M Karras - Steps: 28-35 - CFG Scale: 7-8 - Negative prompt: "cartoon, painting, illustration, worst quality, low quality, bad anatomy, deformed, extra limbs"

**Anime / Illustration:** - Model: ToonYou or Counterfeit v3 - Sampler: DPM++ SDE Karras - Steps: 25-30 - CFG Scale: 8-10 - Negative prompt: "photorealistic, 3d render, worst quality, bad proportions, extra fingers"

**Architecture / Interior:** - Model: Dreamshaper or Juggernaut XL - Sampler: DPM++ 2M Karras - Steps: 30-40 - CFG Scale: 7-9 - Negative prompt: "people, blurry, low quality, distorted, watermark"

**Concept Art:** - Model: DreamShaper XL or SDXL base - Sampler: Euler A - Steps: 30-35 - CFG Scale: 8-10 - Negative prompt: "photorealistic, low quality, blurry, text, watermark"

Use these settings as starting points and fine-tune according to your specific needs.

Resolution and Upscale Strategies

In Stable Diffusion, resolution determines the balance between performance and quality. Here is our recommended approach:

- **Starting resolution:** Use 512x512 or 512x768 for SD 1.5 models; 1024x1024 or 1024x1280 for SDXL models. Going outside these sizes can produce artifacts. - **Hires Fix:** The initial generation is done at low resolution, then details are added with 2x upscaling. A denoising strength of 0.3-0.5 is a good starting point. - **Upscale models:** 4x-UltraSharp and ESRGAN-4x are ideal for photorealistic images. For anime content, prefer 4x-AnimeSharp. - **Tiled upscale:** For very large resolutions (4K+), use tiled VAE and tiled upscale to reduce VRAM consumption.

Step by Step: From First Image to Professional Output

Now it is your turn! Follow these steps in order:

1. **Basic image:** Write a simple prompt (for example "a serene mountain lake at sunset"). Generate with CFG 7, Steps 25, DPM++ 2M Karras sampler. Review the result. 2. **CFG comparison:** Try CFG values of 3, 7, 12, and 18 with the same prompt and seed. Observe the difference — low CFG will be more dreamlike, high CFG sharper but with more artifacts. 3. **Sampler test:** Compare Euler A, DPM++ 2M Karras, and DDIM samplers with the same prompt, seed, and CFG. Note the character difference of each. 4. **Add negative prompt:** Address issues in the output (such as blurriness, low quality) by adding them to the negative prompt. 5. **LoRA experiment:** Download a style LoRA from Civitai and add it to your prompt. Compare the same scene with and without the LoRA. 6. **Hires Fix:** Upscale your favorite image 2x with Hires Fix. Observe the difference with denoising 0.3 and 0.5.

SDXL vs SD 1.5: Which Should You Use?

SDXL (Stable Diffusion XL) is the advanced version of SD 1.5 and includes significant differences:

- **Resolution:** SDXL natively supports 1024x1024; SD 1.5 works best at 512x512. - **Detail quality:** SDXL is noticeably better at faces, hands, and small details. - **Prompt understanding:** SDXL interprets long and complex prompts better. - **VRAM requirement:** SDXL requires at least 8GB VRAM; SD 1.5 can run with 4GB. - **Model ecosystem:** SD 1.5 has a much larger LoRA and model ecosystem.

Our recommendation: If you have a powerful GPU (8GB+ VRAM), start with SDXL. If you have limited hardware or need a specific LoRA, SD 1.5 still delivers excellent results.

Frequently Asked Questions

**How much VRAM is needed for Stable Diffusion?** SD 1.5 models can run with 4GB VRAM, but we recommend 8GB. For SDXL, at least 8GB is needed, ideally 12GB. Optimizations like ComfyUI and xformers can reduce VRAM consumption by 30-40%.

**How should I choose the CFG Scale value?** General rule: Start around 7. If results are not following the prompt enough, increase to 9-10. If results are oversaturated or have artifacts, decrease to 5-6. The ideal CFG varies slightly for each model; we recommend testing and using the value suggested on the model card.

**Does increasing sampling steps always produce better results?** No. 20-30 steps is the optimal range for most samplers. Above 50, improvement is negligible and processing time doubles. However, some samplers (like Euler A) can produce good results even at low step counts, while for others (DPM++ 2M Karras) we recommend 25+ steps.

**Where can I find LoRA files?** Civitai.com is the largest and most active LoRA/model sharing platform. Hugging Face also hosts official and community models. Place LoRA files in the models/Lora folder and use them in prompts as "<lora:filename:weight>"; a weight of 0.5-0.8 generally produces the best results.

Tags:
#stable-diffusion
#parametre
#cfg
#sampler
#advanced
#automaticA111

Related Guides

View all