File size: 592 Bytes
d50a091
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
from diffusers import DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained("anton-l/ddpm-butterflies-128").to("cuda")

def diffusion():
    images = []
    for i in range(3):
        image = pipeline(num_inference_steps=25).images[0]
        images.append(image)
    return images

demo = gr.Interface(
    fn=diffusion,
    inputs=None,
    outputs=gr.Gallery(label="generated image", columns=3),
    title="Unconditional image generation",
    description="An unconditional diffusion model trained on a dataset of butterfly images."
)

demo.launch(debug=True)