@@ -84,26 +84,29 @@ def prepare_current_keyframes(self, x: Tensor, timestep: Tensor, transformer_opt
8484 self .sample_settings .custom_cfg .prepare_current_keyframe (t = timestep , transformer_options = transformer_options )
8585
8686 def perform_special_model_features (self , conds : list , x_in : Tensor , model_options : dict [str ]):
87- # despite there be
87+ # make sure multigpu clones of same model are not causing duplicate wraps
8888 clone_uuids = set ()
8989 for device , motion_models in self .motion_models_devices .items ():
9090 model : BaseModel = self .model_patcher_devices [device ].model
9191 special_models = motion_models .get_special_models ()
9292 if len (special_models ) > 0 :
9393 for special_model in special_models :
94+ has_clone_base_uuid = hasattr (special_model , "clone_base_uuid" ) # backwards compatibility
9495 if special_model .model .is_in_effect ():
9596 attachment = get_mm_attachment (special_model )
9697 if attachment .is_pia (special_model ):
9798 special_model .model .inject_unet_conv_in_pia_fancyvideo (model )
98- if special_model .clone_base_uuid not in clone_uuids :
99- clone_uuids .add (special_model .clone_base_uuid )
99+ if not has_clone_base_uuid or special_model .clone_base_uuid not in clone_uuids :
100+ if has_clone_base_uuid :
101+ clone_uuids .add (special_model .clone_base_uuid )
100102 conds = get_conds_with_c_concat (conds ,
101103 attachment .get_pia_c_concat (model , x_in ))
102104 elif attachment .is_fancyvideo (special_model ):
103105 # TODO: handle other weights
104106 special_model .model .inject_unet_conv_in_pia_fancyvideo (model )
105- if special_model .clone_base_uuid not in clone_uuids :
106- clone_uuids .add (special_model .clone_base_uuid )
107+ if not has_clone_base_uuid or special_model .clone_base_uuid not in clone_uuids :
108+ if has_clone_base_uuid :
109+ clone_uuids .add (special_model .clone_base_uuid )
107110 conds = get_conds_with_c_concat (conds ,
108111 attachment .get_fancy_c_concat (model , x_in ))
109112 # add fps_embedding/motion_embedding patches
0 commit comments