Spaces:
Runtime error
Runtime error
Linoy Tsaban
commited on
Commit
·
a151f1a
1
Parent(s):
4a66586
Update app.py
Browse files
app.py
CHANGED
|
@@ -495,9 +495,12 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 495 |
tar_prompt = gr.Textbox(
|
| 496 |
label="Describe your edited image",
|
| 497 |
# show_label=False,
|
| 498 |
-
max_lines=1, value="",
|
| 499 |
placeholder="Target prompt, DDPM Inversion", info = "Leave blank to have only SEGA concepts guide your edit"
|
| 500 |
)
|
|
|
|
|
|
|
|
|
|
| 501 |
|
| 502 |
with gr.Box():
|
| 503 |
intro_segs = gr.Markdown("Add/Remove SEGA Concepts from your Image")
|
|
@@ -622,11 +625,11 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 622 |
interactive=True,
|
| 623 |
info = "Lower the threshold for more effect (e.g. ~0.9 for style transfer)")
|
| 624 |
|
| 625 |
-
|
| 626 |
-
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
|
| 630 |
#neg_guidance_1.change(fn = update_label, inputs=[neg_guidance_1], outputs=[add_1])
|
| 631 |
#neg_guidance_2.change(fn = update_label, inputs=[neg_guidance_2], outputs=[add_2])
|
| 632 |
#neg_guidance_3.change(fn = update_label, inputs=[neg_guidance_3], outputs=[add_3])
|
|
@@ -684,9 +687,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 684 |
input_image.upload(
|
| 685 |
fn = reset_do_inversion,
|
| 686 |
outputs = [do_inversion],
|
| 687 |
-
queue = False).then(fn =
|
| 688 |
-
inputs = [input_image],
|
| 689 |
-
outputs = [tar_prompt]).then(fn = update_inversion_progress_visibility, inputs =[input_image,do_inversion],
|
| 690 |
outputs=[inversion_progress],queue=False).then(
|
| 691 |
fn=load_and_invert,
|
| 692 |
inputs=[input_image,
|
|
|
|
| 495 |
tar_prompt = gr.Textbox(
|
| 496 |
label="Describe your edited image",
|
| 497 |
# show_label=False,
|
| 498 |
+
max_lines=1, value="", scale=3,
|
| 499 |
placeholder="Target prompt, DDPM Inversion", info = "Leave blank to have only SEGA concepts guide your edit"
|
| 500 |
)
|
| 501 |
+
caption_button = gr.Button("Caption Image", scale=1)
|
| 502 |
+
|
| 503 |
+
|
| 504 |
|
| 505 |
with gr.Box():
|
| 506 |
intro_segs = gr.Markdown("Add/Remove SEGA Concepts from your Image")
|
|
|
|
| 625 |
interactive=True,
|
| 626 |
info = "Lower the threshold for more effect (e.g. ~0.9 for style transfer)")
|
| 627 |
|
| 628 |
+
caption_button.click(
|
| 629 |
+
fn = caption_image,
|
| 630 |
+
inputs = [input_image],
|
| 631 |
+
outputs = [tar_prompt]
|
| 632 |
+
)
|
| 633 |
#neg_guidance_1.change(fn = update_label, inputs=[neg_guidance_1], outputs=[add_1])
|
| 634 |
#neg_guidance_2.change(fn = update_label, inputs=[neg_guidance_2], outputs=[add_2])
|
| 635 |
#neg_guidance_3.change(fn = update_label, inputs=[neg_guidance_3], outputs=[add_3])
|
|
|
|
| 687 |
input_image.upload(
|
| 688 |
fn = reset_do_inversion,
|
| 689 |
outputs = [do_inversion],
|
| 690 |
+
queue = False).then(fn = update_inversion_progress_visibility, inputs =[input_image,do_inversion],
|
|
|
|
|
|
|
| 691 |
outputs=[inversion_progress],queue=False).then(
|
| 692 |
fn=load_and_invert,
|
| 693 |
inputs=[input_image,
|