Update app.py
Browse files
app.py
CHANGED
@@ -176,7 +176,7 @@ with gr.Blocks(css=css,head=js,fill_height=True) as demo:
|
|
176 |
with gr.Group():
|
177 |
result = gr.Gallery(value=[cfg.get("cover_path","")],
|
178 |
label="Result", show_label=False, columns=1, rows=1, show_share_button=True,
|
179 |
-
show_download_button=True,allow_preview=True,interactive=False, min_width=cfg.get("window_min_width", 340)
|
180 |
)
|
181 |
with gr.Row():
|
182 |
prompt = gr.Text(
|
@@ -192,8 +192,8 @@ with gr.Blocks(css=css,head=js,fill_height=True) as demo:
|
|
192 |
run_button = gr.Button( "GO!", scale=1, min_width=20)
|
193 |
|
194 |
random_button.click(fn=lambda x:x, inputs=[prompt], outputs=[prompt], js='''()=>window.g()''')
|
195 |
-
run_button.click(generate, inputs=[prompt], outputs=[result]
|
196 |
result.change(fn=lambda x:x, inputs=[prompt,result], outputs=[], js=f'''(p,img)=>window.uploadImage(p, img,"process_finished","demo_hf_{cfg.get("name")}_card", "finish")''')
|
197 |
|
198 |
if __name__ == "__main__":
|
199 |
-
demo.launch(show_api=False
|
|
|
176 |
with gr.Group():
|
177 |
result = gr.Gallery(value=[cfg.get("cover_path","")],
|
178 |
label="Result", show_label=False, columns=1, rows=1, show_share_button=True,
|
179 |
+
show_download_button=True,allow_preview=True,interactive=False, min_width=cfg.get("window_min_width", 340),height=400
|
180 |
)
|
181 |
with gr.Row():
|
182 |
prompt = gr.Text(
|
|
|
192 |
run_button = gr.Button( "GO!", scale=1, min_width=20)
|
193 |
|
194 |
random_button.click(fn=lambda x:x, inputs=[prompt], outputs=[prompt], js='''()=>window.g()''')
|
195 |
+
run_button.click(generate, inputs=[prompt], outputs=[result], js=f'''(p)=>window.postMessageToParent(p,"process_started","demo_hf_{cfg.get("name")}_card", "click_go")''')
|
196 |
result.change(fn=lambda x:x, inputs=[prompt,result], outputs=[], js=f'''(p,img)=>window.uploadImage(p, img,"process_finished","demo_hf_{cfg.get("name")}_card", "finish")''')
|
197 |
|
198 |
if __name__ == "__main__":
|
199 |
+
demo.queue().launch(show_api=False)
|