Do vae tiling when decoding wan models with low vram active.

This commit is contained in:
Jaret Burkett 2026-07-10 08:02:32 -06:00
parent fed9357234
commit 883d60eb71
2 changed files with 113 additions and 1396 deletions

View File

@ -205,6 +205,10 @@ class Wan225bModel(Wan21):
latent_model_input=latents, first_frame=first_frame_n1p1, vae=self.vae
)
if self.model_config.low_vram:
# set vae to tile decode
pipeline.vae.enable_tiling()
output = pipeline(
prompt_embeds=conditional_embeds.text_embeds.to(
self.device_torch, dtype=self.torch_dtype
@ -225,6 +229,10 @@ class Wan225bModel(Wan21):
**extra,
)[0]
if self.model_config.low_vram:
# restore no tiling
pipeline.vae.disable_tiling()
# shape = [1, frames, channels, height, width]
batch_item = output[0] # list of pil images
if gen_config.num_frames > 1:

File diff suppressed because it is too large Load Diff