from diffusers import DDPMPipeline import torch import PIL.Image import gradio as gr import random import numpy as np ddpm_pipeline = DDPMPipeline.from_pretrained("nateraw/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 my-aurora model to generate aurora created by nateraw using the Diffuse It! tool. Inference might take around a minute.", ).launch(debug=True, enable_queue=True)