Ashoka74 commited on
Commit
b5b5693
1 Parent(s): b88786a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -932,7 +932,7 @@ def process_image(input_image, input_text):
932
  # Set extracted foreground for mask mover
933
  mask_mover.set_extracted_fg(cropped_rgba)
934
 
935
- return annotated_frame, cropped_rgba, gr.update(visible=True), gr.update(visible=True)
936
 
937
 
938
  else:
@@ -1061,7 +1061,7 @@ def process_image(input_image, input_text):
1061
  # Set extracted foreground for mask mover
1062
  mask_mover.set_extracted_fg(cropped_rgba)
1063
 
1064
- return annotated_frame, cropped_rgba, gr.update(visible=True), gr.update(visible=True)
1065
  return annotated_frame, None, gr.update(visible=False), gr.update(visible=False)
1066
 
1067
 
@@ -1141,15 +1141,17 @@ with block:
1141
  # outputs=[result_gallery, output_bg],
1142
  # run_on_click=True, examples_per_page=1024
1143
  # )
1144
- ips = [input_fg, prompt, image_width, image_height, num_samples, seed, steps, a_prompt, n_prompt, cfg, highres_scale, highres_denoise, lowres_denoise, bg_source]
1145
  relight_button.click(fn=process_relight, inputs=ips, outputs=[result_gallery])
1146
  example_quick_prompts.click(lambda x, y: ', '.join(y.split(', ')[:2] + [x[0]]), inputs=[example_quick_prompts, prompt], outputs=prompt, show_progress=False, queue=False)
1147
  example_quick_subjects.click(lambda x: x[0], inputs=example_quick_subjects, outputs=prompt, show_progress=False, queue=False)
 
1148
  find_objects_button.click(
1149
  fn=process_image,
1150
  inputs=[input_fg, text_prompt],
1151
  outputs=[extracted_objects, extracted_fg]
1152
  )
 
1153
  extract_button.click(
1154
  fn=extract_foreground,
1155
  inputs=[input_fg],
 
932
  # Set extracted foreground for mask mover
933
  mask_mover.set_extracted_fg(cropped_rgba)
934
 
935
+ return annotated_frame, cropped_rgba, gr.update(visible=False), gr.update(visible=False)
936
 
937
 
938
  else:
 
1061
  # Set extracted foreground for mask mover
1062
  mask_mover.set_extracted_fg(cropped_rgba)
1063
 
1064
+ return annotated_frame, cropped_rgba, gr.update(visible=False), gr.update(visible=False)
1065
  return annotated_frame, None, gr.update(visible=False), gr.update(visible=False)
1066
 
1067
 
 
1141
  # outputs=[result_gallery, output_bg],
1142
  # run_on_click=True, examples_per_page=1024
1143
  # )
1144
+ ips = [extracted_fg, prompt, image_width, image_height, num_samples, seed, steps, a_prompt, n_prompt, cfg, highres_scale, highres_denoise, lowres_denoise, bg_source]
1145
  relight_button.click(fn=process_relight, inputs=ips, outputs=[result_gallery])
1146
  example_quick_prompts.click(lambda x, y: ', '.join(y.split(', ')[:2] + [x[0]]), inputs=[example_quick_prompts, prompt], outputs=prompt, show_progress=False, queue=False)
1147
  example_quick_subjects.click(lambda x: x[0], inputs=example_quick_subjects, outputs=prompt, show_progress=False, queue=False)
1148
+
1149
  find_objects_button.click(
1150
  fn=process_image,
1151
  inputs=[input_fg, text_prompt],
1152
  outputs=[extracted_objects, extracted_fg]
1153
  )
1154
+
1155
  extract_button.click(
1156
  fn=extract_foreground,
1157
  inputs=[input_fg],