File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 55from  diffusers .configuration_utils  import  ConfigMixin , register_to_config 
66from  diffusers .loaders .single_file_model  import  FromOriginalModelMixin 
77from  diffusers .models .attention_processor  import  AttentionProcessor , AttnProcessor 
8- from  diffusers .models .controlnet  import  ControlNetConditioningEmbedding , ControlNetOutput , zero_module 
8+ from  diffusers .models .controlnets .controlnet  import  (
9+     ControlNetConditioningEmbedding ,
10+     ControlNetOutput ,
11+     zero_module ,
12+ )
913from  diffusers .models .embeddings  import  (
1014    TextImageProjection ,
1115    TextImageTimeEmbedding ,
@@ -775,7 +779,15 @@ def forward(
775779
776780
777781diffusers .ControlNetModel  =  ControlNetModel 
778- diffusers .models .controlnet .ControlNetModel  =  ControlNetModel 
782+ # Patch both the new and legacy module paths for compatibility 
783+ try :
784+     diffusers .models .controlnets .controlnet .ControlNetModel  =  ControlNetModel 
785+ except  Exception :
786+     # Fallback for environments still exposing the legacy path 
787+     try :
788+         diffusers .models .controlnet .ControlNetModel  =  ControlNetModel 
789+     except  Exception :
790+         pass 
779791
780792
781793# patch LoRACompatibleConv to use original Conv2D forward function 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments