Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -113,7 +113,7 @@ with gr.Blocks() as demo:
|
|
| 113 |
minimum=2,
|
| 114 |
maximum=100,
|
| 115 |
step=1,
|
| 116 |
-
value=
|
| 117 |
label="Number of Inference Steps",
|
| 118 |
)
|
| 119 |
|
|
@@ -128,7 +128,7 @@ with gr.Blocks() as demo:
|
|
| 128 |
generate_images_button_denoise = gr.Button("Generate Images")
|
| 129 |
|
| 130 |
with gr.Column():
|
| 131 |
-
images_output_denoise = gr.Gallery(label="Images", selected_index=0,
|
| 132 |
gif_denoise = gr.Image(label="GIF")
|
| 133 |
zip_output_denoise = gr.File(label="Download ZIP")
|
| 134 |
|
|
@@ -178,13 +178,13 @@ with gr.Blocks() as demo:
|
|
| 178 |
minimum=2,
|
| 179 |
maximum=100,
|
| 180 |
step=1,
|
| 181 |
-
value=
|
| 182 |
label="Number of Inference Steps per Image",
|
| 183 |
)
|
| 184 |
generate_images_button_seed = gr.Button("Generate Images")
|
| 185 |
|
| 186 |
with gr.Column():
|
| 187 |
-
images_output_seed = gr.Gallery(label="Images", selected_index=0,
|
| 188 |
zip_output_seed = gr.File(label="Download ZIP")
|
| 189 |
|
| 190 |
generate_images_button_seed.click(
|
|
@@ -222,7 +222,7 @@ with gr.Blocks() as demo:
|
|
| 222 |
minimum=2,
|
| 223 |
maximum=100,
|
| 224 |
step=1,
|
| 225 |
-
value=
|
| 226 |
label="Number of Inference Steps per Image",
|
| 227 |
)
|
| 228 |
|
|
@@ -237,7 +237,7 @@ with gr.Blocks() as demo:
|
|
| 237 |
generate_images_button_perturb = gr.Button("Generate Images")
|
| 238 |
|
| 239 |
with gr.Column():
|
| 240 |
-
images_output_perturb = gr.Gallery(label="Image", selected_index=0,
|
| 241 |
zip_output_perturb = gr.File(label="Download ZIP")
|
| 242 |
|
| 243 |
generate_images_button_perturb.click(
|
|
@@ -293,7 +293,7 @@ with gr.Blocks() as demo:
|
|
| 293 |
minimum=2,
|
| 294 |
maximum=100,
|
| 295 |
step=1,
|
| 296 |
-
value=
|
| 297 |
label="Number of Inference Steps per Image",
|
| 298 |
)
|
| 299 |
|
|
@@ -308,7 +308,7 @@ with gr.Blocks() as demo:
|
|
| 308 |
generate_images_button_circular = gr.Button("Generate Images")
|
| 309 |
|
| 310 |
with gr.Column():
|
| 311 |
-
images_output_circular = gr.Gallery(label="Image", selected_index=0,
|
| 312 |
gif_circular = gr.Image(label="GIF")
|
| 313 |
zip_output_circular = gr.File(label="Download ZIP")
|
| 314 |
|
|
@@ -352,7 +352,7 @@ with gr.Blocks() as demo:
|
|
| 352 |
minimum=2,
|
| 353 |
maximum=100,
|
| 354 |
step=1,
|
| 355 |
-
value=
|
| 356 |
label="Number of Inference Steps per Image",
|
| 357 |
)
|
| 358 |
|
|
@@ -502,7 +502,7 @@ with gr.Blocks() as demo:
|
|
| 502 |
minimum=2,
|
| 503 |
maximum=100,
|
| 504 |
step=1,
|
| 505 |
-
value=
|
| 506 |
label="Number of Inference Steps per Image",
|
| 507 |
)
|
| 508 |
guidance_scale_values = gr.Textbox(
|
|
@@ -522,7 +522,7 @@ with gr.Blocks() as demo:
|
|
| 522 |
with gr.Column():
|
| 523 |
images_output_guidance = gr.Gallery(
|
| 524 |
label="Images", selected_index=0,
|
| 525 |
-
|
| 526 |
)
|
| 527 |
zip_output_guidance = gr.File(label="Download ZIP")
|
| 528 |
|
|
@@ -540,53 +540,53 @@ with gr.Blocks() as demo:
|
|
| 540 |
fn=generate_seed_vis, inputs=[seed_guidance], outputs=[seed_vis_guidance]
|
| 541 |
)
|
| 542 |
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
|
| 591 |
with gr.Tab("CLIP Space"):
|
| 592 |
|
|
@@ -899,7 +899,7 @@ with gr.Blocks() as demo:
|
|
| 899 |
minimum=2,
|
| 900 |
maximum=100,
|
| 901 |
step=1,
|
| 902 |
-
value=
|
| 903 |
label="Number of Inference Steps per Image",
|
| 904 |
)
|
| 905 |
|
|
@@ -916,7 +916,7 @@ with gr.Blocks() as demo:
|
|
| 916 |
with gr.Column():
|
| 917 |
images_output_interpolate = gr.Gallery(
|
| 918 |
label="Interpolated Images", selected_index=0,
|
| 919 |
-
|
| 920 |
)
|
| 921 |
gif_interpolate = gr.Image(label="GIF")
|
| 922 |
zip_output_interpolate = gr.File(label="Download ZIP")
|
|
@@ -960,7 +960,7 @@ with gr.Blocks() as demo:
|
|
| 960 |
minimum=2,
|
| 961 |
maximum=100,
|
| 962 |
step=1,
|
| 963 |
-
value=
|
| 964 |
label="Number of Inference Steps per Image",
|
| 965 |
)
|
| 966 |
|
|
|
|
| 113 |
minimum=2,
|
| 114 |
maximum=100,
|
| 115 |
step=1,
|
| 116 |
+
value=16,
|
| 117 |
label="Number of Inference Steps",
|
| 118 |
)
|
| 119 |
|
|
|
|
| 128 |
generate_images_button_denoise = gr.Button("Generate Images")
|
| 129 |
|
| 130 |
with gr.Column():
|
| 131 |
+
images_output_denoise = gr.Gallery(label="Images", selected_index=0, height=512)
|
| 132 |
gif_denoise = gr.Image(label="GIF")
|
| 133 |
zip_output_denoise = gr.File(label="Download ZIP")
|
| 134 |
|
|
|
|
| 178 |
minimum=2,
|
| 179 |
maximum=100,
|
| 180 |
step=1,
|
| 181 |
+
value=16,
|
| 182 |
label="Number of Inference Steps per Image",
|
| 183 |
)
|
| 184 |
generate_images_button_seed = gr.Button("Generate Images")
|
| 185 |
|
| 186 |
with gr.Column():
|
| 187 |
+
images_output_seed = gr.Gallery(label="Images", selected_index=0, height=512)
|
| 188 |
zip_output_seed = gr.File(label="Download ZIP")
|
| 189 |
|
| 190 |
generate_images_button_seed.click(
|
|
|
|
| 222 |
minimum=2,
|
| 223 |
maximum=100,
|
| 224 |
step=1,
|
| 225 |
+
value=16,
|
| 226 |
label="Number of Inference Steps per Image",
|
| 227 |
)
|
| 228 |
|
|
|
|
| 237 |
generate_images_button_perturb = gr.Button("Generate Images")
|
| 238 |
|
| 239 |
with gr.Column():
|
| 240 |
+
images_output_perturb = gr.Gallery(label="Image", selected_index=0, height=512)
|
| 241 |
zip_output_perturb = gr.File(label="Download ZIP")
|
| 242 |
|
| 243 |
generate_images_button_perturb.click(
|
|
|
|
| 293 |
minimum=2,
|
| 294 |
maximum=100,
|
| 295 |
step=1,
|
| 296 |
+
value=16,
|
| 297 |
label="Number of Inference Steps per Image",
|
| 298 |
)
|
| 299 |
|
|
|
|
| 308 |
generate_images_button_circular = gr.Button("Generate Images")
|
| 309 |
|
| 310 |
with gr.Column():
|
| 311 |
+
images_output_circular = gr.Gallery(label="Image", selected_index=0, height=512)
|
| 312 |
gif_circular = gr.Image(label="GIF")
|
| 313 |
zip_output_circular = gr.File(label="Download ZIP")
|
| 314 |
|
|
|
|
| 352 |
minimum=2,
|
| 353 |
maximum=100,
|
| 354 |
step=1,
|
| 355 |
+
value=16,
|
| 356 |
label="Number of Inference Steps per Image",
|
| 357 |
)
|
| 358 |
|
|
|
|
| 502 |
minimum=2,
|
| 503 |
maximum=100,
|
| 504 |
step=1,
|
| 505 |
+
value=16,
|
| 506 |
label="Number of Inference Steps per Image",
|
| 507 |
)
|
| 508 |
guidance_scale_values = gr.Textbox(
|
|
|
|
| 522 |
with gr.Column():
|
| 523 |
images_output_guidance = gr.Gallery(
|
| 524 |
label="Images", selected_index=0,
|
| 525 |
+
height=512,
|
| 526 |
)
|
| 527 |
zip_output_guidance = gr.File(label="Download ZIP")
|
| 528 |
|
|
|
|
| 540 |
fn=generate_seed_vis, inputs=[seed_guidance], outputs=[seed_vis_guidance]
|
| 541 |
)
|
| 542 |
|
| 543 |
+
with gr.TabItem("Inpainting"):
|
| 544 |
+
gr.Markdown("Inpaint the image based on the prompt.")
|
| 545 |
+
gr.HTML(read_html("html/inpainting.html"))
|
| 546 |
+
|
| 547 |
+
with gr.Row():
|
| 548 |
+
with gr.Column():
|
| 549 |
+
uploaded_img_inpaint = gr.Sketchpad(
|
| 550 |
+
sources="upload", brush=gr.Brush(colors=["#ffff00"]), type="pil", label="Upload"
|
| 551 |
+
)
|
| 552 |
+
prompt_inpaint = gr.Textbox(
|
| 553 |
+
lines=1, label="Prompt", value="sunglasses"
|
| 554 |
+
)
|
| 555 |
+
num_inference_steps_inpaint = gr.Slider(
|
| 556 |
+
minimum=2,
|
| 557 |
+
maximum=100,
|
| 558 |
+
step=1,
|
| 559 |
+
value=16,
|
| 560 |
+
label="Number of Inference Steps per Image",
|
| 561 |
+
)
|
| 562 |
+
|
| 563 |
+
with gr.Row():
|
| 564 |
+
seed_inpaint = gr.Slider(
|
| 565 |
+
minimum=0, maximum=100, step=1, value=14, label="Seed"
|
| 566 |
+
)
|
| 567 |
+
seed_vis_inpaint = gr.Plot(
|
| 568 |
+
value=generate_seed_vis(14), label="Seed"
|
| 569 |
+
)
|
| 570 |
+
|
| 571 |
+
inpaint_button = gr.Button("Inpaint")
|
| 572 |
+
|
| 573 |
+
with gr.Column():
|
| 574 |
+
images_output_inpaint = gr.Image(label="Output")
|
| 575 |
+
zip_output_inpaint = gr.File(label="Download ZIP")
|
| 576 |
+
|
| 577 |
+
inpaint_button.click(
|
| 578 |
+
fn=inpaint,
|
| 579 |
+
inputs=[
|
| 580 |
+
uploaded_img_inpaint,
|
| 581 |
+
num_inference_steps_inpaint,
|
| 582 |
+
seed_inpaint,
|
| 583 |
+
prompt_inpaint,
|
| 584 |
+
],
|
| 585 |
+
outputs=[images_output_inpaint, zip_output_inpaint],
|
| 586 |
+
)
|
| 587 |
+
seed_inpaint.change(
|
| 588 |
+
fn=generate_seed_vis, inputs=[seed_inpaint], outputs=[seed_vis_inpaint]
|
| 589 |
+
)
|
| 590 |
|
| 591 |
with gr.Tab("CLIP Space"):
|
| 592 |
|
|
|
|
| 899 |
minimum=2,
|
| 900 |
maximum=100,
|
| 901 |
step=1,
|
| 902 |
+
value=16,
|
| 903 |
label="Number of Inference Steps per Image",
|
| 904 |
)
|
| 905 |
|
|
|
|
| 916 |
with gr.Column():
|
| 917 |
images_output_interpolate = gr.Gallery(
|
| 918 |
label="Interpolated Images", selected_index=0,
|
| 919 |
+
height=512,
|
| 920 |
)
|
| 921 |
gif_interpolate = gr.Image(label="GIF")
|
| 922 |
zip_output_interpolate = gr.File(label="Download ZIP")
|
|
|
|
| 960 |
minimum=2,
|
| 961 |
maximum=100,
|
| 962 |
step=1,
|
| 963 |
+
value=16,
|
| 964 |
label="Number of Inference Steps per Image",
|
| 965 |
)
|
| 966 |
|