Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
#6
by
LPX55
- opened
app.py
CHANGED
@@ -367,8 +367,7 @@ with gr.Blocks(css=css, fill_height=True) as demo:
|
|
367 |
|
368 |
use_as_input_button.click(
|
369 |
fn=use_output_as_input, inputs=[result], outputs=[input_image]
|
370 |
-
)
|
371 |
-
run_button.click(
|
372 |
fn=clear_result,
|
373 |
inputs=None,
|
374 |
outputs=result,
|
@@ -379,7 +378,7 @@ with gr.Blocks(css=css, fill_height=True) as demo:
|
|
379 |
).then(
|
380 |
fn=lambda: gr.update(value="Loading Model...", visible=True), # Show loading message
|
381 |
inputs=None,
|
382 |
-
outputs=
|
383 |
).then(
|
384 |
fn=fill_image,
|
385 |
inputs=[prompt, input_image, model_selection, paste_back],
|
@@ -387,12 +386,12 @@ with gr.Blocks(css=css, fill_height=True) as demo:
|
|
387 |
).then(
|
388 |
fn=lambda: gr.update(value="Model Loaded", visible=True), # Show loaded message
|
389 |
inputs=None,
|
390 |
-
outputs=
|
391 |
queue=False
|
392 |
).then(
|
393 |
fn=lambda: gr.update(value="", visible=False), # Hide loading message
|
394 |
inputs=None,
|
395 |
-
outputs=
|
396 |
queue=False
|
397 |
).then(
|
398 |
fn=lambda: gr.update(visible=True),
|
@@ -410,7 +409,7 @@ with gr.Blocks(css=css, fill_height=True) as demo:
|
|
410 |
).then(
|
411 |
fn=lambda: gr.update(value="Loading Model...", visible=True), # Show loading message
|
412 |
inputs=None,
|
413 |
-
outputs=
|
414 |
).then(
|
415 |
fn=fill_image,
|
416 |
inputs=[prompt, input_image, model_selection, paste_back],
|
@@ -418,12 +417,12 @@ with gr.Blocks(css=css, fill_height=True) as demo:
|
|
418 |
).then(
|
419 |
fn=lambda: gr.update(value="Model Loaded", visible=True), # Show loaded message
|
420 |
inputs=None,
|
421 |
-
outputs=
|
422 |
queue=False
|
423 |
).then(
|
424 |
fn=lambda: gr.update(value="", visible=False), # Hide loading message
|
425 |
inputs=None,
|
426 |
-
outputs=
|
427 |
queue=False
|
428 |
).then(
|
429 |
fn=lambda: gr.update(visible=True),
|
@@ -563,7 +562,7 @@ with gr.Blocks(css=css, fill_height=True) as demo:
|
|
563 |
).then(
|
564 |
fn=lambda: gr.update(value="Loading Model...", visible=True), # Show loading message
|
565 |
inputs=None,
|
566 |
-
outputs=
|
567 |
).then(
|
568 |
fn=infer,
|
569 |
inputs=[input_image_outpaint, width_slider, height_slider, overlap_percentage, num_inference_steps,
|
@@ -573,7 +572,7 @@ with gr.Blocks(css=css, fill_height=True) as demo:
|
|
573 |
).then(
|
574 |
fn=lambda: gr.update(value="Model Loaded", visible=True), # Show loaded message
|
575 |
inputs=None,
|
576 |
-
outputs=
|
577 |
queue=False
|
578 |
).then(
|
579 |
fn=lambda x, history: update_history(x[1], history),
|
@@ -582,12 +581,12 @@ with gr.Blocks(css=css, fill_height=True) as demo:
|
|
582 |
).then(
|
583 |
fn=lambda: gr.update(value="", visible=False), # Hide loading message
|
584 |
inputs=None,
|
585 |
-
outputs=
|
586 |
queue=False
|
587 |
).then(
|
588 |
fn=lambda: gr.update(visible=True),
|
589 |
inputs=None,
|
590 |
-
outputs=
|
591 |
)
|
592 |
prompt_input.submit(
|
593 |
fn=clear_result,
|
@@ -596,7 +595,7 @@ with gr.Blocks(css=css, fill_height=True) as demo:
|
|
596 |
).then(
|
597 |
fn=lambda: gr.update(value="Loading Model...", visible=True), # Show loading message
|
598 |
inputs=None,
|
599 |
-
outputs=
|
600 |
).then(
|
601 |
fn=infer,
|
602 |
inputs=[input_image_outpaint, width_slider, height_slider, overlap_percentage, num_inference_steps,
|
@@ -606,7 +605,7 @@ with gr.Blocks(css=css, fill_height=True) as demo:
|
|
606 |
).then(
|
607 |
fn=lambda: gr.update(value="Model Loaded", visible=True), # Show loaded message
|
608 |
inputs=None,
|
609 |
-
outputs=
|
610 |
queue=False
|
611 |
).then(
|
612 |
fn=lambda x, history: update_history(x[1], history),
|
@@ -615,12 +614,12 @@ with gr.Blocks(css=css, fill_height=True) as demo:
|
|
615 |
).then(
|
616 |
fn=lambda: gr.update(value="", visible=False), # Hide loading message
|
617 |
inputs=None,
|
618 |
-
outputs=
|
619 |
queue=False
|
620 |
).then(
|
621 |
fn=lambda: gr.update(visible=True),
|
622 |
inputs=None,
|
623 |
-
outputs=
|
624 |
)
|
625 |
preview_button.click(
|
626 |
fn=preview_image_and_mask,
|
|
|
367 |
|
368 |
use_as_input_button.click(
|
369 |
fn=use_output_as_input, inputs=[result], outputs=[input_image]
|
370 |
+
)run_button.click(
|
|
|
371 |
fn=clear_result,
|
372 |
inputs=None,
|
373 |
outputs=result,
|
|
|
378 |
).then(
|
379 |
fn=lambda: gr.update(value="Loading Model...", visible=True), # Show loading message
|
380 |
inputs=None,
|
381 |
+
outputs=loading_message
|
382 |
).then(
|
383 |
fn=fill_image,
|
384 |
inputs=[prompt, input_image, model_selection, paste_back],
|
|
|
386 |
).then(
|
387 |
fn=lambda: gr.update(value="Model Loaded", visible=True), # Show loaded message
|
388 |
inputs=None,
|
389 |
+
outputs=loading_message,
|
390 |
queue=False
|
391 |
).then(
|
392 |
fn=lambda: gr.update(value="", visible=False), # Hide loading message
|
393 |
inputs=None,
|
394 |
+
outputs=loading_message,
|
395 |
queue=False
|
396 |
).then(
|
397 |
fn=lambda: gr.update(visible=True),
|
|
|
409 |
).then(
|
410 |
fn=lambda: gr.update(value="Loading Model...", visible=True), # Show loading message
|
411 |
inputs=None,
|
412 |
+
outputs=loading_message
|
413 |
).then(
|
414 |
fn=fill_image,
|
415 |
inputs=[prompt, input_image, model_selection, paste_back],
|
|
|
417 |
).then(
|
418 |
fn=lambda: gr.update(value="Model Loaded", visible=True), # Show loaded message
|
419 |
inputs=None,
|
420 |
+
outputs=loading_message,
|
421 |
queue=False
|
422 |
).then(
|
423 |
fn=lambda: gr.update(value="", visible=False), # Hide loading message
|
424 |
inputs=None,
|
425 |
+
outputs=loading_message,
|
426 |
queue=False
|
427 |
).then(
|
428 |
fn=lambda: gr.update(visible=True),
|
|
|
562 |
).then(
|
563 |
fn=lambda: gr.update(value="Loading Model...", visible=True), # Show loading message
|
564 |
inputs=None,
|
565 |
+
outputs=loading_message_outpaint
|
566 |
).then(
|
567 |
fn=infer,
|
568 |
inputs=[input_image_outpaint, width_slider, height_slider, overlap_percentage, num_inference_steps,
|
|
|
572 |
).then(
|
573 |
fn=lambda: gr.update(value="Model Loaded", visible=True), # Show loaded message
|
574 |
inputs=None,
|
575 |
+
outputs=loading_message_outpaint,
|
576 |
queue=False
|
577 |
).then(
|
578 |
fn=lambda x, history: update_history(x[1], history),
|
|
|
581 |
).then(
|
582 |
fn=lambda: gr.update(value="", visible=False), # Hide loading message
|
583 |
inputs=None,
|
584 |
+
outputs=loading_message_outpaint,
|
585 |
queue=False
|
586 |
).then(
|
587 |
fn=lambda: gr.update(visible=True),
|
588 |
inputs=None,
|
589 |
+
outputs=use_as_input_button_outpaint,
|
590 |
)
|
591 |
prompt_input.submit(
|
592 |
fn=clear_result,
|
|
|
595 |
).then(
|
596 |
fn=lambda: gr.update(value="Loading Model...", visible=True), # Show loading message
|
597 |
inputs=None,
|
598 |
+
outputs=loading_message_outpaint
|
599 |
).then(
|
600 |
fn=infer,
|
601 |
inputs=[input_image_outpaint, width_slider, height_slider, overlap_percentage, num_inference_steps,
|
|
|
605 |
).then(
|
606 |
fn=lambda: gr.update(value="Model Loaded", visible=True), # Show loaded message
|
607 |
inputs=None,
|
608 |
+
outputs=loading_message_outpaint,
|
609 |
queue=False
|
610 |
).then(
|
611 |
fn=lambda x, history: update_history(x[1], history),
|
|
|
614 |
).then(
|
615 |
fn=lambda: gr.update(value="", visible=False), # Hide loading message
|
616 |
inputs=None,
|
617 |
+
outputs=loading_message_outpaint,
|
618 |
queue=False
|
619 |
).then(
|
620 |
fn=lambda: gr.update(visible=True),
|
621 |
inputs=None,
|
622 |
+
outputs=use_as_input_button_outpaint,
|
623 |
)
|
624 |
preview_button.click(
|
625 |
fn=preview_image_and_mask,
|