Spaces:
Runtime error
Runtime error
File size: 616 Bytes
d50a091 4d0d517 d50a091 75212fe d50a091 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
import torch
from diffusers import DiffusionPipeline
pipeline = DiffusionPipeline.from_pretrained("anton-l/ddpm-butterflies-128", use_safetensors=True)
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) |