# openai/guided-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/openai-guided-diffusion).**

7,395 stars · 914 forks · Python · MIT

## Links

- GitHub: https://github.com/openai/guided-diffusion
- awesome-repositories: https://awesome-repositories.com/repository/openai-guided-diffusion.md

## Description

This is a classifier-guided diffusion framework for high-fidelity image generation. It implements a cascaded diffusion pipeline that chains a base diffusion model with a dedicated upsampler to progressively increase image resolution in stages, and uses classifier-guided diffusion sampling to steer the reverse diffusion process toward higher-quality outputs.

The framework provides tools for training diffusion models from scratch using distributed processes with gradient accumulation, as well as training classifier models that provide gradient-based guidance during sampling. It supports both unconditional image generation and classifier-guided synthesis, and includes a dedicated upsampling module for increasing image resolution through a diffusion-based pipeline.

The system is built around a noise-prediction denoising objective with a timestep-embedded U-Net backbone, modeling the diffusion process as a discrete-time Markov chain of Gaussian transitions. Documentation covers model training, classifier training, and sampling from both unconditional and guided models.

## Tags

### Artificial Intelligence & ML

- [Classifier-Guided Variants](https://awesome-repositories.com/f/artificial-intelligence-ml/pytorch-training-frameworks/diffusion-model-frameworks/classifier-guided-variants.md) — Provides a classifier-guided diffusion framework that steers sampling using a classifier for higher fidelity and controlled attributes.
- [Image Diffusion Models](https://awesome-repositories.com/f/artificial-intelligence-ml/computer-vision-systems/image-diffusion-models.md) — Generates high-fidelity images by sampling from a diffusion model, optionally guided by a classifier for improved quality.
- [Cascaded Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/diffusion-pipelines/cascaded-pipelines.md) — Implements a cascaded pipeline that chains a base diffusion model with a dedicated upsampler for progressive resolution increase.
- [Classifier-Guided Methods](https://awesome-repositories.com/f/artificial-intelligence-ml/diffusion-sampling-methods/classifier-guided-methods.md) — Provides classifier-guided diffusion sampling that injects classifier gradients to steer sample quality toward higher fidelity.
- [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) — Trains a diffusion model on a dataset using distributed processes and adjustable settings. ([source](https://cdn.jsdelivr.net/gh/openai/guided-diffusion@main/README.md))
- [Resolution Upscaling](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-ai-resources/diffusion-visual-models/generative-models/latent-diffusion-models/resolution-upscaling.md) — Increases image resolution by passing low-resolution inputs through a dedicated diffusion upsampler.
- [Classifier-Guided Generation](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-image-models/noise-to-image-generation/classifier-guided-generation.md) — Steers a diffusion model's sampling process with a classifier to produce higher-fidelity images. ([source](https://cdn.jsdelivr.net/gh/openai/guided-diffusion@main/README.md))
- [Timestep-Embedded Variants](https://awesome-repositories.com/f/artificial-intelligence-ml/neural-network-architectures/u-net-architectures/timestep-embedded-variants.md) — Uses a U-Net backbone with sinusoidal timestep embeddings to condition the denoising process on the current noise level.
- [Classifier Training for Guidance](https://awesome-repositories.com/f/artificial-intelligence-ml/classifier-free-guidance/classifier-training-for-guidance.md) — Trains classifiers that provide gradient-based guidance during diffusion sampling to enhance output quality.
- [Distributed Training](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-ai-resources/diffusion-visual-models/generative-ai-models/diffusion-models/diffusion-model-training/distributed-training.md) — Trains a diffusion model from scratch on a dataset using distributed processes and adjustable settings.
- [Guidance Classifier Training](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-ai-resources/diffusion-visual-models/generative-ai-models/diffusion-models/diffusion-model-training/guidance-classifier-training.md) — Trains a classifier that steers diffusion sampling toward higher-quality outputs. ([source](https://cdn.jsdelivr.net/gh/openai/guided-diffusion@main/README.md))
- [Unconditional Generation](https://awesome-repositories.com/f/artificial-intelligence-ml/image-generation/unconditional-generation.md) — Generates images from a diffusion model that does not require class labels or a classifier. ([source](https://cdn.jsdelivr.net/gh/openai/guided-diffusion@main/README.md))
- [Markov Chain Monte Carlo Sampling](https://awesome-repositories.com/f/artificial-intelligence-ml/markov-chain-monte-carlo-sampling.md) — Models the diffusion process as a fixed-length Markov chain of Gaussian transitions, reversing it step by step during generation.
- [Gradient Accumulation Strategies](https://awesome-repositories.com/f/artificial-intelligence-ml/training-convergence-optimization/batch-size-scaling/gradient-accumulation-strategies.md) — Scales model training across multiple GPUs using data parallelism and gradient accumulation for large-batch convergence.

### Part of an Awesome List

- [Noise Prediction Objectives](https://awesome-repositories.com/f/awesome-lists/ai/gaussian-noise-diffusion/noise-prediction-objectives.md) — Trains the model to predict the noise added at each timestep, enabling iterative denoising from pure noise to a clean image.
- [Generation](https://awesome-repositories.com/f/awesome-lists/more/generation.md) — Listed in the “Generation” section of the Awesome Diffusion Models awesome list.

### Data & Databases

- [Guided Synthesis Classifiers](https://awesome-repositories.com/f/data-databases/data-categorization/classification-labelers/image-classifiers/guided-synthesis-classifiers.md) — Uses a classifier to steer a diffusion model's sampling process for higher-fidelity image generation.

### Graphics & Multimedia

- [Diffusion-Based Upsamplers](https://awesome-repositories.com/f/graphics-multimedia/3d-point-cloud-filtering/resolution-upsampling/dynamic-image-upsampling/diffusion-based-upsamplers.md) — Increases image resolution by passing low-resolution inputs through a dedicated diffusion-based upsampling pipeline.
- [Diffusion-Based Upsampling](https://awesome-repositories.com/f/graphics-multimedia/3d-point-cloud-filtering/resolution-upsampling/dynamic-image-upsampling/diffusion-based-upsampling.md) — Increases image resolution by passing low-resolution inputs through a dedicated diffusion upsampler. ([source](https://cdn.jsdelivr.net/gh/openai/guided-diffusion@main/README.md))
