Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,6 @@ import numpy as np
|
|
| 14 |
# from sam2_mask import create_sam2_tab
|
| 15 |
import subprocess
|
| 16 |
import os
|
| 17 |
-
# import sam2_mask
|
| 18 |
|
| 19 |
subprocess.run("rm -rf /data-nvme/zerogpu-offload/*", env={}, shell=True)
|
| 20 |
HF_TOKEN = os.environ["HF_TOKEN"]
|
|
@@ -415,6 +414,7 @@ title = """<h1 align="center">Diffusers Image Outpaint</h1>
|
|
| 415 |
</p>
|
| 416 |
</div>
|
| 417 |
"""
|
|
|
|
| 418 |
|
| 419 |
with gr.Blocks(css=css, fill_height=True) as demo:
|
| 420 |
gr.Markdown("# Diffusers Inpaint and Outpaint")
|
|
@@ -492,7 +492,10 @@ with gr.Blocks(css=css, fill_height=True) as demo:
|
|
| 492 |
label="Input Image"
|
| 493 |
)
|
| 494 |
with gr.Row():
|
| 495 |
-
|
|
|
|
|
|
|
|
|
|
| 496 |
with gr.Row():
|
| 497 |
target_ratio = gr.Radio(
|
| 498 |
label="Expected Ratio",
|
|
@@ -551,9 +554,8 @@ with gr.Blocks(css=css, fill_height=True) as demo:
|
|
| 551 |
value=50,
|
| 552 |
visible=False
|
| 553 |
)
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
runout_button = gr.Button("Generate")
|
| 557 |
with gr.Column():
|
| 558 |
result_outpaint = ImageSlider(
|
| 559 |
interactive=False,
|
|
@@ -589,16 +591,7 @@ with gr.Blocks(css=css, fill_height=True) as demo:
|
|
| 589 |
# outputs=[image_output],
|
| 590 |
# show_progress=True,
|
| 591 |
# )
|
| 592 |
-
|
| 593 |
-
# with gr.Blocks() as sam_demo:
|
| 594 |
-
# sam_block = gr.load(name="spaces/LPX55/SAM2_1-Image-Predictor-Masking-Tool-CPU")
|
| 595 |
-
# Define the action triggered by the upload_image_input change
|
| 596 |
-
# upload_image_input.change(
|
| 597 |
-
# fn=update_mask,
|
| 598 |
-
# inputs=[upload_image_input],
|
| 599 |
-
# outputs=[image_output],
|
| 600 |
-
# show_progress=True,
|
| 601 |
-
# )
|
| 602 |
with gr.TabItem("Misc"):
|
| 603 |
with gr.Column():
|
| 604 |
clear_cache_button = gr.Button("Clear CUDA Cache")
|
|
|
|
| 14 |
# from sam2_mask import create_sam2_tab
|
| 15 |
import subprocess
|
| 16 |
import os
|
|
|
|
| 17 |
|
| 18 |
subprocess.run("rm -rf /data-nvme/zerogpu-offload/*", env={}, shell=True)
|
| 19 |
HF_TOKEN = os.environ["HF_TOKEN"]
|
|
|
|
| 414 |
</p>
|
| 415 |
</div>
|
| 416 |
"""
|
| 417 |
+
sam_block = gr.load(name="spaces/LPX55/SAM2_1-Image-Predictor-Masking-Tool-CPU")
|
| 418 |
|
| 419 |
with gr.Blocks(css=css, fill_height=True) as demo:
|
| 420 |
gr.Markdown("# Diffusers Inpaint and Outpaint")
|
|
|
|
| 492 |
label="Input Image"
|
| 493 |
)
|
| 494 |
with gr.Row():
|
| 495 |
+
with gr.Column(scale=2):
|
| 496 |
+
prompt_input = gr.Textbox(label="Prompt (Optional)")
|
| 497 |
+
with gr.Column(scale=1):
|
| 498 |
+
runout_button = gr.Button("Generate")
|
| 499 |
with gr.Row():
|
| 500 |
target_ratio = gr.Radio(
|
| 501 |
label="Expected Ratio",
|
|
|
|
| 554 |
value=50,
|
| 555 |
visible=False
|
| 556 |
)
|
| 557 |
+
with gr.Column():
|
| 558 |
+
preview_button = gr.Button("Preview alignment and mask")
|
|
|
|
| 559 |
with gr.Column():
|
| 560 |
result_outpaint = ImageSlider(
|
| 561 |
interactive=False,
|
|
|
|
| 591 |
# outputs=[image_output],
|
| 592 |
# show_progress=True,
|
| 593 |
# )
|
| 594 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 595 |
with gr.TabItem("Misc"):
|
| 596 |
with gr.Column():
|
| 597 |
clear_cache_button = gr.Button("Clear CUDA Cache")
|