File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed 
src/diffusers/pipelines/wan Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -113,9 +113,11 @@ def retrieve_latents(
113113    latents_mean : torch .Tensor ,
114114    latents_std : torch .Tensor ,
115115    generator : Optional [torch .Generator ] =  None ,
116-     sample_mode : str  =  "sample " ,
116+     sample_mode : str  =  "none " ,
117117):
118-     if  hasattr (encoder_output , "latent_dist" ) and  sample_mode  ==  "sample" :
118+     if  hasattr (encoder_output , "latent_dist" ) and  sample_mode  ==  "none" :
119+         return  (encoder_output .latent_dist .mean  -  latents_mean ) *  latents_std 
120+     elif  hasattr (encoder_output , "latent_dist" ) and  sample_mode  ==  "sample" :
119121        encoder_output .latent_dist .mean  =  (encoder_output .latent_dist .mean  -  latents_mean ) *  latents_std 
120122        encoder_output .latent_dist .logvar  =  torch .clamp (
121123            (encoder_output .latent_dist .logvar  -  latents_mean ) *  latents_std , - 30.0 , 20.0 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments