Skip to content

Commit 0516c07

Browse files
authored
Merge branch 'main' into pipeline_wan_img_embed
2 parents c047021 + 2c59af7 commit 0516c07

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/diffusers/pipelines/wan/pipeline_wan.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,13 @@ def __call__(
458458
callback_on_step_end_tensor_inputs,
459459
)
460460

461+
if num_frames % self.vae_scale_factor_temporal != 1:
462+
logger.warning(
463+
f"`num_frames - 1` has to be divisible by {self.vae_scale_factor_temporal}. Rounding to the nearest number."
464+
)
465+
num_frames = num_frames // self.vae_scale_factor_temporal * self.vae_scale_factor_temporal + 1
466+
num_frames = max(num_frames, 1)
467+
461468
self._guidance_scale = guidance_scale
462469
self._attention_kwargs = attention_kwargs
463470
self._current_timestep = None

src/diffusers/pipelines/wan/pipeline_wan_i2v.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,13 @@ def __call__(
579579
callback_on_step_end_tensor_inputs,
580580
)
581581

582+
if num_frames % self.vae_scale_factor_temporal != 1:
583+
logger.warning(
584+
f"`num_frames - 1` has to be divisible by {self.vae_scale_factor_temporal}. Rounding to the nearest number."
585+
)
586+
num_frames = num_frames // self.vae_scale_factor_temporal * self.vae_scale_factor_temporal + 1
587+
num_frames = max(num_frames, 1)
588+
582589
self._guidance_scale = guidance_scale
583590
self._attention_kwargs = attention_kwargs
584591
self._current_timestep = None

0 commit comments

Comments
 (0)