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):
|
@@ -541,8 +541,10 @@ if __name__ == "__main__":
|
|
541 |
vlm_btns.append(vlm_btn)
|
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 |
|
548 |
seed = gr.Number(value=42, label="Seed", info="")
|
@@ -626,8 +628,6 @@ if __name__ == "__main__":
|
|
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():
|
633 |
output = gr.Image(label="Result")
|
@@ -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):
|
|
|
541 |
vlm_btns.append(vlm_btn)
|
542 |
|
543 |
prompt = gr.Textbox(label="Prompt", placeholder="e.g., ENT1 and ENT2")
|
|
|
544 |
steps_slider = gr.Slider(minimum=4, maximum=40, step=1, value=8, label="inference steps")
|
545 |
+
gen_btn = gr.Button("Generate", variant="primary")
|
546 |
+
clear_btn = gr.Button("Clear")
|
547 |
+
|
548 |
with gr.Accordion("Advanced Settings", open=False):
|
549 |
|
550 |
seed = gr.Number(value=42, label="Seed", info="")
|
|
|
628 |
double_attention = gr.Checkbox(value=False, label="Double Attention", visible=False)
|
629 |
single_attention = gr.Checkbox(value=True, label="Single Attention", visible=False)
|
630 |
|
|
|
|
|
631 |
|
632 |
with gr.Column():
|
633 |
output = gr.Image(label="Result")
|
|
|
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]])
|