Skip to content

Commit 7907359

Browse files
committed
comments
1 parent 0178d77 commit 7907359

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/diffusers/pipelines/ltx/pipeline_ltx_video2video.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ def prepare_latents(
463463
width = width // self.vae_spatial_compression_ratio
464464

465465
# TODO: should video_processor take care of it? Because for Cog, we get a 5D tensor here.
466+
# `video` memory layout is (num_frames, num_channels, height, width)
466467
if video.ndim == 4:
467468
video = video.unsqueeze(0)
468469

@@ -490,7 +491,7 @@ def prepare_latents(
490491
retrieve_latents(self.vae.encode(video[i].unsqueeze(0).permute(0, 2, 1, 3, 4)), generator[i])
491492
for i in range(batch_size)
492493
]
493-
else:
494+
else: # `premute()` because we want `batch_size, num_channels, num_frames, height, width`
494495
init_latents = [
495496
retrieve_latents(self.vae.encode(vid.unsqueeze(0).permute(0, 2, 1, 3, 4)), generator) for vid in video
496497
]

0 commit comments

Comments
 (0)