Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
b028a73
1
Parent(s):
67a9c3e
Improve share button UI
Browse files
app.py
CHANGED
|
@@ -390,6 +390,8 @@ css = """
|
|
| 390 |
}
|
| 391 |
#share-btn-container {
|
| 392 |
display: flex; padding-left: 0.5rem !important; padding-right: 0.5rem !important; background-color: #000000; justify-content: center; align-items: center; border-radius: 9999px !important; width: 13rem;
|
|
|
|
|
|
|
| 393 |
}
|
| 394 |
#share-btn {
|
| 395 |
all: initial; color: #ffffff;font-weight: 600; cursor:pointer; font-family: 'IBM Plex Sans', sans-serif; margin-left: 0.5rem !important; padding-top: 0.25rem !important; padding-bottom: 0.25rem !important;right:0;
|
|
@@ -410,6 +412,7 @@ css = """
|
|
| 410 |
#prompt-container{
|
| 411 |
gap: 0;
|
| 412 |
}
|
|
|
|
| 413 |
"""
|
| 414 |
|
| 415 |
block = gr.Blocks(css=css)
|
|
@@ -538,11 +541,7 @@ with block:
|
|
| 538 |
label="Generated images", show_label=False, elem_id="gallery"
|
| 539 |
).style(grid=[2], height="auto")
|
| 540 |
|
| 541 |
-
|
| 542 |
-
with gr.Group(elem_id="share-btn-container"):
|
| 543 |
-
community_icon = gr.HTML(community_icon_html)
|
| 544 |
-
loading_icon = gr.HTML(loading_icon_html)
|
| 545 |
-
share_button = gr.Button("Share to community", elem_id="share-btn")
|
| 546 |
|
| 547 |
with gr.Accordion("Custom options", open=False):
|
| 548 |
samples = gr.Slider(label="Images", minimum=1, maximum=4, value=4, step=1)
|
|
@@ -558,6 +557,12 @@ with block:
|
|
| 558 |
randomize=True,
|
| 559 |
)
|
| 560 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 561 |
ex = gr.Examples(examples=examples, fn=infer, inputs=[text, samples, steps, scale, seed], outputs=[gallery, community_icon, loading_icon, share_button], cache_examples=False)
|
| 562 |
ex.dataset.headers = [""]
|
| 563 |
|
|
|
|
| 390 |
}
|
| 391 |
#share-btn-container {
|
| 392 |
display: flex; padding-left: 0.5rem !important; padding-right: 0.5rem !important; background-color: #000000; justify-content: center; align-items: center; border-radius: 9999px !important; width: 13rem;
|
| 393 |
+
margin-top: 10px;
|
| 394 |
+
margin-left: auto;
|
| 395 |
}
|
| 396 |
#share-btn {
|
| 397 |
all: initial; color: #ffffff;font-weight: 600; cursor:pointer; font-family: 'IBM Plex Sans', sans-serif; margin-left: 0.5rem !important; padding-top: 0.25rem !important; padding-bottom: 0.25rem !important;right:0;
|
|
|
|
| 412 |
#prompt-container{
|
| 413 |
gap: 0;
|
| 414 |
}
|
| 415 |
+
#component-14{border-top-width: 1px !important}
|
| 416 |
"""
|
| 417 |
|
| 418 |
block = gr.Blocks(css=css)
|
|
|
|
| 541 |
label="Generated images", show_label=False, elem_id="gallery"
|
| 542 |
).style(grid=[2], height="auto")
|
| 543 |
|
| 544 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 545 |
|
| 546 |
with gr.Accordion("Custom options", open=False):
|
| 547 |
samples = gr.Slider(label="Images", minimum=1, maximum=4, value=4, step=1)
|
|
|
|
| 557 |
randomize=True,
|
| 558 |
)
|
| 559 |
|
| 560 |
+
with gr.Group():
|
| 561 |
+
with gr.Group(elem_id="share-btn-container"):
|
| 562 |
+
community_icon = gr.HTML(community_icon_html)
|
| 563 |
+
loading_icon = gr.HTML(loading_icon_html)
|
| 564 |
+
share_button = gr.Button("Share to community", elem_id="share-btn")
|
| 565 |
+
|
| 566 |
ex = gr.Examples(examples=examples, fn=infer, inputs=[text, samples, steps, scale, seed], outputs=[gallery, community_icon, loading_icon, share_button], cache_examples=False)
|
| 567 |
ex.dataset.headers = [""]
|
| 568 |
|