Ashoka74 commited on
Commit
1347566
·
verified ·
1 Parent(s): d73f7ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -9
app.py CHANGED
@@ -160,7 +160,9 @@ Generate 768x768 multi-view images from a single image using SDXL <br>
160
  )
161
 
162
  def use_orientation(selected_image:gr.SelectData):
163
- return selected_image.index
 
 
164
 
165
  def add_orientation(imgs, index):
166
  index = int(index)
@@ -188,13 +190,13 @@ Generate 768x768 multi-view images from a single image using SDXL <br>
188
  try:
189
  selected_index=int(selected_index)
190
  if 0 <= selected_index < len(images):
191
- return images[selected_index]
192
  except (ValueError, TypeError):
193
  return None
194
 
195
-
196
 
197
- imgs = gr.State()
 
198
 
199
  with gr.Column():
200
  result = gr.Gallery(
@@ -223,6 +225,7 @@ Generate 768x768 multi-view images from a single image using SDXL <br>
223
  input_fg = gr.Image(type="numpy", label="Selected Image", height=480)
224
  # selected = gr.Number(visible=True)
225
  # result.select(use_orientation, None, selected).then()
 
226
  # add_button = gr.Button("Select orientation for processing")
227
  # add_button.click(add_orientation, [imgs, selected], input_fg)
228
 
@@ -238,11 +241,14 @@ Generate 768x768 multi-view images from a single image using SDXL <br>
238
  # outputs=input_fg
239
  #)
240
 
241
- slider.change(
242
- fn=update_selected_image,
243
- inputs=[slider, imgs],
244
- outputs=input_fg
245
- )
 
 
 
246
 
247
 
248
  # with gr.Row():
 
160
  )
161
 
162
  def use_orientation(selected_image:gr.SelectData):
163
+ return selected_image.value['image']['path']
164
+
165
+
166
 
167
  def add_orientation(imgs, index):
168
  index = int(index)
 
190
  try:
191
  selected_index=int(selected_index)
192
  if 0 <= selected_index < len(images):
193
+ return images[selected_index].value['image']['path']
194
  except (ValueError, TypeError):
195
  return None
196
 
 
197
 
198
+
199
+ # imgs = gr.State()
200
 
201
  with gr.Column():
202
  result = gr.Gallery(
 
225
  input_fg = gr.Image(type="numpy", label="Selected Image", height=480)
226
  # selected = gr.Number(visible=True)
227
  # result.select(use_orientation, None, selected).then()
228
+ result.select(use_orientation, None, input_fg)
229
  # add_button = gr.Button("Select orientation for processing")
230
  # add_button.click(add_orientation, [imgs, selected], input_fg)
231
 
 
241
  # outputs=input_fg
242
  #)
243
 
244
+ # slider.change(
245
+ # fn=update_selected_image,
246
+ # inputs=[slider, imgs],
247
+ # outputs=input_fg
248
+ # )
249
+
250
+
251
+
252
 
253
 
254
  # with gr.Row():