Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/diffusers/pipelines/wan/pipeline_wan_video2video.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,7 @@ def prepare_latents(
)

if latents is None:
if isinstance(generator, list):
init_latents = [
retrieve_latents(self.vae.encode(video[i].unsqueeze(0)), generator[i]) for i in range(batch_size)
]
else:
init_latents = [retrieve_latents(self.vae.encode(vid.unsqueeze(0)), generator) for vid in video]
init_latents = [retrieve_latents(self.vae.encode(vid.unsqueeze(0)), sample_mode="argmax") for vid in video]

init_latents = torch.cat(init_latents, dim=0).to(dtype)

Expand All @@ -441,7 +436,7 @@ def prepare_latents(
if hasattr(self.scheduler, "add_noise"):
latents = self.scheduler.add_noise(init_latents, noise, timestep)
else:
latents = self.scheduelr.scale_noise(init_latents, timestep, noise)
latents = self.scheduler.scale_noise(init_latents, timestep, noise)
else:
latents = latents.to(device)

Expand Down