Fabrice-TIERCELIN commited on
Commit
296a001
·
verified ·
1 Parent(s): 6b0805f

Compare values

Browse files
Files changed (1) hide show
  1. app_endframe.py +1 -4
app_endframe.py CHANGED
@@ -517,26 +517,22 @@ def worker(input_video, end_frame, end_frame_weight, prompt, n_prompt, seed, bat
517
  split_sizes = [num_4x_frames, num_2x_frames]
518
  split_sizes = [s for s in split_sizes if s > 0]
519
  if split_sizes and context_frames.shape[2] >= sum(split_sizes):
520
- print("§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§")
521
  splits = context_frames.split(split_sizes, dim=2)
522
  split_idx = 0
523
  clean_latents_4x = splits[split_idx] if num_4x_frames > 0 else history_latents[:, :, :1, :, :]
524
  split_idx += 1 if num_4x_frames > 0 else 0
525
  clean_latents_2x = splits[split_idx] if num_2x_frames > 0 and split_idx < len(splits) else history_latents[:, :, :1, :, :]
526
  else:
527
- print("€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€")
528
  clean_latents_4x = clean_latents_2x = history_latents[:, :, :1, :, :]
529
 
530
  clean_latents_pre = video_latents[:, :, -min(effective_clean_frames, video_latents.shape[2]):].to(history_latents) # smoother motion but jumpcuts if end frame is too different, must change clean_latent_pre_frames to effective_clean_frames also
531
  clean_latents_post = history_latents[:, :, :min(effective_clean_frames, history_latents.shape[2]), :, :] # smoother motion, must change post_frames to effective_clean_frames also
532
 
533
  if is_end_of_video:
534
- print("µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ")
535
  clean_latents_post = torch.zeros_like(end_of_input_video_latent).to(history_latents)
536
 
537
  # 20250509 pftq: handle end frame if available
538
  if end_latent is not None:
539
- print("££££££££££££££££££££££££££££££")
540
  #current_end_frame_weight = end_frame_weight * (latent_padding / latent_paddings[0])
541
  #current_end_frame_weight = current_end_frame_weight * 0.5 + 0.5
542
  current_end_frame_weight = end_frame_weight # changing this over time introduces discontinuity
@@ -558,6 +554,7 @@ def worker(input_video, end_frame, end_frame_weight, prompt, n_prompt, seed, bat
558
  clean_latents = torch.cat([clean_latents_pre, clean_latents_post], dim=2)
559
 
560
  max_frames = min(latent_window_size * 4 - 3, history_latents.shape[2] * 4)
 
561
  print(f"Generating video {idx+1} of {batch} with seed {seed}, part {total_latent_sections - section_index} of {total_latent_sections} backward")
562
  generated_latents = sample_hunyuan(
563
  transformer=transformer,
 
517
  split_sizes = [num_4x_frames, num_2x_frames]
518
  split_sizes = [s for s in split_sizes if s > 0]
519
  if split_sizes and context_frames.shape[2] >= sum(split_sizes):
 
520
  splits = context_frames.split(split_sizes, dim=2)
521
  split_idx = 0
522
  clean_latents_4x = splits[split_idx] if num_4x_frames > 0 else history_latents[:, :, :1, :, :]
523
  split_idx += 1 if num_4x_frames > 0 else 0
524
  clean_latents_2x = splits[split_idx] if num_2x_frames > 0 and split_idx < len(splits) else history_latents[:, :, :1, :, :]
525
  else:
 
526
  clean_latents_4x = clean_latents_2x = history_latents[:, :, :1, :, :]
527
 
528
  clean_latents_pre = video_latents[:, :, -min(effective_clean_frames, video_latents.shape[2]):].to(history_latents) # smoother motion but jumpcuts if end frame is too different, must change clean_latent_pre_frames to effective_clean_frames also
529
  clean_latents_post = history_latents[:, :, :min(effective_clean_frames, history_latents.shape[2]), :, :] # smoother motion, must change post_frames to effective_clean_frames also
530
 
531
  if is_end_of_video:
 
532
  clean_latents_post = torch.zeros_like(end_of_input_video_latent).to(history_latents)
533
 
534
  # 20250509 pftq: handle end frame if available
535
  if end_latent is not None:
 
536
  #current_end_frame_weight = end_frame_weight * (latent_padding / latent_paddings[0])
537
  #current_end_frame_weight = current_end_frame_weight * 0.5 + 0.5
538
  current_end_frame_weight = end_frame_weight # changing this over time introduces discontinuity
 
554
  clean_latents = torch.cat([clean_latents_pre, clean_latents_post], dim=2)
555
 
556
  max_frames = min(latent_window_size * 4 - 3, history_latents.shape[2] * 4)
557
+ print(f"max_frames {max_frames} latent_window_size * 4 - 3 {latent_window_size * 4 - 3} history_latents.shape[2] * 4 {history_latents.shape[2] * 4}")
558
  print(f"Generating video {idx+1} of {batch} with seed {seed}, part {total_latent_sections - section_index} of {total_latent_sections} backward")
559
  generated_latents = sample_hunyuan(
560
  transformer=transformer,