Do vae tiling when decoding wan models with low vram active.
This commit is contained in:
@@ -205,6 +205,10 @@ class Wan225bModel(Wan21):
|
|||||||
latent_model_input=latents, first_frame=first_frame_n1p1, vae=self.vae
|
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(
|
output = pipeline(
|
||||||
prompt_embeds=conditional_embeds.text_embeds.to(
|
prompt_embeds=conditional_embeds.text_embeds.to(
|
||||||
self.device_torch, dtype=self.torch_dtype
|
self.device_torch, dtype=self.torch_dtype
|
||||||
@@ -225,6 +229,10 @@ class Wan225bModel(Wan21):
|
|||||||
**extra,
|
**extra,
|
||||||
)[0]
|
)[0]
|
||||||
|
|
||||||
|
if self.model_config.low_vram:
|
||||||
|
# restore no tiling
|
||||||
|
pipeline.vae.disable_tiling()
|
||||||
|
|
||||||
# shape = [1, frames, channels, height, width]
|
# shape = [1, frames, channels, height, width]
|
||||||
batch_item = output[0] # list of pil images
|
batch_item = output[0] # list of pil images
|
||||||
if gen_config.num_frames > 1:
|
if gen_config.num_frames > 1:
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user