Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -488,6 +488,9 @@ def batch_realesrgan(
|
|
| 488 |
yield gallery, str(zip_path), details, render_progress(100, "Complete")
|
| 489 |
|
| 490 |
|
|
|
|
|
|
|
|
|
|
| 491 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 492 |
# UI
|
| 493 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -541,7 +544,7 @@ def main():
|
|
| 541 |
)
|
| 542 |
reset_btn.click(fn=reset, inputs=[], outputs=[output_image, input_image])
|
| 543 |
|
| 544 |
-
|
| 545 |
gr.Markdown("### Batch Upscale")
|
| 546 |
with gr.Accordion("Batch options", open=True):
|
| 547 |
with gr.Row():
|
|
@@ -549,6 +552,7 @@ def main():
|
|
| 549 |
label="Upload multiple images (PNG/JPG/JPEG)",
|
| 550 |
type="filepath",
|
| 551 |
file_types=[".png", ".jpg", ".jpeg"],
|
|
|
|
| 552 |
)
|
| 553 |
with gr.Row():
|
| 554 |
batch_tile = gr.Number(label="Tile size (0/auto β 256)", value=256, precision=0)
|
|
@@ -568,17 +572,12 @@ def main():
|
|
| 568 |
inputs=[batch_files, model_name, denoise_strength, face_enhance, outscale, batch_tile, batch_size],
|
| 569 |
outputs=[batch_gallery, batch_zip, batch_details, batch_prog],
|
| 570 |
)
|
| 571 |
-
gr.Markdown("") # spacer
|
| 572 |
|
| 573 |
-
|
| 574 |
-
demo.launch(ssr_mode=False) # set share=True for a public link
|
| 575 |
|
|
|
|
| 576 |
|
| 577 |
-
def main():
|
| 578 |
-
with gr.Blocks(title="Real-ESRGAN Gradio Demo", theme="ParityError/Interstellar") as demo:
|
| 579 |
-
# ... your current UI (plus batch section) ...
|
| 580 |
-
return demo
|
| 581 |
|
| 582 |
if __name__ == "__main__":
|
| 583 |
demo = main()
|
| 584 |
-
demo.queue().launch(ssr_mode=False)
|
|
|
|
| 488 |
yield gallery, str(zip_path), details, render_progress(100, "Complete")
|
| 489 |
|
| 490 |
|
| 491 |
+
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 492 |
+
# UI
|
| 493 |
+
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 494 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 495 |
# UI
|
| 496 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 544 |
)
|
| 545 |
reset_btn.click(fn=reset, inputs=[], outputs=[output_image, input_image])
|
| 546 |
|
| 547 |
+
# --- Batch Upscale (multi-image) ---
|
| 548 |
gr.Markdown("### Batch Upscale")
|
| 549 |
with gr.Accordion("Batch options", open=True):
|
| 550 |
with gr.Row():
|
|
|
|
| 552 |
label="Upload multiple images (PNG/JPG/JPEG)",
|
| 553 |
type="filepath",
|
| 554 |
file_types=[".png", ".jpg", ".jpeg"],
|
| 555 |
+
# file_count="multiple" # optional: explicit in some versions
|
| 556 |
)
|
| 557 |
with gr.Row():
|
| 558 |
batch_tile = gr.Number(label="Tile size (0/auto β 256)", value=256, precision=0)
|
|
|
|
| 572 |
inputs=[batch_files, model_name, denoise_strength, face_enhance, outscale, batch_tile, batch_size],
|
| 573 |
outputs=[batch_gallery, batch_zip, batch_details, batch_prog],
|
| 574 |
)
|
|
|
|
| 575 |
|
| 576 |
+
gr.Markdown("") # spacer
|
|
|
|
| 577 |
|
| 578 |
+
return demo
|
| 579 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 580 |
|
| 581 |
if __name__ == "__main__":
|
| 582 |
demo = main()
|
| 583 |
+
demo.queue().launch(ssr_mode=False) # set share=True if you want a public link
|