Fabrice-TIERCELIN commited on
Commit
c04f9da
·
verified ·
1 Parent(s): cbfbd85

Other optimizations

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -795,8 +795,9 @@ def worker_video(input_video, prompts, n_prompt, seed, batch, resolution, total_
795
  stream.output_queue.push(('progress', (None, '', make_progress_bar_html(0, 'Video processing ...'))))
796
 
797
  # 20250506 pftq: Encode video
798
- start_latent, input_image_np, video_latents, fps, height, width, input_video_pixels = video_encode(input_video, resolution, no_resize, vae, vae_batch_size=vae_batch, device=gpu)
799
  start_latent = start_latent.to(dtype=torch.float32).cpu()
 
800
 
801
  # CLIP Vision
802
  stream.output_queue.push(('progress', (None, '', make_progress_bar_html(0, 'CLIP Vision encoding ...'))))
@@ -905,7 +906,7 @@ def worker_video(input_video, prompts, n_prompt, seed, batch, resolution, total_
905
  rnd = torch.Generator("cpu").manual_seed(seed)
906
 
907
  # 20250506 pftq: Initialize history_latents with video latents
908
- history_latents = video_latents.cpu()
909
  total_generated_latent_frames = history_latents.shape[2]
910
  # 20250506 pftq: Initialize history_pixels to fix UnboundLocalError
911
  history_pixels = None
 
795
  stream.output_queue.push(('progress', (None, '', make_progress_bar_html(0, 'Video processing ...'))))
796
 
797
  # 20250506 pftq: Encode video
798
+ start_latent, input_image_np, video_latents, fps, height, width = video_encode(input_video, resolution, no_resize, vae, vae_batch_size=vae_batch, device=gpu)[:5]
799
  start_latent = start_latent.to(dtype=torch.float32).cpu()
800
+ video_latents = video_latents.cpu()
801
 
802
  # CLIP Vision
803
  stream.output_queue.push(('progress', (None, '', make_progress_bar_html(0, 'CLIP Vision encoding ...'))))
 
906
  rnd = torch.Generator("cpu").manual_seed(seed)
907
 
908
  # 20250506 pftq: Initialize history_latents with video latents
909
+ history_latents = video_latents
910
  total_generated_latent_frames = history_latents.shape[2]
911
  # 20250506 pftq: Initialize history_pixels to fix UnboundLocalError
912
  history_pixels = None