Do vae tiling when decoding wan models with low vram active.
This commit is contained in:
parent
fed9357234
commit
883d60eb71
|
|
@ -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
Loading…
Reference in New Issue