ddpm_lsun(pretrained: bool | str = False, weights: DDPMChurchWeights | None = None, overrides: object = {})Construct a DDPM U-Net trunk for the LSUN / CelebA-HQ 256x256 setup.
Paper-faithful 256x256 configuration from Ho, Jain, and Abbeel, 2020
Appendix B.2 (LSUN church / bedroom and CelebA-HQ): sample size
256x256, base_channels=128, channel_mult=(1, 1, 2, 2, 4, 4)
(six spatial stages — 256 -> 128 -> ... -> 8), 2 ResBlocks per stage,
self-attention at the 16x16 feature map, 1 attention head, no
dropout, and a 1000-step linear beta schedule.
Model Size
Parameters
pretrainedbool or str= FalseWeight selector.
False → random init; True → the official
google/ddpm-church-256 LSUN-Church checkpoint
(DDPMChurchWeights.LSUN_CHURCH).weights(DDPMChurchWeights, optional, keyword - only)= NoneExplicit weights enum member; takes precedence over
pretrained.**overridesobject= {}Optional
DDPMConfig field overrides forwarded into the
underlying config. Overrides that change the U-Net shape are
incompatible with the pretrained checkpoint.Returns
DDPMModelBare U-Net trunk configured with the LSUN / CelebA-HQ setup (pretrained when requested).
Notes
Reference: Ho, Jain, and Abbeel, "Denoising Diffusion Probabilistic Models", NeurIPS, 2020 (arXiv:2006.11239), Appendix B.2.
Examples
>>> import lucid
>>> from lucid.models.generative.ddpm import ddpm_lsun
>>> model = ddpm_lsun().eval()
>>> x_t = lucid.randn((1, 3, 256, 256))
>>> t = lucid.tensor([500]).long()
>>> out = model(x_t, t)
>>> out.sample.shape # (1, 3, 256, 256)
(1, 3, 256, 256)