huzey commited on
Commit
896eab2
1 Parent(s): 6c4afb4

update ui

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -3156,9 +3156,9 @@ with demo:
3156
  Clear All Points
3157
  </h5>
3158
  """)
3159
- prompt_image1 = ImagePrompter(show_label=False, elem_id="prompt_image", interactive=True)
3160
- prompt_image2 = ImagePrompter(show_label=False, elem_id="prompt_image", interactive=True)
3161
- prompt_image3 = ImagePrompter(show_label=False, elem_id="prompt_image", interactive=True)
3162
  # def update_number_of_images(images):
3163
  # if images is None:
3164
  # return gr.update(max=0, value=0)
@@ -3177,8 +3177,9 @@ with demo:
3177
  return
3178
  if index >= total_len:
3179
  index = total_len - 1
3180
- # return gr.update(value={'image': images[index][0]})
3181
- return gr.update(value={'image': images[index][0], 'points': []})
 
3182
  load_one_image_button.click(update_prompt_image, inputs=[input_gallery, output_gallery, image_type_radio, image1_slider], outputs=[prompt_image1])
3183
  load_one_image_button.click(update_prompt_image, inputs=[input_gallery, output_gallery, image_type_radio, image2_slider], outputs=[prompt_image2])
3184
  load_one_image_button.click(update_prompt_image, inputs=[input_gallery, output_gallery, image_type_radio, image3_slider], outputs=[prompt_image3])
 
3156
  Clear All Points
3157
  </h5>
3158
  """)
3159
+ prompt_image1 = ImagePrompter(show_label=False, elem_id="prompt_image1", interactive=False)
3160
+ prompt_image2 = ImagePrompter(show_label=False, elem_id="prompt_image2", interactive=False)
3161
+ prompt_image3 = ImagePrompter(show_label=False, elem_id="prompt_image3", interactive=False)
3162
  # def update_number_of_images(images):
3163
  # if images is None:
3164
  # return gr.update(max=0, value=0)
 
3177
  return
3178
  if index >= total_len:
3179
  index = total_len - 1
3180
+
3181
+ return ImagePrompter(value={'image': images[index][0], 'points': []}, interactive=True)
3182
+ # return gr.Image(value=images[index][0], elem_id=f"prompt_image{randint}", interactive=True)
3183
  load_one_image_button.click(update_prompt_image, inputs=[input_gallery, output_gallery, image_type_radio, image1_slider], outputs=[prompt_image1])
3184
  load_one_image_button.click(update_prompt_image, inputs=[input_gallery, output_gallery, image_type_radio, image2_slider], outputs=[prompt_image2])
3185
  load_one_image_button.click(update_prompt_image, inputs=[input_gallery, output_gallery, image_type_radio, image3_slider], outputs=[prompt_image3])