Update deformes4D_engine.py
Browse files- deformes4D_engine.py +6 -3
deformes4D_engine.py
CHANGED
|
@@ -175,6 +175,8 @@ class Deformes4DEngine:
|
|
| 175 |
present_scene_desc = storyboard[i]
|
| 176 |
|
| 177 |
is_first_fragment = previous_latents_path is None
|
|
|
|
|
|
|
| 178 |
if is_first_fragment:
|
| 179 |
transition_type = "start"
|
| 180 |
motion_prompt = gemini_singleton.get_initial_motion_prompt(
|
|
@@ -263,9 +265,10 @@ class Deformes4DEngine:
|
|
| 263 |
if n_trim_latents > 0 and latents_for_video.shape[2] > n_trim_latents:
|
| 264 |
latents_for_video = latents_for_video[:, :, :-n_trim_latents, :, :] # Cortar 24 do fim
|
| 265 |
|
| 266 |
-
else:
|
| 267 |
-
|
| 268 |
-
|
|
|
|
| 269 |
video_with_audio_path = self._generate_video_and_audio_from_latents(latents_for_video, audio_prompt, base_name)
|
| 270 |
video_clips_paths.append(video_with_audio_path)
|
| 271 |
|
|
|
|
| 175 |
present_scene_desc = storyboard[i]
|
| 176 |
|
| 177 |
is_first_fragment = previous_latents_path is None
|
| 178 |
+
is_penultimate_fragment = (i == num_transitions_to_generate - 2)
|
| 179 |
+
|
| 180 |
if is_first_fragment:
|
| 181 |
transition_type = "start"
|
| 182 |
motion_prompt = gemini_singleton.get_initial_motion_prompt(
|
|
|
|
| 265 |
if n_trim_latents > 0 and latents_for_video.shape[2] > n_trim_latents:
|
| 266 |
latents_for_video = latents_for_video[:, :, :-n_trim_latents, :, :] # Cortar 24 do fim
|
| 267 |
|
| 268 |
+
else:
|
| 269 |
+
if echo_frames > 0 and latents_for_video.shape[2] > echo_frames:
|
| 270 |
+
latents_for_video = latents_for_video[:, :, echo_frames:, :, :] # Cortar eco do início
|
| 271 |
+
|
| 272 |
video_with_audio_path = self._generate_video_and_audio_from_latents(latents_for_video, audio_prompt, base_name)
|
| 273 |
video_clips_paths.append(video_with_audio_path)
|
| 274 |
|