Update deformes4D_engine.py
Browse files- deformes4D_engine.py +4 -4
deformes4D_engine.py
CHANGED
|
@@ -256,19 +256,19 @@ class Deformes4DEngine:
|
|
| 256 |
|
| 257 |
if is_first_fragment:
|
| 258 |
if n_trim_latents > 0 and latents_for_video.shape[2] > n_trim_latents:
|
| 259 |
-
latents_for_video = latents_for_video[:, :,
|
| 260 |
|
| 261 |
elif is_penultimate_fragment:
|
| 262 |
if echo_frames > 0 and latents_for_video.shape[2] > echo_frames:
|
| 263 |
-
latents_for_video = latents_for_video[:, :,
|
| 264 |
|
| 265 |
|
| 266 |
if n_trim_latents > 0 and latents_for_video.shape[2] > n_trim_latents:
|
| 267 |
-
latents_for_video = latents_for_video[:, :,
|
| 268 |
|
| 269 |
else:
|
| 270 |
if echo_frames > 0 and latents_for_video.shape[2] > echo_frames:
|
| 271 |
-
latents_for_video = latents_for_video[:, :,
|
| 272 |
|
| 273 |
video_with_audio_path = self._generate_video_and_audio_from_latents(latents_for_video, audio_prompt, base_name)
|
| 274 |
video_clips_paths.append(video_with_audio_path)
|
|
|
|
| 256 |
|
| 257 |
if is_first_fragment:
|
| 258 |
if n_trim_latents > 0 and latents_for_video.shape[2] > n_trim_latents:
|
| 259 |
+
latents_for_video = latents_for_video[:, :, :-n_trim_latents, :, :]
|
| 260 |
|
| 261 |
elif is_penultimate_fragment:
|
| 262 |
if echo_frames > 0 and latents_for_video.shape[2] > echo_frames:
|
| 263 |
+
latents_for_video = latents_for_video[:, :, :echo_frames, :, :]
|
| 264 |
|
| 265 |
|
| 266 |
if n_trim_latents > 0 and latents_for_video.shape[2] > n_trim_latents:
|
| 267 |
+
latents_for_video = latents_for_video[:, :, :-n_trim_latents, :, :]
|
| 268 |
|
| 269 |
else:
|
| 270 |
if echo_frames > 0 and latents_for_video.shape[2] > echo_frames:
|
| 271 |
+
latents_for_video = latents_for_video[:, :, :echo_frames, :, :]
|
| 272 |
|
| 273 |
video_with_audio_path = self._generate_video_and_audio_from_latents(latents_for_video, audio_prompt, base_name)
|
| 274 |
video_clips_paths.append(video_with_audio_path)
|