mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-02-08 22:49:58 +00:00
Force width, height, and num frames to always be the proper sizes for Wan 2.2 models
This commit is contained in:
@@ -73,6 +73,14 @@ class Wan22Pipeline(WanPipeline):
|
||||
|
||||
if isinstance(callback_on_step_end, (PipelineCallback, MultiPipelineCallbacks)):
|
||||
callback_on_step_end_tensor_inputs = callback_on_step_end.tensor_inputs
|
||||
|
||||
if num_frames % self.vae_scale_factor_temporal != 1:
|
||||
num_frames = num_frames // self.vae_scale_factor_temporal * self.vae_scale_factor_temporal + 1
|
||||
num_frames = max(num_frames, 1)
|
||||
|
||||
|
||||
width = width // (self.vae.config.scale_factor_spatial * 2) * (self.vae.config.scale_factor_spatial * 2)
|
||||
height = height // (self.vae.config.scale_factor_spatial * 2) * (self.vae.config.scale_factor_spatial * 2)
|
||||
|
||||
# unload vae and transformer
|
||||
vae_device = self.vae.device
|
||||
|
||||
Reference in New Issue
Block a user