---
title: ddpm_dummy
canonical_url: "https://www.modelscope.cn/models/hf-diffusers/ddpm_dummy"
md_url: "https://www.modelscope.cn/models/hf-diffusers/ddpm_dummy.md"
repository: hf-diffusers/ddpm_dummy
last_updated: 2024-11-07
library_name:
  - pytorch
frameworks:
  - pytorch
downloads: 1821
stars: 0
tags:
  - hf_diffuse
---

# ddpm_dummy

> ddpm_dummy - hf-diffusers 在 ModelScope 开源的模型。Dummy diffusion model following architecture of https://github.com/lucidrains/denoising-diffusion-pytorch

- **Repository**: hf-diffusers/ddpm_dummy
- **Tags**: hf_diffuse
- **Downloads**: 1821
- **Stars**: 0
- **Last updated**: 2024-11-07

Source: https://www.modelscope.cn/models/hf-diffusers/ddpm_dummy

---

# Dummy diffusion model following architecture of https://github.com/lucidrains/denoising-diffusion-pytorch

Run the model as follows:

```python
from diffusers import UNetModel, GaussianDiffusion
import torch

# 1. Load model
unet = UNetModel.from_pretrained("fusing/ddpm_dummy")

# 2. Do one denoising step with model
batch_size, num_channels, height, width = 1, 3, 32, 32
dummy_noise = torch.ones((batch_size, num_channels, height, width))
time_step = torch.tensor([10])
image = unet(dummy_noise, time_step)

# 3. Load sampler
sampler = GaussianDiffusion.from_config("fusing/ddpm_dummy")

# 4. Sample image from sampler passing the model
image = sampler.sample(model, batch_size=1)

print(image)
```
