File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1717
1818import  torch 
1919
20+ from  ..configuration_utils  import  register_to_config 
2021from  .guider_utils  import  BaseGuidance , rescale_noise_cfg 
2122
2223
@@ -67,6 +68,7 @@ class ClassifierFreeGuidance(BaseGuidance):
6768
6869    _input_predictions  =  ["pred_cond" , "pred_uncond" ]
6970
71+     @register_to_config  
7072    def  __init__ (
7173        self ,
7274        guidance_scale : float  =  7.5 ,
Original file line number Diff line number Diff line change 1616
1717import  torch 
1818
19+ from  ..configuration_utils  import  ConfigMixin 
1920from  ..utils  import  get_logger 
2021
2122
2223if  TYPE_CHECKING :
2324    from  ..modular_pipelines .modular_pipeline  import  BlockState 
2425
2526
27+ GUIDER_CONFIG_NAME  =  "guider_config.json" 
28+ 
29+ 
2630logger  =  get_logger (__name__ )  # pylint: disable=invalid-name 
2731
2832
29- class  BaseGuidance :
33+ class  BaseGuidance ( ConfigMixin ) :
3034    r"""Base class providing the skeleton for implementing guidance techniques.""" 
3135
36+     config_name  =  GUIDER_CONFIG_NAME 
3237    _input_predictions  =  None 
3338    _identifier_key  =  "__guidance_identifier__" 
3439
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments