Skip to content

Commit e27142a

Browse files
authored
[Wan] Fix VAE sampling mode in WanVideoToVideoPipeline (#11639)
* fix: vae sampling mode * fix a typo
1 parent 8e88495 commit e27142a

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/diffusers/pipelines/wan/pipeline_wan_video2video.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -419,12 +419,7 @@ def prepare_latents(
419419
)
420420

421421
if latents is None:
422-
if isinstance(generator, list):
423-
init_latents = [
424-
retrieve_latents(self.vae.encode(video[i].unsqueeze(0)), generator[i]) for i in range(batch_size)
425-
]
426-
else:
427-
init_latents = [retrieve_latents(self.vae.encode(vid.unsqueeze(0)), generator) for vid in video]
422+
init_latents = [retrieve_latents(self.vae.encode(vid.unsqueeze(0)), sample_mode="argmax") for vid in video]
428423

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

@@ -441,7 +436,7 @@ def prepare_latents(
441436
if hasattr(self.scheduler, "add_noise"):
442437
latents = self.scheduler.add_noise(init_latents, noise, timestep)
443438
else:
444-
latents = self.scheduelr.scale_noise(init_latents, timestep, noise)
439+
latents = self.scheduler.scale_noise(init_latents, timestep, noise)
445440
else:
446441
latents = latents.to(device)
447442

0 commit comments

Comments
 (0)