Views
No views yet
1from diffusers import DDPMPipeline, DDIMPipeline, PNDMPipeline
2
3
4def main():
5 model_id = "Norod78/ddpm-EmojiAlignedFaces-64"
6
7 # load model and scheduler
8 ddpm = DDPMPipeline.from_pretrained(model_id) # you can replace DDPMPipeline with DDIMPipeline or PNDMPipeline for faster inference
9
10 # run pipeline in inference (sample random noise and denoise)
11 image = ddpm()["sample"]
12
13 # save image
14 image[0].save("ddpm_generated_image.jpg")
15 image[0].show()
16
17if __name__ == '__main__':
18 main()