@@ -26,6 +26,7 @@ def INPUT_TYPES(s):
2626 "bg_color" : ("STRING" , {"default" : "#000000" , "multiline" : False }),
2727 "light_intensity" : ("INT" , {"default" : 10 , "min" : 1 , "max" : 20 , "step" : 1 }),
2828 "up_direction" : (["original" , "-x" , "+x" , "-y" , "+y" , "-z" , "+z" ],),
29+ "fov" : ("INT" , {"default" : 75 , "min" : 10 , "max" : 150 , "step" : 1 }),
2930 }}
3031
3132 RETURN_TYPES = ("IMAGE" , "MASK" , "STRING" )
@@ -37,13 +38,22 @@ def INPUT_TYPES(s):
3738 CATEGORY = "3d"
3839
3940 def process (self , model_file , image , ** kwargs ):
40- imagepath = folder_paths .get_annotated_filepath (image )
41-
42- load_image_node = nodes .LoadImage ()
43-
44- output_image , output_mask = load_image_node .load_image (image = imagepath )
45-
46- return output_image , output_mask , model_file ,
41+ if isinstance (image , dict ):
42+ image_path = folder_paths .get_annotated_filepath (image ['image' ])
43+ mask_path = folder_paths .get_annotated_filepath (image ['mask' ])
44+
45+ load_image_node = nodes .LoadImage ()
46+ output_image , ignore_mask = load_image_node .load_image (image = image_path )
47+ ignore_image , output_mask = load_image_node .load_image (image = mask_path )
48+
49+ return output_image , output_mask , model_file ,
50+ else :
51+ # to avoid the format is not dict which will happen the FE code is not compatibility to core,
52+ # we need to this to double-check, it can be removed after merged FE into the core
53+ image_path = folder_paths .get_annotated_filepath (image )
54+ load_image_node = nodes .LoadImage ()
55+ output_image , output_mask = load_image_node .load_image (image = image_path )
56+ return output_image , output_mask , model_file ,
4757
4858class Load3DAnimation ():
4959 @classmethod
@@ -67,6 +77,7 @@ def INPUT_TYPES(s):
6777 "light_intensity" : ("INT" , {"default" : 10 , "min" : 1 , "max" : 20 , "step" : 1 }),
6878 "up_direction" : (["original" , "-x" , "+x" , "-y" , "+y" , "-z" , "+z" ],),
6979 "animation_speed" : (["0.1" , "0.5" , "1" , "1.5" , "2" ], {"default" : "1" }),
80+ "fov" : ("INT" , {"default" : 75 , "min" : 10 , "max" : 150 , "step" : 1 }),
7081 }}
7182
7283 RETURN_TYPES = ("IMAGE" , "MASK" , "STRING" )
@@ -78,13 +89,20 @@ def INPUT_TYPES(s):
7889 CATEGORY = "3d"
7990
8091 def process (self , model_file , image , ** kwargs ):
81- imagepath = folder_paths . get_annotated_filepath (image )
82-
83- load_image_node = nodes . LoadImage ( )
92+ if isinstance (image , dict ):
93+ image_path = folder_paths . get_annotated_filepath ( image [ 'image' ])
94+ mask_path = folder_paths . get_annotated_filepath ( image [ 'mask' ] )
8495
85- output_image , output_mask = load_image_node .load_image (image = imagepath )
96+ load_image_node = nodes .LoadImage ()
97+ output_image , ignore_mask = load_image_node .load_image (image = image_path )
98+ ignore_image , output_mask = load_image_node .load_image (image = mask_path )
8699
87- return output_image , output_mask , model_file ,
100+ return output_image , output_mask , model_file ,
101+ else :
102+ image_path = folder_paths .get_annotated_filepath (image )
103+ load_image_node = nodes .LoadImage ()
104+ output_image , output_mask = load_image_node .load_image (image = image_path )
105+ return output_image , output_mask , model_file ,
88106
89107class Preview3D ():
90108 @classmethod
@@ -98,6 +116,7 @@ def INPUT_TYPES(s):
98116 "bg_color" : ("STRING" , {"default" : "#000000" , "multiline" : False }),
99117 "light_intensity" : ("INT" , {"default" : 10 , "min" : 1 , "max" : 20 , "step" : 1 }),
100118 "up_direction" : (["original" , "-x" , "+x" , "-y" , "+y" , "-z" , "+z" ],),
119+ "fov" : ("INT" , {"default" : 75 , "min" : 10 , "max" : 150 , "step" : 1 }),
101120 }}
102121
103122 OUTPUT_NODE = True
0 commit comments