Update app.py
Browse files
app.py
CHANGED
@@ -135,9 +135,7 @@ css = """
|
|
135 |
background: #0b0f19;
|
136 |
}
|
137 |
.acknowledgments h4{
|
138 |
-
margin
|
139 |
-
margin-top: 35px;
|
140 |
-
text-align: center;
|
141 |
font-weight: bold;
|
142 |
font-size: 115%;
|
143 |
}
|
@@ -193,6 +191,39 @@ with block as demo:
|
|
193 |
font-size: 1.75rem;
|
194 |
"
|
195 |
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
<h1 style="font-weight: 900; margin-bottom: 7px;margin-top:5px">
|
197 |
Stable Diffusion Nano Demo
|
198 |
</h1>
|
@@ -205,7 +236,7 @@ with block as demo:
|
|
205 |
)
|
206 |
with gr.Group():
|
207 |
with gr.Box():
|
208 |
-
with gr.Row():
|
209 |
with gr.Column():
|
210 |
prompt_input = gr.Textbox(
|
211 |
label="Enter your prompt",
|
@@ -223,7 +254,7 @@ with block as demo:
|
|
223 |
|
224 |
gallery = gr.Gallery(
|
225 |
label="Generated images", show_label=False, elem_id="gallery"
|
226 |
-
).style(
|
227 |
|
228 |
with gr.Group(elem_id="container-advanced-btns"):
|
229 |
# advanced_button = gr.Button("Advanced options", elem_id="advanced-btn")
|
@@ -240,16 +271,17 @@ with block as demo:
|
|
240 |
inf_steps_input = gr.inputs.Slider(
|
241 |
minimum=1, maximum=100, default=25, step=1, label="Inference Steps"
|
242 |
)
|
|
|
243 |
guidance_scale = gr.Slider(
|
244 |
label="Guidance Scale", minimum=0, maximum=50, value=9, step=0.1
|
245 |
)
|
246 |
-
seed_input = gr.inputs.Number(default=0, label="Seed")
|
247 |
|
248 |
ex = gr.Examples(examples=examples,
|
249 |
fn=generate_image,
|
250 |
inputs=[prompt_input, negative,
|
251 |
inf_steps_input, seed_input, guidance_scale],
|
252 |
-
outputs=[gallery, community_icon,
|
|
|
253 |
cache_examples=False)
|
254 |
ex.dataset.headers = [""]
|
255 |
negative.submit(generate_image, inputs=[
|
|
|
135 |
background: #0b0f19;
|
136 |
}
|
137 |
.acknowledgments h4{
|
138 |
+
margin: 1.25em 0 .25em 0;
|
|
|
|
|
139 |
font-weight: bold;
|
140 |
font-size: 115%;
|
141 |
}
|
|
|
191 |
font-size: 1.75rem;
|
192 |
"
|
193 |
>
|
194 |
+
<svg
|
195 |
+
width="0.65em"
|
196 |
+
height="0.65em"
|
197 |
+
viewBox="0 0 115 115"
|
198 |
+
fill="none"
|
199 |
+
xmlns="http://www.w3.org/2000/svg"
|
200 |
+
>
|
201 |
+
<rect width="23" height="23" fill="white"></rect>
|
202 |
+
<rect y="69" width="23" height="23" fill="white"></rect>
|
203 |
+
<rect x="23" width="23" height="23" fill="#AEAEAE"></rect>
|
204 |
+
<rect x="23" y="69" width="23" height="23" fill="#AEAEAE"></rect>
|
205 |
+
<rect x="46" width="23" height="23" fill="white"></rect>
|
206 |
+
<rect x="46" y="69" width="23" height="23" fill="white"></rect>
|
207 |
+
<rect x="69" width="23" height="23" fill="black"></rect>
|
208 |
+
<rect x="69" y="69" width="23" height="23" fill="black"></rect>
|
209 |
+
<rect x="92" width="23" height="23" fill="#D9D9D9"></rect>
|
210 |
+
<rect x="92" y="69" width="23" height="23" fill="#AEAEAE"></rect>
|
211 |
+
<rect x="115" y="46" width="23" height="23" fill="white"></rect>
|
212 |
+
<rect x="115" y="115" width="23" height="23" fill="white"></rect>
|
213 |
+
<rect x="115" y="69" width="23" height="23" fill="#D9D9D9"></rect>
|
214 |
+
<rect x="92" y="46" width="23" height="23" fill="#AEAEAE"></rect>
|
215 |
+
<rect x="92" y="115" width="23" height="23" fill="#AEAEAE"></rect>
|
216 |
+
<rect x="92" y="69" width="23" height="23" fill="white"></rect>
|
217 |
+
<rect x="69" y="46" width="23" height="23" fill="white"></rect>
|
218 |
+
<rect x="69" y="115" width="23" height="23" fill="white"></rect>
|
219 |
+
<rect x="69" y="69" width="23" height="23" fill="#D9D9D9"></rect>
|
220 |
+
<rect x="46" y="46" width="23" height="23" fill="black"></rect>
|
221 |
+
<rect x="46" y="115" width="23" height="23" fill="black"></rect>
|
222 |
+
<rect x="46" y="69" width="23" height="23" fill="black"></rect>
|
223 |
+
<rect x="23" y="46" width="23" height="23" fill="#D9D9D9"></rect>
|
224 |
+
<rect x="23" y="115" width="23" height="23" fill="#AEAEAE"></rect>
|
225 |
+
<rect x="23" y="69" width="23" height="23" fill="black"></rect>
|
226 |
+
</svg>
|
227 |
<h1 style="font-weight: 900; margin-bottom: 7px;margin-top:5px">
|
228 |
Stable Diffusion Nano Demo
|
229 |
</h1>
|
|
|
236 |
)
|
237 |
with gr.Group():
|
238 |
with gr.Box():
|
239 |
+
with gr.Row(elem_id="prompt-container").style(equal_height=True):
|
240 |
with gr.Column():
|
241 |
prompt_input = gr.Textbox(
|
242 |
label="Enter your prompt",
|
|
|
254 |
|
255 |
gallery = gr.Gallery(
|
256 |
label="Generated images", show_label=False, elem_id="gallery"
|
257 |
+
).style(grid=[2], height="auto")
|
258 |
|
259 |
with gr.Group(elem_id="container-advanced-btns"):
|
260 |
# advanced_button = gr.Button("Advanced options", elem_id="advanced-btn")
|
|
|
271 |
inf_steps_input = gr.inputs.Slider(
|
272 |
minimum=1, maximum=100, default=25, step=1, label="Inference Steps"
|
273 |
)
|
274 |
+
seed_input = gr.inputs.Number(default=0, label="Seed")
|
275 |
guidance_scale = gr.Slider(
|
276 |
label="Guidance Scale", minimum=0, maximum=50, value=9, step=0.1
|
277 |
)
|
|
|
278 |
|
279 |
ex = gr.Examples(examples=examples,
|
280 |
fn=generate_image,
|
281 |
inputs=[prompt_input, negative,
|
282 |
inf_steps_input, seed_input, guidance_scale],
|
283 |
+
outputs=[gallery, community_icon,
|
284 |
+
loading_icon, share_button],
|
285 |
cache_examples=False)
|
286 |
ex.dataset.headers = [""]
|
287 |
negative.submit(generate_image, inputs=[
|