All models

diffusers_unet2d

The noise-predicting U-Net behind DDPM, the paper that made diffusion models generate sharp images.

Diffusion and generative · 491 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (37 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
35.7M
Operations
491
Framework
PyTorch
Recurrent
No
Published
NeurIPS 2020
Cited by
8,702 (as of 19 October 2026)
Authors
Jonathan Ho, Ajay Jain, Pieter Abbeel
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m4301
Graph hash
b929dcb919e03cdda58e27c5820bd1b8be0e7ec376d39128a3e56fbbb2f82ec5
Skeleton hash
22c70ea85724002512928d207642c53577c49ec093a942442302b8ea8be665a7
Architecture hash
4925f952da0ded82dd201e5262f760f04f5d636c5494c8b5988cf3e67568b53e
Diagram SHA-256
d9e1b2a8d15192951f581c153c761ba4137c2f0c8c6b475ac865a218e29e093b
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

diffusers.UNet2DModel(sample_size=32, in_channels=3, out_channels=3, layers_per_block=2, block_out_channels=[128, 256, 256, 256], down_block_types=['DownBlock2D', 'AttnDownBlock2D', 'DownBlock2D', 'DownBlock2D'], up_block_types=['UpBlock2D', 'UpBlock2D', 'AttnUpBlock2D', 'UpBlock2D'], time_embedding_type='positional', freq_shift=1, flip_sin_to_cos=False, downsample_padding=0, norm_eps=1e-06, norm_num_groups=32, act_fn='silu', attention_head_dim=None, dropout=0.1)

What it is

This graph is the denoising network at the heart of a Denoising Diffusion Probabilistic Model, or DDPM. The paper presented high quality image synthesis results using diffusion probabilistic models, a class of latent variable models inspired by considerations from nonequilibrium thermodynamics. A diffusion model is a parameterized Markov chain trained with variational inference to produce samples matching the data after a finite number of steps. The authors note that diffusion models were straightforward to define and efficient to train, but that to the best of their knowledge there had been no demonstration that they could generate high quality samples.

The network you are looking at represents the reverse process: a U-Net backbone similar to an unmasked PixelCNN++ with group normalization throughout. Because the diffusion adds only small amounts of Gaussian noise, the sampling chain transitions can be conditional Gaussians too, which allows a particularly simple neural network parameterization. Rather than predicting the denoised mean directly, the network is trained to predict the noise, a parameterization that both resembles Langevin dynamics and simplifies the variational bound to an objective resembling denoising score matching. Training on this simplified variant of the bound was found beneficial to sample quality and simpler to implement. Parameters are shared across time, with the timestep told to the network through the Transformer sinusoidal position embedding, and self-attention sits at the 16 × 16 feature map resolution.

The architecture follows the backbone of PixelCNN++, a U-Net based on a Wide ResNet, with weight normalization replaced by group normalization to make the implementation simpler. The 32 × 32 models, the configuration captured here, use four feature map resolutions from 32 × 32 down to 4 × 4, with two convolutional residual blocks per resolution level. The CIFAR10 model has 35.7 million parameters, while the LSUN and CelebA-HQ models have 114 million. Dropout was set to 0.1 on CIFAR10 by a sweep, since without it the samples showed artifacts reminiscent of overfitting in an unregularized PixelCNN++.

On unconditional CIFAR10 the model reached an Inception score of 9.46 and a state-of-the-art FID of 3.17, and on 256x256 LSUN its samples were of quality similar to ProgressiveGAN. All experiments ran on a TPU v3-8, where the CIFAR model trained to completion in 10.6 hours at 800k steps.

Key idea. DDPM showed that diffusion probabilistic models can produce high quality image samples, with the best results coming from a weighted variational bound designed according to a novel connection between diffusion models and denoising score matching with Langevin dynamics.

  • ddpm
  • denoising diffusion probabilistic models
  • diffusion model
  • ddpm u-net
  • unet2dmodel
  • diffusers unet2d
  • noise predictor
  • epsilon prediction
  • image generation
  • cifar10
  • ho jain abbeel

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{ho2020denoisingdiffusionprobabilisticmodels,
      title={Denoising Diffusion Probabilistic Models}, 
      author={Jonathan Ho and Ajay Jain and Pieter Abbeel},
      year={2020},
      eprint={2006.11239},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2006.11239}, 
}