QHL067 commited on
Commit
d206f4b
·
1 Parent(s): fd8460e
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -243,12 +243,13 @@ def infer(
243
 
244
  # Create an animated GIF from all the PIL images
245
  gif_buffer = io.BytesIO()
246
- # duration: adjust duration (ms) between frames as needed
247
- pil_images[0].save(gif_buffer, format="GIF", save_all=True, append_images=pil_images[1:], duration=10, loop=0)
248
- gif_buffer.seek(0)
249
- gif_bytes = gif_buffer.read()
250
 
251
- return first_image, last_image, gif_bytes, seed
 
252
 
253
  return pil_image, seed
254
 
@@ -298,7 +299,7 @@ with gr.Blocks(css=css) as demo:
298
  # Create separate outputs for the first image, last image, and the animated GIF
299
  first_image_output = gr.Image(label="Image if the first prompt", show_label=True)
300
  last_image_output = gr.Image(label="Image if the second prompt", show_label=True)
301
- gif_output = gr.Image(label="Linear interpolation", show_label=True)
302
 
303
  with gr.Accordion("Advanced Settings", open=False):
304
  seed = gr.Slider(
@@ -349,7 +350,8 @@ with gr.Blocks(css=css) as demo:
349
  num_inference_steps,
350
  num_of_interpolation,
351
  ],
352
- outputs=[first_image_output, last_image_output, gif_output, seed],
 
353
  )
354
 
355
  # with gr.Blocks(css=css) as demo:
 
243
 
244
  # Create an animated GIF from all the PIL images
245
  gif_buffer = io.BytesIO()
246
+ # # duration: adjust duration (ms) between frames as needed
247
+ # pil_images[0].save(gif_buffer, format="GIF", save_all=True, append_images=pil_images[1:], duration=10, loop=0)
248
+ # gif_buffer.seek(0)
249
+ # gif_bytes = gif_buffer.read()
250
 
251
+ # return first_image, last_image, gif_bytes, seed
252
+ return first_image, last_image, seed
253
 
254
  return pil_image, seed
255
 
 
299
  # Create separate outputs for the first image, last image, and the animated GIF
300
  first_image_output = gr.Image(label="Image if the first prompt", show_label=True)
301
  last_image_output = gr.Image(label="Image if the second prompt", show_label=True)
302
+ # gif_output = gr.Image(label="Linear interpolation", show_label=True)
303
 
304
  with gr.Accordion("Advanced Settings", open=False):
305
  seed = gr.Slider(
 
350
  num_inference_steps,
351
  num_of_interpolation,
352
  ],
353
+ # outputs=[first_image_output, last_image_output, gif_output, seed],
354
+ outputs=[first_image_output, last_image_output, seed],
355
  )
356
 
357
  # with gr.Blocks(css=css) as demo: