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 5
5
from diffusers .configuration_utils import ConfigMixin , register_to_config
6
6
from diffusers .loaders .single_file_model import FromOriginalModelMixin
7
7
from 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
+ )
9
13
from diffusers .models .embeddings import (
10
14
TextImageProjection ,
11
15
TextImageTimeEmbedding ,
@@ -775,7 +779,15 @@ def forward(
775
779
776
780
777
781
diffusers .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
779
791
780
792
781
793
# patch LoRACompatibleConv to use original Conv2D forward function
You can’t perform that action at this time.
0 commit comments