Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -564,9 +564,9 @@ def draw(state, drawpad):
|
|
| 564 |
# mask_stds = [0] + [state.mask_stds[v] for v in has_masks]
|
| 565 |
|
| 566 |
model.update_masks(
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
)
|
| 571 |
# for i in range(len(has_masks)):
|
| 572 |
# model.update(
|
|
@@ -627,6 +627,20 @@ css = f"""
|
|
| 627 |
width: 100%;
|
| 628 |
aspect-ratio: {opt.width} / {opt.height};
|
| 629 |
}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 630 |
"""
|
| 631 |
|
| 632 |
for i in range(opt.max_palettes + 1):
|
|
@@ -908,6 +922,19 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css, head=head) as demo:
|
|
| 908 |
elem_id='output-screen',
|
| 909 |
value=lambda: random.choice(example_images),
|
| 910 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 911 |
|
| 912 |
iface.btn_generate = gr.Button(
|
| 913 |
value=f'Lemme try! ({int(opt.run_time // 60)} min)',
|
|
@@ -1378,6 +1405,8 @@ async () => {{
|
|
| 1378 |
api_name='draw',
|
| 1379 |
)
|
| 1380 |
|
|
|
|
|
|
|
| 1381 |
|
| 1382 |
|
| 1383 |
if __name__ == '__main__':
|
|
|
|
| 564 |
# mask_stds = [0] + [state.mask_stds[v] for v in has_masks]
|
| 565 |
|
| 566 |
model.update_masks(
|
| 567 |
+
masks=masks,
|
| 568 |
+
mask_strengths=mask_strengths,
|
| 569 |
+
mask_stds=mask_stds,
|
| 570 |
)
|
| 571 |
# for i in range(len(has_masks)):
|
| 572 |
# model.update(
|
|
|
|
| 627 |
width: 100%;
|
| 628 |
aspect-ratio: {opt.width} / {opt.height};
|
| 629 |
}}
|
| 630 |
+
|
| 631 |
+
#share-btn {{
|
| 632 |
+
color: #ffffff;font-weight: 600;
|
| 633 |
+
background-color: #000000;
|
| 634 |
+
font-family: 'IBM Plex Sans', sans-serif;
|
| 635 |
+
border-radius: 9999px !important;
|
| 636 |
+
}}
|
| 637 |
+
#share-btn:hover {{
|
| 638 |
+
color: #ffffff;font-weight: 600;
|
| 639 |
+
background-color: #000000;
|
| 640 |
+
font-family: 'IBM Plex Sans', sans-serif;
|
| 641 |
+
border-radius: 9999px !important;
|
| 642 |
+
box-shadow: 0 0 20px #eee;
|
| 643 |
+
}}
|
| 644 |
"""
|
| 645 |
|
| 646 |
for i in range(opt.max_palettes + 1):
|
|
|
|
| 922 |
elem_id='output-screen',
|
| 923 |
value=lambda: random.choice(example_images),
|
| 924 |
)
|
| 925 |
+
|
| 926 |
+
with gr.Accordion(label='History', open=False):
|
| 927 |
+
iface.history = gr.Gallery(
|
| 928 |
+
label="My creation",
|
| 929 |
+
elem_id='output-history',
|
| 930 |
+
object_fit='contain',
|
| 931 |
+
columns=3,
|
| 932 |
+
height='auto',
|
| 933 |
+
preview=True,
|
| 934 |
+
interactive=False,
|
| 935 |
+
visible=False,
|
| 936 |
+
)
|
| 937 |
+
iface.btn_share = gr.Button('🤗 Share with Community', elem_id='share-btn')
|
| 938 |
|
| 939 |
iface.btn_generate = gr.Button(
|
| 940 |
value=f'Lemme try! ({int(opt.run_time // 60)} min)',
|
|
|
|
| 1405 |
api_name='draw',
|
| 1406 |
)
|
| 1407 |
|
| 1408 |
+
# iface.btn_share.click(None, [], [], js=share_js)
|
| 1409 |
+
|
| 1410 |
|
| 1411 |
|
| 1412 |
if __name__ == '__main__':
|