# stable-diffusion | CompVis - Computer Vision and Learning LMU Munich | Knowledge Base | Instagit

A latent text-to-image diffusion model

GitHub Stars: 72.6k

Repository: https://github.com/CompVis/stable-diffusion

---

## Articles

### [How to Debug Stable Diffusion Mode Collapse, Artifacts, and Poor Prompt Adherence](/CompVis/stable-diffusion/debug-stable-diffusion-issues-artifacts-prompt-adherence)

Debug Stable Diffusion mode collapse artifacts and prompt adherence issues. Tune guidance scale, increase diffusion steps, and verify text conditioning for better results.

- Tags: how-to-guide
- Published: 2026-03-02

### [Architecture of the X-Transformers Encoder in Stable Diffusion: Core Components and Data Flow](/CompVis/stable-diffusion/x-transformers-encoder-architecture-stable-diffusion)

Explore the x-transformers encoder architecture in Stable Diffusion. Understand its core components like self-attention and feed-forward layers and their data flow within the model.

- Tags: architecture
- Published: 2026-03-02

### [How to Implement Mixed Precision (FP16) Inference in Stable Diffusion for Faster Generation](/CompVis/stable-diffusion/stable-diffusion-fp16-inference-performance)

Implement mixed precision FP16 inference in Stable Diffusion to boost generation speed by 50% and reduce VRAM. Learn how to use the autocast flag or convert model weights.

- Tags: performance
- Published: 2026-03-02

### [LAION-400M vs Stable Diffusion v1: Key Differences in Training Data and Performance](/CompVis/stable-diffusion/laion-400m-vs-stable-diffusion-v1-model)

Discover the key differences between LAION-400M and Stable Diffusion v1 models Analyze training data and performance distinctions to understand their capabilities and choose the best model for your needs.

- Tags: deep-dive
- Published: 2026-03-02

### [How the BSRGAN Module Works for Image Degradation and Super-Resolution in Stable Diffusion](/CompVis/stable-diffusion/bsrgan-module-image-degradation-upscaling-stable-diffusion)

Discover how the BSRGAN module in Stable Diffusion creates realistic degraded images for blind super-resolution training by applying random blurs, downsampling, noise, and compression.

- Tags: deep-dive
- Published: 2026-03-02

### [How to Integrate Custom VQ-Perceptual and Contrastive Perceptual Losses in Stable Diffusion Training](/CompVis/stable-diffusion/custom-loss-functions-stable-diffusion-training)

Learn how to integrate custom VQ-perceptual and contrastive perceptual losses into Stable Diffusion training using YAML configurations or programmatic instantiation in a custom LightningModule.

- Tags: how-to-guide
- Published: 2026-03-02

### [How to Use the Seed Parameter in Stable Diffusion for Reproducible Generations](/CompVis/stable-diffusion/stable-diffusion-seed-parameter-reproducible-generations)

Master the Stable Diffusion seed parameter to generate identical images every time. Learn how this simple setting ensures reproducible results across runs and hardware.

- Tags: how-to-guide
- Published: 2026-03-02

### [How to Implement Efficient Batch Generation with Multiple Prompts in Stable Diffusion](/CompVis/stable-diffusion/stable-diffusion-batch-generation-multiple-prompts)

Learn efficient batch generation with multiple prompts in Stable Diffusion. Load the model once, stack prompts, and vectorize diffusion for parallel processing. Optimize your image generation workflow.

- Tags: how-to-guide
- Published: 2026-03-02

### [Stable Diffusion Fine-Tuning: Complete Guide to Training Configuration Options in main.py](/CompVis/stable-diffusion/stable-diffusion-main-py-training-config)

Explore Stable Diffusion fine-tuning options in main.py. Master training configuration for learning rate scaling, GPU allocation, and experiment logging.

- Tags: deep-dive
- Published: 2026-03-02

### [How to Implement Custom Attention Mechanisms in Stable Diffusion's UNet](/CompVis/stable-diffusion/custom-attention-mechanisms-stable-diffusion-unet)

Implement custom attention in Stable Diffusion's UNet by subclassing BasicTransformerBlock and replacing default layers to enhance image generation. Learn how to modify cross-attention for unique results.

- Tags: how-to-guide
- Published: 2026-03-02

### [VAE Autoencoder Architecture in Stable Diffusion: How Latent Space Compression Works](/CompVis/stable-diffusion/stable-diffusion-vae-autoencoder-architecture-latent-space)

Explore the VAE autoencoder architecture in Stable Diffusion. Learn how this powerful model compresses images into a compact latent space for efficient processing and generation.

- Tags: architecture
- Published: 2026-03-02

### [How to Implement Prompt Weighting and Negative Prompts in Stable Diffusion](/CompVis/stable-diffusion/stable-diffusion-prompt-weighting-negative-prompts)

Discover how to implement prompt weighting and negative prompts in Stable Diffusion to gain precise control over your image generations. Learn to blend conditioning tensors for superior results.

- Tags: how-to-guide
- Published: 2026-03-02

### [Diffusers Library vs Native Sampling Scripts for Stable Diffusion: Key Differences Explained](/CompVis/stable-diffusion/diffusers-library-vs-native-sampling-scripts)

Compare the Diffusers library and native Stable Diffusion scripts. Understand key differences in control, abstraction, and ease of use for your AI image generation.

- Tags: deep-dive
- Published: 2026-03-02

### [How CLIP ViT-L/14 Text Encoder Conditions the UNet in Stable Diffusion: Cross-Attention Deep Dive](/CompVis/stable-diffusion/clip-text-encoder-unet-conditioning-stable-diffusion)

Discover how the CLIP ViT-L/14 text encoder conditions the UNet in Stable Diffusion. Understand cross-attention for text-to-image generation using latent conditioning vectors.

- Tags: deep-dive
- Published: 2026-03-02

### [How to Optimize Memory Usage for Stable Diffusion Inference on Low-VRAM GPUs](/CompVis/stable-diffusion/optimize-stable-diffusion-memory-usage-gpu)

Run Stable Diffusion on low VRAM GPUs with half-precision weights, gradient checkpointing, and mixed precision. Optimize memory for efficient inference.

- Tags: performance
- Published: 2026-03-02

### [Stable Diffusion Model Checkpoints Explained: Comparing v1-1, v1-2, v1-3, and v1-4](/CompVis/stable-diffusion/stable-diffusion-checkpoint-differences-selection)

Discover the differences between Stable Diffusion model checkpoints v1-1 to v1-4. Learn which version offers the best fidelity or suits limited GPU memory for your needs.

- Tags: deep-dive
- Published: 2026-03-02

### [How to Perform Inpainting with Custom Masks Using Stable Diffusion](/CompVis/stable-diffusion/stable-diffusion-inpainting-custom-masks)

Learn how to perform inpainting with custom masks using Stable Diffusion. This guide explains the process of conditioning the latent diffusion model effectively for precise image generation over masked areas. Get started now.

- Tags: how-to-guide
- Published: 2026-03-01

### [Stable Diffusion Invisible Watermarking: Implementation, Customization, and Disabling Guide](/CompVis/stable-diffusion/stable-diffusion-invisible-watermarking-customization)

Learn how Stable Diffusion implements invisible watermarking. Discover how to customize or disable watermarking for your generated images with this comprehensive guide.

- Tags: how-to-guide
- Published: 2026-03-01

### [How the Image-to-Image (img2img) Process Works in Stable Diffusion: Pipeline Mechanics and the Strength Parameter](/CompVis/stable-diffusion/stable-diffusion-image-to-image-strength-parameter)

Explore the Stable Diffusion img2img process. Learn how latent space encoding, noise steps, and the strength parameter control image generation by balancing original structure and prompt adherence. Optimize your creative workflow.

- Tags: deep-dive
- Published: 2026-03-01

### [How to Configure EMA Weights for More Stable Inference in Stable Diffusion](/CompVis/stable-diffusion/configure-ema-weights-stable-inference)

Achieve stable Stable Diffusion inference using EMA weights. Learn to configure model settings and use EMA scope for smoother, lower-variance image generation.

- Tags: performance
- Published: 2026-03-01

### [How Stable Diffusion's Safety Checker Detects and Filters NSFW Content](/CompVis/stable-diffusion/stable-diffusion-safety-checker-nsfw-detection)

Discover how Stable Diffusion's safety checker uses CLIP and a linear classifier to detect and filter NSFW content, ensuring safe image generation. Learn about the process and its effectiveness.

- Tags: deep-dive
- Published: 2026-03-01

### [Classifier-Free Guidance in Stable Diffusion: How Guidance Scale Controls Generation Quality](/CompVis/stable-diffusion/classifier-free-guidance-scale-effect)

Learn how classifier-free guidance in Stable Diffusion balances prompt fidelity and image diversity. Discover how guidance scale impacts generated image quality.

- Tags: deep-dive
- Published: 2026-03-01

### [How to Implement Custom Samplers Like DDIM, PLMS, or DPM-Solver in Stable Diffusion](/CompVis/stable-diffusion/implement-custom-samplers-stable-diffusion)

Learn to implement custom samplers like DDIM, PLMS, or DPM-Solver in Stable Diffusion. Discover how the lightweight interface allows easy integration of new sampling algorithms.

- Tags: how-to-guide
- Published: 2026-03-01

### [How Stable Diffusion's Latent Diffusion Architecture Differs from Pixel-Space Models](/CompVis/stable-diffusion/stable-diffusion-latent-vs-pixel-diffusion)

Explore how Stable Diffusion's latent diffusion architecture outperforms pixel-space models by moving computation to a compressed latent space, significantly reducing resource needs without sacrificing quality.

- Tags: architecture
- Published: 2026-03-01

