multimodalart HF Staff commited on
Commit
ea53f65
·
verified ·
1 Parent(s): fc54c05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -196,17 +196,15 @@ def create_zoom_animation(previous_frame, next_frame, steps):
196
  resized_prev = cropped_prev.resize((512, 512), Image.LANCZOS)
197
 
198
  # For the last frame, use the next_frame resized to 512x512
199
- if i == steps:
200
- resized_frame = next_frame.resize((512, 512), Image.LANCZOS)
201
- else:
202
  resized_frame = resized_prev
203
-
204
  # Append the resized frame to the list
205
  interpolated_frames.append(resized_frame)
206
 
207
  return interpolated_frames
208
 
209
- def create_video_from_images(image_list, fps=4):
210
  if not image_list:
211
  return None
212
 
@@ -225,9 +223,9 @@ def create_video_from_images(image_list, fps=4):
225
  return video_path
226
 
227
  @spaces.GPU(duration=70)
228
- def loop_outpainting(image, width=1024, height=1024, overlap_width=18, num_inference_steps=8,
229
  resize_option="custom", custom_resize_size=512, prompt_input=None,
230
- alignment="Middle", num_iterations=18, fps=6, num_interpolation_frames=10,
231
  progress=gr.Progress()):
232
  current_image = image
233
  if(current_image.width != 1024 or current_image.height != 1024):
@@ -386,7 +384,7 @@ with gr.Blocks(css=css) as demo:
386
  num_iterations = gr.Slider(label="Number of iterations", minimum=2, maximum=24, step=1, value=6)
387
  fps = gr.Slider(label="fps", minimum=1, maximum=24, value=8)
388
  with gr.Row():
389
- num_interpolation_frames = gr.Slider(label="Interpolation frames", minimum=0, maximum=10, step=1, value=10)
390
 
391
  with gr.Column():
392
  result = ImageSlider(
 
196
  resized_prev = cropped_prev.resize((512, 512), Image.LANCZOS)
197
 
198
  # For the last frame, use the next_frame resized to 512x512
199
+ if i != steps:
 
 
200
  resized_frame = resized_prev
201
+
202
  # Append the resized frame to the list
203
  interpolated_frames.append(resized_frame)
204
 
205
  return interpolated_frames
206
 
207
+ def create_video_from_images(image_list, fps=8):
208
  if not image_list:
209
  return None
210
 
 
223
  return video_path
224
 
225
  @spaces.GPU(duration=70)
226
+ def loop_outpainting(image, width=1024, height=1024, overlap_width=6, num_inference_steps=8,
227
  resize_option="custom", custom_resize_size=512, prompt_input=None,
228
+ alignment="Middle", num_iterations=6, fps=6, num_interpolation_frames=15,
229
  progress=gr.Progress()):
230
  current_image = image
231
  if(current_image.width != 1024 or current_image.height != 1024):
 
384
  num_iterations = gr.Slider(label="Number of iterations", minimum=2, maximum=24, step=1, value=6)
385
  fps = gr.Slider(label="fps", minimum=1, maximum=24, value=8)
386
  with gr.Row():
387
+ num_interpolation_frames = gr.Slider(label="Interpolation frames", minimum=0, maximum=10, step=1, value=15)
388
 
389
  with gr.Column():
390
  result = ImageSlider(