11
11
from .utils_motion import ADKeyframeGroup , get_combined_multival
12
12
from .motion_lora import MotionLoraInfo , MotionLoraList
13
13
from .motion_module_ad import AllPerBlocks
14
- from .model_injection import (ModelPatcherHelper , InjectionParams , MotionModelGroup ,
14
+ from .model_injection import (ModelPatcherHelper , InjectionParams , MotionModelGroup , get_mm_attachment ,
15
15
load_motion_lora_as_patches , load_motion_module_gen1 , load_motion_module_gen2 , validate_model_compatibility_gen2 ,
16
16
validate_per_block_compatibility )
17
17
from .sample_settings import SampleSettings , SeedNoiseGeneration
@@ -59,12 +59,13 @@ def load_mm_and_inject_params(self,
59
59
if motion_lora is not None :
60
60
for lora in motion_lora .loras :
61
61
load_motion_lora_as_patches (motion_model , lora )
62
- motion_model .scale_multival = scale_multival
63
- motion_model .effect_multival = effect_multival
62
+ attachment = get_mm_attachment (motion_model )
63
+ attachment .scale_multival = scale_multival
64
+ attachment .effect_multival = effect_multival
64
65
if per_block is not None :
65
66
validate_per_block_compatibility (motion_model = motion_model , all_per_blocks = per_block )
66
- motion_model .per_block_list = per_block .per_block_list
67
- motion_model .keyframes = ad_keyframes .clone () if ad_keyframes else ADKeyframeGroup ()
67
+ attachment .per_block_list = per_block .per_block_list
68
+ attachment .keyframes = ad_keyframes .clone () if ad_keyframes else ADKeyframeGroup ()
68
69
69
70
# create injection params
70
71
params = InjectionParams (unlimited_area_hack = False )
@@ -80,7 +81,7 @@ def load_mm_and_inject_params(self,
80
81
81
82
# backwards compatibility to support old way of masking scale
82
83
if params .motion_model_settings .mask_attn_scale is not None :
83
- motion_model .scale_multival = get_combined_multival (scale_multival , (params .motion_model_settings .mask_attn_scale * params .motion_model_settings .attn_scale ))
84
+ attachment .scale_multival = get_combined_multival (scale_multival , (params .motion_model_settings .mask_attn_scale * params .motion_model_settings .attn_scale ))
84
85
85
86
# need to use a ModelPatcher that supports injection of motion modules into unet
86
87
model = model .clone ()
@@ -134,6 +135,7 @@ def INPUT_TYPES(s):
134
135
}
135
136
}
136
137
138
+ DEPRECATED = True
137
139
RETURN_TYPES = ("MODEL" ,)
138
140
CATEGORY = "Animate Diff 🎭🅐🅓/① Gen1 nodes ①"
139
141
FUNCTION = "load_mm_and_inject_params"
@@ -161,12 +163,13 @@ def load_mm_and_inject_params(self,
161
163
motion_model_settings .attn_scale = motion_scale
162
164
params .set_motion_model_settings (motion_model_settings )
163
165
166
+ attachment = get_mm_attachment (motion_model )
164
167
if params .motion_model_settings .mask_attn_scale is not None :
165
- motion_model .scale_multival = params .motion_model_settings .mask_attn_scale * params .motion_model_settings .attn_scale
168
+ attachment .scale_multival = params .motion_model_settings .mask_attn_scale * params .motion_model_settings .attn_scale
166
169
else :
167
- motion_model .scale_multival = params .motion_model_settings .attn_scale
170
+ attachment .scale_multival = params .motion_model_settings .attn_scale
168
171
169
- motion_model .keyframes = ad_keyframes .clone () if ad_keyframes else ADKeyframeGroup ()
172
+ attachment .keyframes = ad_keyframes .clone () if ad_keyframes else ADKeyframeGroup ()
170
173
171
174
# need to use a ModelPatcher that supports injection of motion modules into unet
172
175
model = model .clone ()
0 commit comments