Spaces:
Runtime error
Runtime error
Delete app.py
Browse files
app.py
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
from diffusers import DiffusionPipeline
|
2 |
-
import torch
|
3 |
-
import PIL.Image
|
4 |
-
import gradio as gr
|
5 |
-
import random
|
6 |
-
import numpy as np
|
7 |
-
|
8 |
-
pipeline = DiffusionPipeline.from_pretrained("anton-l/ddpm-butterflies-128")
|
9 |
-
|
10 |
-
def predict(steps, seed):
|
11 |
-
generator = torch.manual_seed(seed)
|
12 |
-
for i in range(1,steps):
|
13 |
-
yield pipeline(generator=generator, num_inference_steps=i).images[0]
|
14 |
-
|
15 |
-
random_seed = random.randint(0, 2147483647)
|
16 |
-
gr.Interface(
|
17 |
-
predict,
|
18 |
-
inputs=[
|
19 |
-
gr.inputs.Slider(1, 100, label='Inference Steps', default=5, step=1),
|
20 |
-
gr.inputs.Slider(0, 2147483647, label='Seed', default=random_seed, step=1),
|
21 |
-
],
|
22 |
-
outputs=gr.Image(shape=[128,128], type="pil", elem_id="output_image"),
|
23 |
-
css="#output_image{width: 256px}",
|
24 |
-
title="Unconditional butterflies",
|
25 |
-
description="A DDPM scheduler and UNet model trained (from this <a href=\"https://huggingface.co/anton-l/ddpm-butterflies-128\">checkpoint</a>) on a subset of the <a href=\"https://huggingface.co/datasets/huggan/smithsonian_butterflies_subset\">Smithsonian Butterflies</a> dataset for unconditional image generation.",
|
26 |
-
).queue().launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|