hysts HF staff commited on
Commit
16d15ba
·
1 Parent(s): c21a3e5
Files changed (1) hide show
  1. edit_app.py +9 -8
edit_app.py CHANGED
@@ -188,7 +188,15 @@ InstructPix2Pix: Learning to Follow Image Editing Instructions
188
  outputs=[input_image, instruction, seed, text_cfg_scale, image_cfg_scale, edited_image],
189
  api_name=False,
190
  )
191
- generate_button.click(
 
 
 
 
 
 
 
 
192
  fn=generate,
193
  inputs=[
194
  input_image,
@@ -203,13 +211,6 @@ InstructPix2Pix: Learning to Follow Image Editing Instructions
203
  outputs=[seed, text_cfg_scale, image_cfg_scale, edited_image],
204
  api_name="run",
205
  )
206
- reset_button.click(
207
- fn=reset,
208
- outputs=[steps, randomize_seed, seed, randomize_cfg, text_cfg_scale, image_cfg_scale, edited_image],
209
- queue=False,
210
- api_name=False,
211
- )
212
-
213
 
214
  if __name__ == "__main__":
215
  demo.queue(max_size=20).launch()
 
188
  outputs=[input_image, instruction, seed, text_cfg_scale, image_cfg_scale, edited_image],
189
  api_name=False,
190
  )
191
+ reset_button.click(
192
+ fn=reset,
193
+ outputs=[steps, randomize_seed, seed, randomize_cfg, text_cfg_scale, image_cfg_scale, edited_image],
194
+ queue=False,
195
+ api_name=False,
196
+ )
197
+
198
+ gr.on(
199
+ triggers=[generate_button.click, instruction.submit],
200
  fn=generate,
201
  inputs=[
202
  input_image,
 
211
  outputs=[seed, text_cfg_scale, image_cfg_scale, edited_image],
212
  api_name="run",
213
  )
 
 
 
 
 
 
 
214
 
215
  if __name__ == "__main__":
216
  demo.queue(max_size=20).launch()