Spaces:
Running on Zero
Running on Zero
downgradio 5.49.1 version
Browse files
app.py
CHANGED
|
@@ -427,7 +427,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 427 |
fn=use_output_as_input,
|
| 428 |
inputs=[result],
|
| 429 |
outputs=[input_image],
|
| 430 |
-
|
| 431 |
)
|
| 432 |
|
| 433 |
target_ratio.change(
|
|
@@ -435,7 +435,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 435 |
inputs=[target_ratio, width_slider, height_slider],
|
| 436 |
outputs=[width_slider, height_slider, settings_panel],
|
| 437 |
queue=False,
|
| 438 |
-
|
| 439 |
)
|
| 440 |
|
| 441 |
width_slider.change(
|
|
@@ -443,7 +443,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 443 |
inputs=[width_slider, height_slider],
|
| 444 |
outputs=[target_ratio],
|
| 445 |
queue=False,
|
| 446 |
-
|
| 447 |
)
|
| 448 |
|
| 449 |
height_slider.change(
|
|
@@ -451,7 +451,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 451 |
inputs=[width_slider, height_slider],
|
| 452 |
outputs=[target_ratio],
|
| 453 |
queue=False,
|
| 454 |
-
|
| 455 |
)
|
| 456 |
|
| 457 |
resize_option.change(
|
|
@@ -459,55 +459,54 @@ with gr.Blocks(css=css) as demo:
|
|
| 459 |
inputs=[resize_option],
|
| 460 |
outputs=[custom_resize_percentage],
|
| 461 |
queue=False,
|
| 462 |
-
|
| 463 |
)
|
| 464 |
|
| 465 |
run_button.click( # Clear the result
|
| 466 |
fn=clear_result,
|
| 467 |
inputs=None,
|
| 468 |
outputs=result,
|
| 469 |
-
|
| 470 |
).then( # Generate the new image
|
| 471 |
fn=infer,
|
| 472 |
inputs=[input_image, width_slider, height_slider, overlap_percentage, num_inference_steps,
|
| 473 |
resize_option, custom_resize_percentage, prompt_input, alignment_dropdown,
|
| 474 |
overlap_left, overlap_right, overlap_top, overlap_bottom],
|
| 475 |
outputs=result,
|
| 476 |
-
api_visibility="public",
|
| 477 |
).then( # Show the "Use as Input Image" button
|
| 478 |
fn=lambda: gr.update(visible=True),
|
| 479 |
inputs=None,
|
| 480 |
outputs=use_as_input_button,
|
| 481 |
-
|
| 482 |
).then( # Update the history gallery
|
| 483 |
fn=lambda x, history: update_history(x[1], history),
|
| 484 |
inputs=[result, history_gallery],
|
| 485 |
outputs=history_gallery,
|
| 486 |
-
|
| 487 |
)
|
| 488 |
|
| 489 |
prompt_input.submit( # Clear the result
|
| 490 |
fn=clear_result,
|
| 491 |
inputs=None,
|
| 492 |
outputs=result,
|
| 493 |
-
|
| 494 |
).then( # Generate the new image
|
| 495 |
fn=infer,
|
| 496 |
inputs=[input_image, width_slider, height_slider, overlap_percentage, num_inference_steps,
|
| 497 |
resize_option, custom_resize_percentage, prompt_input, alignment_dropdown,
|
| 498 |
overlap_left, overlap_right, overlap_top, overlap_bottom],
|
| 499 |
outputs=result,
|
| 500 |
-
|
| 501 |
).then( # Update the history gallery
|
| 502 |
fn=lambda x, history: update_history(x[1], history),
|
| 503 |
inputs=[result, history_gallery],
|
| 504 |
outputs=history_gallery,
|
| 505 |
-
|
| 506 |
).then( # Show the "Use as Input Image" button
|
| 507 |
fn=lambda: gr.update(visible=True),
|
| 508 |
inputs=None,
|
| 509 |
outputs=use_as_input_button,
|
| 510 |
-
|
| 511 |
)
|
| 512 |
|
| 513 |
preview_button.click(
|
|
@@ -516,7 +515,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 516 |
overlap_left, overlap_right, overlap_top, overlap_bottom],
|
| 517 |
outputs=preview_image,
|
| 518 |
queue=False,
|
| 519 |
-
|
| 520 |
)
|
| 521 |
|
| 522 |
-
demo.queue(max_size=12).launch(share=
|
|
|
|
| 427 |
fn=use_output_as_input,
|
| 428 |
inputs=[result],
|
| 429 |
outputs=[input_image],
|
| 430 |
+
show_api=False
|
| 431 |
)
|
| 432 |
|
| 433 |
target_ratio.change(
|
|
|
|
| 435 |
inputs=[target_ratio, width_slider, height_slider],
|
| 436 |
outputs=[width_slider, height_slider, settings_panel],
|
| 437 |
queue=False,
|
| 438 |
+
show_api=False
|
| 439 |
)
|
| 440 |
|
| 441 |
width_slider.change(
|
|
|
|
| 443 |
inputs=[width_slider, height_slider],
|
| 444 |
outputs=[target_ratio],
|
| 445 |
queue=False,
|
| 446 |
+
show_api=False
|
| 447 |
)
|
| 448 |
|
| 449 |
height_slider.change(
|
|
|
|
| 451 |
inputs=[width_slider, height_slider],
|
| 452 |
outputs=[target_ratio],
|
| 453 |
queue=False,
|
| 454 |
+
show_api=False
|
| 455 |
)
|
| 456 |
|
| 457 |
resize_option.change(
|
|
|
|
| 459 |
inputs=[resize_option],
|
| 460 |
outputs=[custom_resize_percentage],
|
| 461 |
queue=False,
|
| 462 |
+
show_api=False
|
| 463 |
)
|
| 464 |
|
| 465 |
run_button.click( # Clear the result
|
| 466 |
fn=clear_result,
|
| 467 |
inputs=None,
|
| 468 |
outputs=result,
|
| 469 |
+
show_api=False
|
| 470 |
).then( # Generate the new image
|
| 471 |
fn=infer,
|
| 472 |
inputs=[input_image, width_slider, height_slider, overlap_percentage, num_inference_steps,
|
| 473 |
resize_option, custom_resize_percentage, prompt_input, alignment_dropdown,
|
| 474 |
overlap_left, overlap_right, overlap_top, overlap_bottom],
|
| 475 |
outputs=result,
|
|
|
|
| 476 |
).then( # Show the "Use as Input Image" button
|
| 477 |
fn=lambda: gr.update(visible=True),
|
| 478 |
inputs=None,
|
| 479 |
outputs=use_as_input_button,
|
| 480 |
+
show_api=False
|
| 481 |
).then( # Update the history gallery
|
| 482 |
fn=lambda x, history: update_history(x[1], history),
|
| 483 |
inputs=[result, history_gallery],
|
| 484 |
outputs=history_gallery,
|
| 485 |
+
show_api=False
|
| 486 |
)
|
| 487 |
|
| 488 |
prompt_input.submit( # Clear the result
|
| 489 |
fn=clear_result,
|
| 490 |
inputs=None,
|
| 491 |
outputs=result,
|
| 492 |
+
show_api=False
|
| 493 |
).then( # Generate the new image
|
| 494 |
fn=infer,
|
| 495 |
inputs=[input_image, width_slider, height_slider, overlap_percentage, num_inference_steps,
|
| 496 |
resize_option, custom_resize_percentage, prompt_input, alignment_dropdown,
|
| 497 |
overlap_left, overlap_right, overlap_top, overlap_bottom],
|
| 498 |
outputs=result,
|
| 499 |
+
show_api=False
|
| 500 |
).then( # Update the history gallery
|
| 501 |
fn=lambda x, history: update_history(x[1], history),
|
| 502 |
inputs=[result, history_gallery],
|
| 503 |
outputs=history_gallery,
|
| 504 |
+
show_api=False
|
| 505 |
).then( # Show the "Use as Input Image" button
|
| 506 |
fn=lambda: gr.update(visible=True),
|
| 507 |
inputs=None,
|
| 508 |
outputs=use_as_input_button,
|
| 509 |
+
show_api=False
|
| 510 |
)
|
| 511 |
|
| 512 |
preview_button.click(
|
|
|
|
| 515 |
overlap_left, overlap_right, overlap_top, overlap_bottom],
|
| 516 |
outputs=preview_image,
|
| 517 |
queue=False,
|
| 518 |
+
show_api=False
|
| 519 |
)
|
| 520 |
|
| 521 |
+
demo.queue(max_size=12).launch(share=False, show_error=True, mcp_server=True)
|