Skip to content

Commit 0ba5e3e

Browse files
yiyixuxua-r-r-o-w
andauthored
Update src/diffusers/pipelines/wan/pipeline_wan_i2v.py
Co-authored-by: Aryan <[email protected]>
1 parent d6b5614 commit 0ba5e3e

File tree

1 file changed

+15
-26
lines changed

1 file changed

+15
-26
lines changed

src/diffusers/pipelines/wan/pipeline_wan_i2v.py

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -695,34 +695,23 @@ def __call__(
695695
device, dtype=torch.float32
696696
)
697697

698+
prepared_latents = self.prepare_latents(
699+
image,
700+
batch_size * num_videos_per_prompt,
701+
num_channels_latents,
702+
height,
703+
width,
704+
num_frames,
705+
torch.float32,
706+
device,
707+
generator,
708+
latents,
709+
last_image,
710+
)
698711
if self.config.expand_timesteps:
699-
latents, condition, first_frame_mask = self.prepare_latents(
700-
image,
701-
batch_size * num_videos_per_prompt,
702-
num_channels_latents,
703-
height,
704-
width,
705-
num_frames,
706-
torch.float32,
707-
device,
708-
generator,
709-
latents,
710-
last_image,
711-
)
712+
latents, condition, first_frame_mask = prepared_latents
712713
else:
713-
latents, condition = self.prepare_latents(
714-
image,
715-
batch_size * num_videos_per_prompt,
716-
num_channels_latents,
717-
height,
718-
width,
719-
num_frames,
720-
torch.float32,
721-
device,
722-
generator,
723-
latents,
724-
last_image,
725-
)
714+
latents, condition = prepared_latents
726715

727716
# 6. Denoising loop
728717
num_warmup_steps = len(timesteps) - num_inference_steps * self.scheduler.order

0 commit comments

Comments
 (0)