Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,6 +38,7 @@ from huggingface_hub import snapshot_download
|
|
| 38 |
|
| 39 |
from model import StableMultiDiffusionPipeline
|
| 40 |
from util import seed_everything
|
|
|
|
| 41 |
|
| 42 |
|
| 43 |
### Utils
|
|
@@ -430,6 +431,21 @@ css = f"""
|
|
| 430 |
.layer-wrap {{
|
| 431 |
display: none;
|
| 432 |
}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 433 |
"""
|
| 434 |
|
| 435 |
for i in range(opt.max_palettes + 1):
|
|
@@ -663,6 +679,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
|
| 663 |
# scale=1,
|
| 664 |
elem_id='run-button'
|
| 665 |
)
|
|
|
|
| 666 |
|
| 667 |
iface.model_select = gr.Radio(
|
| 668 |
list(model_dict.keys()),
|
|
@@ -815,6 +832,8 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
|
| 815 |
api_name='model_select',
|
| 816 |
)
|
| 817 |
|
|
|
|
|
|
|
| 818 |
iface.btn_export_state.click(lambda x: vars(x), state, iface.json_state_export)
|
| 819 |
iface.btn_import_state.click(import_state, [state, iface.tbox_state_import], [
|
| 820 |
state,
|
|
|
|
| 38 |
|
| 39 |
from model import StableMultiDiffusionPipeline
|
| 40 |
from util import seed_everything
|
| 41 |
+
from share_btn import share_js
|
| 42 |
|
| 43 |
|
| 44 |
### Utils
|
|
|
|
| 431 |
.layer-wrap {{
|
| 432 |
display: none;
|
| 433 |
}}
|
| 434 |
+
|
| 435 |
+
#share-btn {{
|
| 436 |
+
color: #ffffff;font-weight: 600;
|
| 437 |
+
background-color: #000000;
|
| 438 |
+
font-family: 'IBM Plex Sans', sans-serif;
|
| 439 |
+
border-radius: 9999px !important;
|
| 440 |
+
}}
|
| 441 |
+
|
| 442 |
+
#share-btn:hover {{
|
| 443 |
+
color: #ffffff;font-weight: 600;
|
| 444 |
+
background-color: #000000;
|
| 445 |
+
font-family: 'IBM Plex Sans', sans-serif;
|
| 446 |
+
border-radius: 9999px !important;
|
| 447 |
+
box-shadow: 0 0 20px #eee;
|
| 448 |
+
}}
|
| 449 |
"""
|
| 450 |
|
| 451 |
for i in range(opt.max_palettes + 1):
|
|
|
|
| 679 |
# scale=1,
|
| 680 |
elem_id='run-button'
|
| 681 |
)
|
| 682 |
+
iface.btn_share = gr.Button('🤗 Share with Community', elem_id='share-btn')
|
| 683 |
|
| 684 |
iface.model_select = gr.Radio(
|
| 685 |
list(model_dict.keys()),
|
|
|
|
| 832 |
api_name='model_select',
|
| 833 |
)
|
| 834 |
|
| 835 |
+
iface.btn_share.click(None, [], [], js=share_js)
|
| 836 |
+
|
| 837 |
iface.btn_export_state.click(lambda x: vars(x), state, iface.json_state_export)
|
| 838 |
iface.btn_import_state.click(import_state, [state, iface.tbox_state_import], [
|
| 839 |
state,
|