Spaces:
Running
Running
charliebaby2023
commited on
Commit
•
8eff0b6
1
Parent(s):
9fda69c
Update app.py
Browse files
app.py
CHANGED
@@ -51,6 +51,7 @@ def make_me():
|
|
51 |
|
52 |
gen_button = gr.Button('Generate images', width=150, height=30)
|
53 |
stop_button = gr.Button('Stop', variant='secondary', interactive=False, width=150, height=30)
|
|
|
54 |
gen_button.click(lambda s: gr.update(interactive=True), None, stop_button)
|
55 |
gr.HTML("""
|
56 |
<div style="text-align: center; max-width: 100%; margin: 0 auto;">
|
@@ -59,7 +60,7 @@ def make_me():
|
|
59 |
</div>
|
60 |
""")
|
61 |
with gr.Row():
|
62 |
-
output = [gr.Image(label=m,
|
63 |
current_models = [gr.Textbox(m, visible=False) for m in default_models]
|
64 |
for m, o in zip(current_models, output):
|
65 |
gen_event = gen_button.click(gen_fn, [m, txt_input], o)
|
@@ -78,18 +79,26 @@ def make_me():
|
|
78 |
|
79 |
|
80 |
js_code = """
|
81 |
-
|
82 |
-
|
83 |
-
console.log('ghgh');
|
84 |
|
85 |
"""
|
86 |
|
87 |
|
88 |
-
|
|
|
|
|
|
|
|
|
|
|
89 |
gr.Markdown("<script>" + js_code + "</script>")
|
90 |
make_me()
|
91 |
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
|
94 |
-
demo.queue(concurrency_count=200)
|
95 |
-
demo.launch()
|
|
|
51 |
|
52 |
gen_button = gr.Button('Generate images', width=150, height=30)
|
53 |
stop_button = gr.Button('Stop', variant='secondary', interactive=False, width=150, height=30)
|
54 |
+
|
55 |
gen_button.click(lambda s: gr.update(interactive=True), None, stop_button)
|
56 |
gr.HTML("""
|
57 |
<div style="text-align: center; max-width: 100%; margin: 0 auto;">
|
|
|
60 |
</div>
|
61 |
""")
|
62 |
with gr.Row():
|
63 |
+
output = [gr.Image(label=m, height=170) for m in default_models]
|
64 |
current_models = [gr.Textbox(m, visible=False) for m in default_models]
|
65 |
for m, o in zip(current_models, output):
|
66 |
gen_event = gen_button.click(gen_fn, [m, txt_input], o)
|
|
|
79 |
|
80 |
|
81 |
js_code = """
|
82 |
+
console.log('testing js_code');
|
|
|
|
|
83 |
|
84 |
"""
|
85 |
|
86 |
|
87 |
+
|
88 |
+
with gr.Blocks(css="""
|
89 |
+
.genbut { max-width: 50px; max-height: 30px; }
|
90 |
+
.stopbut { max-width: 50px; max-height: 30px; }
|
91 |
+
.float.svelte-1mwvhlq { position: absolute; top: var(--block-label-margin); left: var(--block-label-margin); background: none; border: none;}
|
92 |
+
""") as demo:
|
93 |
gr.Markdown("<script>" + js_code + "</script>")
|
94 |
make_me()
|
95 |
|
96 |
+
demo.queue()
|
97 |
+
demo.launch(max_threads=100)
|
98 |
+
|
99 |
+
|
100 |
+
|
101 |
|
102 |
|
103 |
+
#demo.queue(concurrency_count=200)
|
104 |
+
#demo.launch()
|