Spaces:
Sleeping
Sleeping
File size: 992 Bytes
486a417 138deff 486a417 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
from diffusers import DDPMPipeline
import torch
import PIL.Image
import gradio as gr
import random
import numpy as np
ddpm_pipeline = DDPMPipeline.from_pretrained("osanseviero/my-aurora")
def predict(seed=42):
generator = torch.manual_seed(seed)
images = ddpm_pipeline(generator=generator)["sample"]
return images[0]
random_seed = random.randint(0, 2147483647)
gr.Interface(
predict,
inputs=[
gr.inputs.Slider(0, 2147483647, label='Seed', default=random_seed, step=1),
],
outputs=gr.Image(shape=[32,32], type="pil", elem_id="output_image"),
title="Generate aurora with diffusers!",
description="This demo the <a href=\"https://huggingface.co/osanseviero/my-aurora\">my-aurora</a> model to generate aurora created by <a href=\"https://huggingface.co/osanseviero\">osanseviero</a> using the <a href=\"https://github.com/osanseviero/diffuse-it\">Diffuse It! tool</a>. Inference might take around a minute.",
).launch(debug=True, enable_queue=True)
|