@@ -263,6 +263,54 @@ def run(self, image, tracking_points, **kwargs):
263263 return (image , tracking_points , )
264264
265265
266+ MAX_IMAGE_COUNT = 50
267+
268+ class BatchCreativeInterpolationNodeDynamicSettings :
269+ @classmethod
270+ def INPUT_TYPES (s ):
271+ inputs = {
272+ "required" : {
273+ "image_count" : ("INT" , {"default" : 1 , "min" : 1 , "max" : MAX_IMAGE_COUNT , "step" : 1 }),
274+ },
275+ }
276+
277+ for i in range (1 , MAX_IMAGE_COUNT ):
278+ if i == 1 :
279+ inputs ["required" ][f"frame_distribution_{ i } " ] = ("INT" , {"default" : 4 , "min" : 4 , "max" : 64 , "step" : 1 })
280+ else :
281+ inputs ["required" ][f"frame_distribution_{ i } " ] = ("INT" , {"default" : 16 , "min" : 4 , "max" : 64 , "step" : 1 })
282+
283+ inputs ["required" ][f"key_frame_influence_{ i } " ] = ("FLOAT" , {"default" : 1.0 , "min" : 0.0 , "max" : 10.0 , "step" : 0.1 })
284+ inputs ["required" ][f"min_strength_value_{ i } " ] = ("FLOAT" , {"default" : 0.0 , "min" : 0.0 , "max" : 1.0 , "step" : 0.1 })
285+ inputs ["required" ][f"max_strength_value_{ i } " ] = ("FLOAT" , {"default" : 1.0 , "min" : 0.0 , "max" : 1.0 , "step" : 0.1 })
286+
287+ return inputs
288+
289+ RETURN_TYPES = ("STRING" , "STRING" , "STRING" ,)
290+ RETURN_NAMES = ("dynamic_frame_distribution_values" , "dynamic_key_frame_influence_values" , "dynamic_strength_values" ,)
291+
292+ FUNCTION = "run"
293+
294+ def run (self , image_count , ** kwargs ):
295+ dynamic_frame_distribution_values = ""
296+ dynamic_key_frame_influence_values = ""
297+ dynamic_strength_values = ""
298+
299+ previous_frame_distribution = 0
300+
301+ for i in range (1 , image_count + 1 ):
302+ previous_frame_distribution += kwargs .get (f"frame_distribution_{ i } " , 0 )
303+
304+ distribution_value = str (previous_frame_distribution ) + ","
305+ influence_value = str (kwargs .get (f"key_frame_influence_{ i } " )) + ","
306+ strength_value = "({min},{max})," .format (min = kwargs .get (f"min_strength_value_{ i } " ), max = kwargs .get (f"max_strength_value_{ i } " ))
307+
308+ dynamic_frame_distribution_values += distribution_value
309+ dynamic_key_frame_influence_values += influence_value
310+ dynamic_strength_values += strength_value
311+
312+ return (dynamic_frame_distribution_values [:- 1 ], dynamic_key_frame_influence_values [:- 1 ], dynamic_strength_values [:- 1 ],)
313+
266314__all__ = [
267315 "To" ,
268316 "From" ,
@@ -271,4 +319,5 @@ def run(self, image, tracking_points, **kwargs):
271319 "FlowBuilder" ,
272320 "FlowBuilderSetter" ,
273321 "DragNUWAImageCanvas" ,
322+ "BatchCreativeInterpolationNodeDynamicSettings" ,
274323]
0 commit comments