QHL067 commited on
Commit
beec66d
·
1 Parent(s): 222bb76
Files changed (1) hide show
  1. app.py +16 -18
app.py CHANGED
@@ -234,24 +234,22 @@ def infer(
234
  samples = unpreprocess(image_unprocessed).contiguous()
235
 
236
 
237
- to_pil = ToPILImage()
238
- pil_images = [to_pil(img) for img in samples]
239
-
240
- # Get the first and last images
241
- first_image = pil_images[0]
242
- last_image = pil_images[-1]
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
 
256
 
257
  # examples = [
 
234
  samples = unpreprocess(image_unprocessed).contiguous()
235
 
236
 
237
+ to_pil = ToPILImage()
238
+ pil_images = [to_pil(img) for img in samples]
239
+
240
+ # Get the first and last images
241
+ first_image = pil_images[0]
242
+ last_image = pil_images[-1]
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
 
255
  # examples = [