Update app.py
Browse files
app.py
CHANGED
|
@@ -38,9 +38,8 @@ def parse_input(image, sketchpad, state):
|
|
| 38 |
def tabs_select(e: gr.SelectData, _state):
|
| 39 |
_state["tab_index"] = e.index
|
| 40 |
|
| 41 |
-
example_img_path = "https://
|
| 42 |
-
|
| 43 |
-
return example_img_path
|
| 44 |
|
| 45 |
with gr.Blocks() as iface:
|
| 46 |
gr.HTML("""<p align="center"><img src="https://cdn-icons-png.flaticon.com/512/5853/5853758.png" style="height: 60px"/><p>""")
|
|
@@ -59,8 +58,15 @@ with gr.Blocks() as iface:
|
|
| 59 |
input_tabs.select(fn=tabs_select, inputs=[state])
|
| 60 |
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
with gr.Row():
|
| 66 |
with gr.Column():
|
|
@@ -72,7 +78,7 @@ with gr.Blocks() as iface:
|
|
| 72 |
fn=parse_input,
|
| 73 |
inputs=[input_image, input_sketchpad, state],
|
| 74 |
outputs= gr.Textbox(label = "Result"))
|
| 75 |
-
|
| 76 |
# Launch the interface
|
| 77 |
if __name__ == "__main__":
|
| 78 |
iface.launch()
|
|
|
|
| 38 |
def tabs_select(e: gr.SelectData, _state):
|
| 39 |
_state["tab_index"] = e.index
|
| 40 |
|
| 41 |
+
example_img_path = "https://4.img-dpreview.com/files/p/E~TS590x0~articles/3925134721/0266554465.jpeg"
|
| 42 |
+
|
|
|
|
| 43 |
|
| 44 |
with gr.Blocks() as iface:
|
| 45 |
gr.HTML("""<p align="center"><img src="https://cdn-icons-png.flaticon.com/512/5853/5853758.png" style="height: 60px"/><p>""")
|
|
|
|
| 58 |
input_tabs.select(fn=tabs_select, inputs=[state])
|
| 59 |
|
| 60 |
|
| 61 |
+
|
| 62 |
+
with gr.Row(elem_id="examples_row"):
|
| 63 |
+
with gr.Column(elem_id="examples_container"):
|
| 64 |
+
gr.Markdown("### Example Prompts")
|
| 65 |
+
gr.Examples(
|
| 66 |
+
[example_img_path],
|
| 67 |
+
inputs=[input_image],
|
| 68 |
+
cache_examples=False
|
| 69 |
+
)
|
| 70 |
|
| 71 |
with gr.Row():
|
| 72 |
with gr.Column():
|
|
|
|
| 78 |
fn=parse_input,
|
| 79 |
inputs=[input_image, input_sketchpad, state],
|
| 80 |
outputs= gr.Textbox(label = "Result"))
|
| 81 |
+
|
| 82 |
# Launch the interface
|
| 83 |
if __name__ == "__main__":
|
| 84 |
iface.launch()
|