Update app.py
Browse files
app.py
CHANGED
@@ -148,7 +148,7 @@ attn_skip_iter = 0
|
|
148 |
|
149 |
|
150 |
def clear_images():
|
151 |
-
return [None, ]*num_inputs
|
152 |
|
153 |
@spaces.GPU()
|
154 |
def det_seg_img(image, label):
|
@@ -542,6 +542,7 @@ if __name__ == "__main__":
|
|
542 |
|
543 |
prompt = gr.Textbox(label="Prompt", placeholder="e.g., ENT1 and ENT2")
|
544 |
gen_btn = gr.Button("Generate", variant="primary")
|
|
|
545 |
steps_slider = gr.Slider(minimum=4, maximum=40, step=1, value=8, label="inference steps")
|
546 |
with gr.Accordion("Advanced Settings", open=False):
|
547 |
|
@@ -625,8 +626,7 @@ if __name__ == "__main__":
|
|
625 |
with gr.Row():
|
626 |
double_attention = gr.Checkbox(value=False, label="Double Attention", visible=False)
|
627 |
single_attention = gr.Checkbox(value=True, label="Single Attention", visible=False)
|
628 |
-
|
629 |
-
clear_btn = gr.Button("Clear Images")
|
630 |
|
631 |
|
632 |
with gr.Column():
|
@@ -708,7 +708,7 @@ if __name__ == "__main__":
|
|
708 |
],
|
709 |
outputs=[output, final_text]
|
710 |
)
|
711 |
-
clear_btn.click(clear_images, outputs=images)
|
712 |
|
713 |
for i in range(num_inputs):
|
714 |
face_btns[i].click(det_seg_img, inputs=[images[i], gr.State("A face")], outputs=[images[i]])
|
|
|
148 |
|
149 |
|
150 |
def clear_images():
|
151 |
+
return [None, ]*num_inputs + ["", ]*num_inputs
|
152 |
|
153 |
@spaces.GPU()
|
154 |
def det_seg_img(image, label):
|
|
|
542 |
|
543 |
prompt = gr.Textbox(label="Prompt", placeholder="e.g., ENT1 and ENT2")
|
544 |
gen_btn = gr.Button("Generate", variant="primary")
|
545 |
+
clear_btn = gr.Button("Clear")
|
546 |
steps_slider = gr.Slider(minimum=4, maximum=40, step=1, value=8, label="inference steps")
|
547 |
with gr.Accordion("Advanced Settings", open=False):
|
548 |
|
|
|
626 |
with gr.Row():
|
627 |
double_attention = gr.Checkbox(value=False, label="Double Attention", visible=False)
|
628 |
single_attention = gr.Checkbox(value=True, label="Single Attention", visible=False)
|
629 |
+
|
|
|
630 |
|
631 |
|
632 |
with gr.Column():
|
|
|
708 |
],
|
709 |
outputs=[output, final_text]
|
710 |
)
|
711 |
+
clear_btn.click(clear_images, outputs=images + captions)
|
712 |
|
713 |
for i in range(num_inputs):
|
714 |
face_btns[i].click(det_seg_img, inputs=[images[i], gr.State("A face")], outputs=[images[i]])
|