File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
src/diffusers/pipelines/wan Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -526,17 +526,11 @@ def prepare_video_latents(
526526 latents = ((latents .float () - latents_mean ) * latents_std ).to (vae_dtype )
527527 else :
528528 mask = mask .to (dtype = vae_dtype )
529- mask = torch .where (mask > 0.5 , 1.0 , 0.0 )
530-
531- inactive : torch .Tensor = video * (1 - mask )
532- reactive : torch .Tensor = video * mask
533-
534- inactive = inactive .to (dtype = vae_dtype )
535- reactive = reactive .to (dtype = vae_dtype )
536-
529+ mask = torch .where (mask > 0.5 , 1.0 , 0.0 ).to (dtype = vae_dtype )
530+ inactive = video * (1 - mask )
531+ reactive = video * mask
537532 inactive = retrieve_latents (self .vae .encode (inactive ), generator , sample_mode = "argmax" )
538533 reactive = retrieve_latents (self .vae .encode (reactive ), generator , sample_mode = "argmax" )
539-
540534 inactive = ((inactive .float () - latents_mean ) * latents_std ).to (vae_dtype )
541535 reactive = ((reactive .float () - latents_mean ) * latents_std ).to (vae_dtype )
542536 latents = torch .cat ([inactive , reactive ], dim = 1 )
You can’t perform that action at this time.
0 commit comments