Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,7 @@ def generate_image(prompt: str,negative_prompt:str , inference_steps: int = 25,
|
|
38 |
images = images.reshape((num_samples,) + images.shape[-3:])
|
39 |
images = pipeline.numpy_to_pil(images)
|
40 |
return images[0]
|
41 |
-
|
42 |
css = """
|
43 |
.gradio-container {
|
44 |
font-family: 'IBM Plex Sans', sans-serif;
|
@@ -239,7 +239,7 @@ with block:
|
|
239 |
label="Enter your negative prompt",
|
240 |
show_label=False,
|
241 |
max_lines=1,
|
242 |
-
placeholder="
|
243 |
elem_id="negative-prompt-text-input",
|
244 |
).style(
|
245 |
border=(True, False, True, True),
|
@@ -275,10 +275,11 @@ with block:
|
|
275 |
label="Guidance Scale", minimum=0, maximum=50, value=9, step=0.1
|
276 |
)
|
277 |
|
278 |
-
ex = gr.Examples(examples=
|
279 |
-
|
280 |
-
|
281 |
-
|
|
|
282 |
ex.dataset.headers = [""]
|
283 |
negative.submit(generate_image, inputs=[prompt_input, negative, inf_steps_input,seed_input,guidance_scale], outputs=[gallery], postprocess=False)
|
284 |
prompt_input.submit(generate_image, inputs=[prompt_input, negative, inf_steps_input,seed_input,guidance_scale], outputs=[gallery], postprocess=False)
|
@@ -303,7 +304,7 @@ with block:
|
|
303 |
gr.HTML(
|
304 |
"""
|
305 |
<div class="footer">
|
306 |
-
<p>Model by
|
307 |
</p>
|
308 |
</div>
|
309 |
"""
|
|
|
38 |
images = images.reshape((num_samples,) + images.shape[-3:])
|
39 |
images = pipeline.numpy_to_pil(images)
|
40 |
return images[0]
|
41 |
+
examples = [["A watercolor painting of a bird"],["A watercolor painting of an otter"],["Marvel MCU deadpool, red mask, red shirt, red gloves, black shoulders, black elbow pads, black legs, gold buckle, black belt, black mask, white eyes, black boots, fuji low light color 35mm film, downtown Osaka alley at night out of focus in background, neon lights","mountain"] ]
|
42 |
css = """
|
43 |
.gradio-container {
|
44 |
font-family: 'IBM Plex Sans', sans-serif;
|
|
|
239 |
label="Enter your negative prompt",
|
240 |
show_label=False,
|
241 |
max_lines=1,
|
242 |
+
placeholder="tree",
|
243 |
elem_id="negative-prompt-text-input",
|
244 |
).style(
|
245 |
border=(True, False, True, True),
|
|
|
275 |
label="Guidance Scale", minimum=0, maximum=50, value=9, step=0.1
|
276 |
)
|
277 |
|
278 |
+
ex = gr.Examples(examples=examples,
|
279 |
+
fn=generate_image,
|
280 |
+
inputs=[prompt_input, negative, inf_steps_input,seed_input,guidance_scale],
|
281 |
+
outputs=[gallery, community_icon, loading_icon, share_button],
|
282 |
+
cache_examples=False)
|
283 |
ex.dataset.headers = [""]
|
284 |
negative.submit(generate_image, inputs=[prompt_input, negative, inf_steps_input,seed_input,guidance_scale], outputs=[gallery], postprocess=False)
|
285 |
prompt_input.submit(generate_image, inputs=[prompt_input, negative, inf_steps_input,seed_input,guidance_scale], outputs=[gallery], postprocess=False)
|
|
|
304 |
gr.HTML(
|
305 |
"""
|
306 |
<div class="footer">
|
307 |
+
<p>Model by Stable Diffusion Nano Team
|
308 |
</p>
|
309 |
</div>
|
310 |
"""
|