Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import spaces
|
|
3 |
import torch
|
4 |
import PIL.Image
|
5 |
import gradio as gr
|
|
|
6 |
import numpy as np
|
7 |
|
8 |
pipeline = DiffusionPipeline.from_pretrained("1aurent/ddpm-mnist")
|
@@ -18,8 +19,8 @@ def predict(steps, seed):
|
|
18 |
gr.Interface(
|
19 |
predict,
|
20 |
inputs=[
|
21 |
-
|
22 |
-
|
23 |
],
|
24 |
outputs=gr.Image(shape=[28,28], type="pil", elem_id="output_image"),
|
25 |
css="#output_image{width: 256px}",
|
|
|
3 |
import torch
|
4 |
import PIL.Image
|
5 |
import gradio as gr
|
6 |
+
import gradio.components as grc
|
7 |
import numpy as np
|
8 |
|
9 |
pipeline = DiffusionPipeline.from_pretrained("1aurent/ddpm-mnist")
|
|
|
19 |
gr.Interface(
|
20 |
predict,
|
21 |
inputs=[
|
22 |
+
grc.Slider(1, 100, label='Inference Steps', default=12, step=1),
|
23 |
+
grc.Slider(0, 2147483647, label='Seed', default=69420, step=1),
|
24 |
],
|
25 |
outputs=gr.Image(shape=[28,28], type="pil", elem_id="output_image"),
|
26 |
css="#output_image{width: 256px}",
|