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

update ui

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -3138,7 +3138,7 @@ with demo:
3138
  gr.Markdown("##### 🖱️ Middle Click: Background")
3139
  gr.Markdown("""
3140
  <h5>
3141
- Top Right
3142
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
3143
  stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
3144
  style="vertical-align: middle; height: 1em; width: 1em; display: inline;">
@@ -3146,6 +3146,14 @@ with demo:
3146
  <path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path>
3147
  </svg> :
3148
  Remove Last Point
 
 
 
 
 
 
 
 
3149
  </h5>
3150
  """)
3151
  prompt_image1 = ImagePrompter(show_label=False, elem_id="prompt_image", interactive=True)
@@ -3169,7 +3177,8 @@ with demo:
3169
  return
3170
  if index >= total_len:
3171
  index = total_len - 1
3172
- return gr.update(value={'image': images[index][0]})
 
3173
  load_one_image_button.click(update_prompt_image, inputs=[input_gallery, output_gallery, image_type_radio, image1_slider], outputs=[prompt_image1])
3174
  load_one_image_button.click(update_prompt_image, inputs=[input_gallery, output_gallery, image_type_radio, image2_slider], outputs=[prompt_image2])
3175
  load_one_image_button.click(update_prompt_image, inputs=[input_gallery, output_gallery, image_type_radio, image3_slider], outputs=[prompt_image3])
 
3138
  gr.Markdown("##### 🖱️ Middle Click: Background")
3139
  gr.Markdown("""
3140
  <h5>
3141
+ Top Right Buttons: </br>
3142
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
3143
  stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
3144
  style="vertical-align: middle; height: 1em; width: 1em; display: inline;">
 
3146
  <path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path>
3147
  </svg> :
3148
  Remove Last Point
3149
+ </br>
3150
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
3151
+ style="vertical-align: middle; height: 1em; width: 1em; display: inline;">
3152
+ <g fill="none">
3153
+ <path fill="currentColor" d="m5.505 11.41l.53.53l-.53-.53ZM3 14.952h-.75H3ZM9.048 21v.75V21ZM11.41 5.505l-.53-.53l.53.53Zm1.831 12.34a.75.75 0 0 0 1.06-1.061l-1.06 1.06ZM7.216 9.697a.75.75 0 1 0-1.06 1.061l1.06-1.06Zm10.749 2.362l-5.905 5.905l1.06 1.06l5.905-5.904l-1.06-1.06Zm-11.93-.12l5.905-5.905l-1.06-1.06l-5.905 5.904l1.06 1.06Zm0 6.025c-.85-.85-1.433-1.436-1.812-1.933c-.367-.481-.473-.79-.473-1.08h-1.5c0 .749.312 1.375.78 1.99c.455.596 1.125 1.263 1.945 2.083l1.06-1.06Zm-1.06-7.086c-.82.82-1.49 1.488-1.945 2.084c-.468.614-.78 1.24-.78 1.99h1.5c0-.29.106-.6.473-1.08c.38-.498.962-1.083 1.812-1.933l-1.06-1.06Zm7.085 7.086c-.85.85-1.435 1.433-1.933 1.813c-.48.366-.79.472-1.08.472v1.5c.75 0 1.376-.312 1.99-.78c.596-.455 1.264-1.125 2.084-1.945l-1.06-1.06Zm-7.085 1.06c.82.82 1.487 1.49 2.084 1.945c.614.468 1.24.78 1.989.78v-1.5c-.29 0-.599-.106-1.08-.473c-.497-.38-1.083-.962-1.933-1.812l-1.06 1.06Zm12.99-12.99c.85.85 1.433 1.436 1.813 1.933c.366.481.472.79.472 1.08h1.5c0-.749-.312-1.375-.78-1.99c-.455-.596-1.125-1.263-1.945-2.083l-1.06 1.06Zm1.06 7.086c.82-.82 1.49-1.488 1.945-2.084c.468-.614.78-1.24.78-1.99h-1.5c0 .29-.106.6-.473 1.08c-.38.498-.962 1.083-1.812 1.933l1.06 1.06Zm0-8.146c-.82-.82-1.487-1.49-2.084-1.945c-.614-.468-1.24-.78-1.989-.78v1.5c.29 0 .599.106 1.08.473c.497.38 1.083.962 1.933 1.812l1.06-1.06Zm-7.085 1.06c.85-.85 1.435-1.433 1.933-1.812c.48-.367.79-.473 1.08-.473v-1.5c-.75 0-1.376.312-1.99.78c-.596.455-1.264 1.125-2.084 1.945l1.06 1.06Zm2.362 10.749L7.216 9.698l-1.06 1.061l7.085 7.085l1.06-1.06Z"></path>
3154
+ <path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M9 21h12"></path></g>
3155
+ </svg> :
3156
+ Clear All Points
3157
  </h5>
3158
  """)
3159
  prompt_image1 = ImagePrompter(show_label=False, elem_id="prompt_image", interactive=True)
 
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])