# compvis/latent-diffusion

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/compvis-latent-diffusion).**

14,072 stars · 1,731 forks · Jupyter Notebook · MIT

## Links

- GitHub: https://github.com/CompVis/latent-diffusion
- awesome-repositories: https://awesome-repositories.com/repository/compvis-latent-diffusion.md

## Description

Latent Diffusion is a framework for high-resolution image synthesis that performs the denoising process within a compressed latent space. It uses variational autoencoders to encode images into a lower-dimensional representation, reducing the computational cost of noise prediction compared to operating on raw pixels.

The project enables text-to-image generation by integrating natural language descriptions through cross-attention conditioning. It also supports image inpainting and restoration, filling masked or missing image areas with generated content, and example-based synthesis using retrieved visual samples.

The system includes capabilities for training both the regularized autoencoder models used for compression and the latent diffusion models used for synthesis. It supports various sampling methods, including unconditional image generation and classifier-free guidance to balance sample fidelity and diversity.

## Tags

### Artificial Intelligence & ML

- [Latent Diffusion Models](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-ai-resources/diffusion-visual-models/generative-models/latent-diffusion-models.md) — Provides a latent diffusion model framework that performs the denoising process within a compressed latent space.
- [Diffusion Model Training](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-ai-resources/diffusion-visual-models/generative-ai-models/diffusion-models/diffusion-model-training.md) — Includes workflows for training latent diffusion models on large datasets of diverse visual examples. ([source](https://cdn.jsdelivr.net/gh/compvis/latent-diffusion@main/README.md))
- [Latent Space Encoders](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-ai-resources/diffusion-visual-models/generative-ai-models/latent-space-generative-models/latent-space-projections/latent-space-encoders.md) — Implements latent space encoders to compress high-resolution images for efficient diffusion processing.
- [Text-to-Image Generators](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-ai-resources/diffusion-visual-models/generative-ai-pipelines/text-to-image-generators.md) — Generates high-resolution images from natural language descriptions using latent diffusion pipelines. ([source](https://cdn.jsdelivr.net/gh/compvis/latent-diffusion@main/README.md))
- [Cross-Attention Conditioning](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-ai-resources/diffusion-visual-models/generative-ai-pipelines/text-to-video-generators/cross-attention-conditioning.md) — Uses cross-attention conditioning to integrate text and image embeddings into the denoising network.
- [Variational Autoencoders](https://awesome-repositories.com/f/artificial-intelligence-ml/model-training/variational-autoencoders.md) — Uses variational autoencoders to compress high-resolution images into a lower-dimensional latent space.
- [Iterative Denoising Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/neural-network-architectures/u-net-architectures/iterative-denoising-pipelines.md) — Implements iterative denoising pipelines to recursively remove Gaussian noise from random signals.
- [Latent Noise Prediction](https://awesome-repositories.com/f/artificial-intelligence-ml/text-generation-strategies/token-prediction/masked/latent-masked-token-prediction/latent-noise-prediction.md) — Performs iterative noise prediction within a compressed representation to improve computational efficiency.
- [Classifier-Free Guidance](https://awesome-repositories.com/f/artificial-intelligence-ml/classifier-free-guidance.md) — Implements classifier-free guidance to balance image fidelity and diversity during the denoising process.
- [Image Inpainting](https://awesome-repositories.com/f/artificial-intelligence-ml/deep-learning-architectures/image-inpainting.md) — Provides image inpainting capabilities to restore missing areas by combining known pixels with generated content.
- [Example-Based Synthesis](https://awesome-repositories.com/f/artificial-intelligence-ml/example-based-synthesis.md) — Implements example-based synthesis to create new visuals based on retrieved image patterns.
- [Image Generation](https://awesome-repositories.com/f/artificial-intelligence-ml/image-generation.md) — Supports unconditional image generation by sampling directly from the trained model. ([source](https://cdn.jsdelivr.net/gh/compvis/latent-diffusion@main/README.md))
- [Example-Based Synthesis](https://awesome-repositories.com/f/artificial-intelligence-ml/image-retrieval-systems/text-to-image-retrieval/example-based-synthesis.md) — Creates new images by combining natural language prompts with similar visual examples retrieved from a database. ([source](https://cdn.jsdelivr.net/gh/compvis/latent-diffusion@main/README.md))
- [High-Resolution Synthesis](https://awesome-repositories.com/f/artificial-intelligence-ml/image-super-resolution-models/high-resolution-synthesis.md) — Synthesizes high-fidelity, high-resolution images from trained generative models.

### Part of an Awesome List

- [Image Restoration and Generation](https://awesome-repositories.com/f/awesome-lists/ai/image-restoration-and-generation.md) — Provides image restoration and inpainting to fill masked areas and restore the visual whole.
- [Generation](https://awesome-repositories.com/f/awesome-lists/more/generation.md) — Listed in the “Generation” section of the Awesome Diffusion Models awesome list.

### Graphics & Multimedia

- [Area Filling and Clearing](https://awesome-repositories.com/f/graphics-multimedia/area-filling-and-clearing.md) — Fills missing image areas and gaps with generated visual content. ([source](https://cdn.jsdelivr.net/gh/compvis/latent-diffusion@main/README.md))
- [Latent Inpainting Masks](https://awesome-repositories.com/f/graphics-multimedia/media-processing-analysis/face-portrait-manipulation/image-masking/face-mask-generation/latent-inpainting-masks.md) — Supports mask-based latent inpainting to reconstruct missing image regions within the compressed space.
