diffusers/ddpm_dummy
13.2k
1---2tags:3- hf_diffuse4---5 6# Dummy diffusion model following architecture of https://github.com/lucidrains/denoising-diffusion-pytorch7 8Run the model as follows:9 10```python11from diffusers import UNetModel, GaussianDiffusion12import torch13 14# 1. Load model15unet = UNetModel.from_pretrained("fusing/ddpm_dummy")16 17# 2. Do one denoising step with model18batch_size, num_channels, height, width = 1, 3, 32, 3219dummy_noise = torch.ones((batch_size, num_channels, height, width))20time_step = torch.tensor([10])21image = unet(dummy_noise, time_step)22 23# 3. Load sampler24sampler = GaussianDiffusion.from_config("fusing/ddpm_dummy")25 26# 4. Sample image from sampler passing the model27image = sampler.sample(model, batch_size=1)28 29print(image)30```