Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,6 @@ import gradio as gr
|
|
2 |
import numpy as np
|
3 |
import random
|
4 |
|
5 |
-
# import spaces #[uncomment to use ZeroGPU]
|
6 |
from diffusers import DiffusionPipeline
|
7 |
import torch
|
8 |
|
@@ -21,7 +20,7 @@ MAX_SEED = np.iinfo(np.int32).max
|
|
21 |
MAX_IMAGE_SIZE = 1024
|
22 |
|
23 |
|
24 |
-
|
25 |
def infer(
|
26 |
prompt,
|
27 |
negative_prompt,
|
@@ -66,7 +65,7 @@ css = """
|
|
66 |
|
67 |
with gr.Blocks(css=css) as demo:
|
68 |
with gr.Column(elem_id="col-container"):
|
69 |
-
gr.Markdown(" # Text-to-Image Gradio
|
70 |
|
71 |
with gr.Row():
|
72 |
prompt = gr.Text(
|
@@ -105,7 +104,7 @@ with gr.Blocks(css=css) as demo:
|
|
105 |
minimum=256,
|
106 |
maximum=MAX_IMAGE_SIZE,
|
107 |
step=32,
|
108 |
-
value=1024,
|
109 |
)
|
110 |
|
111 |
height = gr.Slider(
|
@@ -113,7 +112,7 @@ with gr.Blocks(css=css) as demo:
|
|
113 |
minimum=256,
|
114 |
maximum=MAX_IMAGE_SIZE,
|
115 |
step=32,
|
116 |
-
value=1024,
|
117 |
)
|
118 |
|
119 |
with gr.Row():
|
@@ -122,7 +121,7 @@ with gr.Blocks(css=css) as demo:
|
|
122 |
minimum=0.0,
|
123 |
maximum=10.0,
|
124 |
step=0.1,
|
125 |
-
value=0.0,
|
126 |
)
|
127 |
|
128 |
num_inference_steps = gr.Slider(
|
@@ -130,7 +129,7 @@ with gr.Blocks(css=css) as demo:
|
|
130 |
minimum=1,
|
131 |
maximum=50,
|
132 |
step=1,
|
133 |
-
value=2,
|
134 |
)
|
135 |
|
136 |
gr.Examples(examples=examples, inputs=[prompt])
|
|
|
2 |
import numpy as np
|
3 |
import random
|
4 |
|
|
|
5 |
from diffusers import DiffusionPipeline
|
6 |
import torch
|
7 |
|
|
|
20 |
MAX_IMAGE_SIZE = 1024
|
21 |
|
22 |
|
23 |
+
|
24 |
def infer(
|
25 |
prompt,
|
26 |
negative_prompt,
|
|
|
65 |
|
66 |
with gr.Blocks(css=css) as demo:
|
67 |
with gr.Column(elem_id="col-container"):
|
68 |
+
gr.Markdown(" # Text-to-Image Using Gradio")
|
69 |
|
70 |
with gr.Row():
|
71 |
prompt = gr.Text(
|
|
|
104 |
minimum=256,
|
105 |
maximum=MAX_IMAGE_SIZE,
|
106 |
step=32,
|
107 |
+
value=1024,
|
108 |
)
|
109 |
|
110 |
height = gr.Slider(
|
|
|
112 |
minimum=256,
|
113 |
maximum=MAX_IMAGE_SIZE,
|
114 |
step=32,
|
115 |
+
value=1024,
|
116 |
)
|
117 |
|
118 |
with gr.Row():
|
|
|
121 |
minimum=0.0,
|
122 |
maximum=10.0,
|
123 |
step=0.1,
|
124 |
+
value=0.0,
|
125 |
)
|
126 |
|
127 |
num_inference_steps = gr.Slider(
|
|
|
129 |
minimum=1,
|
130 |
maximum=50,
|
131 |
step=1,
|
132 |
+
value=2,
|
133 |
)
|
134 |
|
135 |
gr.Examples(examples=examples, inputs=[prompt])
|