gaparmar commited on
Commit
6051ed8
β€’
1 Parent(s): 23a93a3

removing the clear

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -56,10 +56,10 @@ if __name__=="__main__":
56
  org_key = gr.Textbox(placeholder="enter you OpenAI organization key here", interactive=True, visible=False, label="OpenAI Organization:", type="password")
57
  with gr.Row():
58
  btn_edit = gr.Button("Run", label="")
59
- btn_clear = gr.Button("Clear")
60
 
61
  with gr.Accordion("Change editing settings?", open=True):
62
- num_ddim = gr.Slider(0, 200, 50, label="Number of DDIM steps", interactive=True, elem_id="slider_ddim", step=10)
63
  xa_guidance = gr.Slider(0, 0.25, 0.1, label="Cross Attention guidance", interactive=True, elem_id="slider_xa", step=0.01)
64
  edit_mul = gr.Slider(0, 2, 1.0, label="Edit multiplier", interactive=True, elem_id="slider_edit_mul", step=0.05)
65
 
@@ -85,9 +85,13 @@ if __name__=="__main__":
85
 
86
  def fn_clear_all():
87
  return gr.update(value=None), gr.update(value=None), gr.update(value=None)
88
- btn_clear.click(fn_clear_all, [], [img_out, img_in_real, img_in_synth])
89
- btn_clear.click(set_visible_true, [], img_in_real)
90
- btn_clear.click(set_visible_false, [], img_in_synth)
 
 
 
 
91
 
92
 
93
  # handling custom directions
@@ -129,7 +133,7 @@ if __name__=="__main__":
129
 
130
  gr.HTML("<hr>")
131
 
132
-
133
  demo.queue(concurrency_count=1)
134
  demo.launch(debug=True)
135
 
 
56
  org_key = gr.Textbox(placeholder="enter you OpenAI organization key here", interactive=True, visible=False, label="OpenAI Organization:", type="password")
57
  with gr.Row():
58
  btn_edit = gr.Button("Run", label="")
59
+ # btn_clear = gr.Button("Clear")
60
 
61
  with gr.Accordion("Change editing settings?", open=True):
62
+ num_ddim = gr.Slider(0, 200, 100, label="Number of DDIM steps", interactive=True, elem_id="slider_ddim", step=10)
63
  xa_guidance = gr.Slider(0, 0.25, 0.1, label="Cross Attention guidance", interactive=True, elem_id="slider_xa", step=0.01)
64
  edit_mul = gr.Slider(0, 2, 1.0, label="Edit multiplier", interactive=True, elem_id="slider_edit_mul", step=0.05)
65
 
 
85
 
86
  def fn_clear_all():
87
  return gr.update(value=None), gr.update(value=None), gr.update(value=None)
88
+ # btn_clear.click(fn_clear_all, [], [img_out, img_in_real, img_in_synth])
89
+ # btn_clear.click(set_visible_true, [], img_in_real)
90
+ # btn_clear.click(set_visible_false, [], img_in_synth)
91
+ img_in_real.clear(fn_clear_all, [], [img_out, img_in_real, img_in_synth])
92
+ img_in_synth.clear(fn_clear_all, [], [img_out, img_in_real, img_in_synth])
93
+ img_out.clear(fn_clear_all, [], [img_out, img_in_real, img_in_synth])
94
+
95
 
96
 
97
  # handling custom directions
 
133
 
134
  gr.HTML("<hr>")
135
 
136
+ gr.close_all()
137
  demo.queue(concurrency_count=1)
138
  demo.launch(debug=True)
139