@@ -211,8 +211,18 @@ def generate_workflow(
211
211
for idx , data , is_special_function in load_order :
212
212
# Generate class definition and inputs from the data
213
213
inputs , class_type = data ["inputs" ], data ["class_type" ]
214
+ input_types = self .node_class_mappings [class_type ].INPUT_TYPES ()
214
215
class_def = self .node_class_mappings [class_type ]()
215
216
217
+ # If required inputs are not present, skip the node as it will break the code if passed through to the script
218
+ missing_required_variable = False
219
+ if "required" in input_types .keys ():
220
+ for required in input_types ["required" ]:
221
+ if required not in inputs .keys ():
222
+ missing_required_variable = True
223
+ if missing_required_variable :
224
+ continue
225
+
216
226
# If the class hasn't been initialized yet, initialize it and generate the import statements
217
227
if class_type not in initialized_objects :
218
228
# No need to use preview image nodes since we are executing the script in a terminal
@@ -242,7 +252,12 @@ def generate_workflow(
242
252
if no_params or key in class_def_params
243
253
}
244
254
# Deal with hidden variables
245
- if class_def_params is not None :
255
+ if (
256
+ "hidden" in input_types .keys ()
257
+ and "unique_id" in input_types ["hidden" ].keys ()
258
+ ):
259
+ inputs ["unique_id" ] = random .randint (1 , 2 ** 64 )
260
+ elif class_def_params is not None :
246
261
if "unique_id" in class_def_params :
247
262
inputs ["unique_id" ] = random .randint (1 , 2 ** 64 )
248
263
0 commit comments