Spaces:
Paused
Paused
Compare values
Browse files516 unmodified lines51751851952052152252352452552652752852953053153253353453553653753853954054154215 unmodified lines558559560561562563516 unmodified linessplit_sizes = [num_4x_frames, num_2x_frames]split_sizes = [s for s in split_sizes if s > 0]if split_sizes and context_frames.shape[2] >= sum(split_sizes):print("§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§")splits = context_frames.split(split_sizes, dim=2)split_idx = 0clean_latents_4x = splits[split_idx] if num_4x_frames > 0 else history_latents[:, :, :1, :, :]split_idx += 1 if num_4x_frames > 0 else 0clean_latents_2x = splits[split_idx] if num_2x_frames > 0 and split_idx < len(splits) else history_latents[:, :, :1, :, :]else:print("€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€")clean_latents_4x = clean_latents_2x = history_latents[:, :, :1, :, :]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 alsoclean_latents_post = history_latents[:, :, :min(effective_clean_frames, history_latents.shape[2]), :, :] # smoother motion, must change post_frames to effective_clean_frames alsoif is_end_of_video:print("µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ")clean_latents_post = torch.zeros_like(end_of_input_video_latent).to(history_latents)# 20250509 pftq: handle end frame if availableif end_latent is not None:print("££££££££££££££££££££££££££££££")#current_end_frame_weight = end_frame_weight * (latent_padding / latent_paddings[0])#current_end_frame_weight = current_end_frame_weight * 0.5 + 0.5current_end_frame_weight = end_frame_weight # changing this over time introduces discontinuity15 unmodified linesclean_latents = torch.cat([clean_latents_pre, clean_latents_post], dim=2)max_frames = min(latent_window_size * 4 - 3, history_latents.shape[2] * 4)print(f"Generating video {idx+1} of {batch} with seed {seed}, part {total_latent_sections - section_index} of {total_latent_sections} backward")generated_latents = sample_hunyuan(transformer=transformer,516 unmodified lines51751851952052152252352452552652752852953053153253353453553653753815 unmodified lines554555556557558559560516 unmodified linessplit_sizes = [num_4x_frames, num_2x_frames]split_sizes = [s for s in split_sizes if s > 0]if split_sizes and context_frames.shape[2] >= sum(split_sizes):splits = context_frames.split(split_sizes, dim=2)split_idx = 0clean_latents_4x = splits[split_idx] if num_4x_frames > 0 else history_latents[:, :, :1, :, :]split_idx += 1 if num_4x_frames > 0 else 0clean_latents_2x = splits[split_idx] if num_2x_frames > 0 and split_idx < len(splits) else history_latents[:, :, :1, :, :]else:clean_latents_4x = clean_latents_2x = history_latents[:, :, :1, :, :]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 alsoclean_latents_post = history_latents[:, :, :min(effective_clean_frames, history_latents.shape[2]), :, :] # smoother motion, must change post_frames to effective_clean_frames alsoif is_end_of_video:clean_latents_post = torch.zeros_like(end_of_input_video_latent).to(history_latents)# 20250509 pftq: handle end frame if availableif end_latent is not None:#current_end_frame_weight = end_frame_weight * (latent_padding / latent_paddings[0])#current_end_frame_weight = current_end_frame_weight * 0.5 + 0.5current_end_frame_weight = end_frame_weight # changing this over time introduces discontinuity15 unmodified linesclean_latents = torch.cat([clean_latents_pre, clean_latents_post], dim=2)max_frames = min(latent_window_size * 4 - 3, history_latents.shape[2] * 4)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}")print(f"Generating video {idx+1} of {batch} with seed {seed}, part {total_latent_sections - section_index} of {total_latent_sections} backward")generated_latents = sample_hunyuan(transformer=transformer,
app_endframe.py+1-4