File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -834,10 +834,11 @@ def __call__(
834834
835835        if  do_rf_inversion :
836836            y_0  =  image_latents .clone ()
837-         # 6. Denoising loop 
837+         # 6. Denoising loop / Controlled Reverse ODE, Algorithm 2 from: https://arxiv.org/pdf/2410.10792  
838838        with  self .progress_bar (total = num_inference_steps ) as  progress_bar :
839839            for  i , t  in  enumerate (timesteps ):
840840                if  do_rf_inversion :
841+                     # ti (current timestep) as annotated in algorithm 2 - i/num_inference_steps. 
841842                    t_i  =  1  -  t  /  1000 
842843                    dt  =  torch .tensor (1  /  (len (timesteps ) -  1 ), device = device )
843844
@@ -862,7 +863,6 @@ def __call__(
862863                latents_dtype  =  latents .dtype 
863864                if  do_rf_inversion :
864865                    v_t  =  - noise_pred 
865- 
866866                    v_t_cond  =  (y_0  -  latents ) /  (1  -  t_i )
867867                    eta_t  =  eta  if  start_timestep  <=  i  <  stop_timestep  else  0.0 
868868                    if  start_timestep  <=  i  <  stop_timestep :
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments