Spaces:
Runtime error
Runtime error
Commit
·
5138bba
1
Parent(s):
611bd3a
modelProblems
Browse files
app.py
CHANGED
@@ -5,10 +5,24 @@ import PIL.Image
|
|
5 |
import gradio as gr
|
6 |
import gradio.components as grc
|
7 |
import numpy as np
|
|
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
@spaces.GPU
|
14 |
def predict(steps, seed):
|
@@ -20,7 +34,7 @@ gr.Interface(
|
|
20 |
predict,
|
21 |
inputs=[
|
22 |
grc.Slider(1, 1000, label='Inference Steps', value=1000, step=1),
|
23 |
-
|
24 |
],
|
25 |
outputs=gr.Image(height=28, width=28, type="pil", elem_id="output_image"),
|
26 |
css="#output_image{width: 256px !important; height: 256px !important;}",
|
|
|
5 |
import gradio as gr
|
6 |
import gradio.components as grc
|
7 |
import numpy as np
|
8 |
+
import time
|
9 |
|
10 |
+
|
11 |
+
# models=[
|
12 |
+
# "runwayml/stable-diffusion-v1-5",
|
13 |
+
# "claudfuen/photorealistic-fuen-v1",
|
14 |
+
# "nitrosocke/redshift-diffusion",
|
15 |
+
# ]
|
16 |
+
# model_box=[
|
17 |
+
# gr.Interface.load(f"models/{models[0]}",live=True,preprocess=True),
|
18 |
+
# gr.Interface.load(f"models/{models[1]}",live=True,preprocess=True),
|
19 |
+
# gr.Interface.load(f"models/{models[2]}",live=True,preprocess=True),
|
20 |
+
# ]
|
21 |
+
# current_model=model_box[0]
|
22 |
+
|
23 |
+
# pipeline = DiffusionPipeline.from_pretrained("nathanReitinger/MNIST-diffusion-oneImage")
|
24 |
+
# device = "cuda" if torch.cuda.is_available() else "cpu"
|
25 |
+
# pipeline = pipeline.to(device=device)
|
26 |
|
27 |
@spaces.GPU
|
28 |
def predict(steps, seed):
|
|
|
34 |
predict,
|
35 |
inputs=[
|
36 |
grc.Slider(1, 1000, label='Inference Steps', value=1000, step=1),
|
37 |
+
grc.Slider(0, 2147483647, label='Seed', value=69420, step=1),
|
38 |
],
|
39 |
outputs=gr.Image(height=28, width=28, type="pil", elem_id="output_image"),
|
40 |
css="#output_image{width: 256px !important; height: 256px !important;}",
|