Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit14824e3

Browse files
authored
Merge pull request#77 from pydn/kwargs-hotfix
Kwargs hotfix
2 parents39c2229 +ea32a8f commit14824e3

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

‎comfyui_to_python.py‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,18 @@ def generate_workflow(
211211
foridx,data,is_special_functioninload_order:
212212
# Generate class definition and inputs from the data
213213
inputs,class_type=data["inputs"],data["class_type"]
214+
input_types=self.node_class_mappings[class_type].INPUT_TYPES()
214215
class_def=self.node_class_mappings[class_type]()
215216

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"ininput_types.keys():
220+
forrequiredininput_types["required"]:
221+
ifrequirednotininputs.keys():
222+
missing_required_variable=True
223+
ifmissing_required_variable:
224+
continue
225+
216226
# If the class hasn't been initialized yet, initialize it and generate the import statements
217227
ifclass_typenotininitialized_objects:
218228
# No need to use preview image nodes since we are executing the script in a terminal
@@ -242,7 +252,12 @@ def generate_workflow(
242252
ifno_paramsorkeyinclass_def_params
243253
}
244254
# Deal with hidden variables
245-
ifclass_def_paramsisnotNone:
255+
if (
256+
"hidden"ininput_types.keys()
257+
and"unique_id"ininput_types["hidden"].keys()
258+
):
259+
inputs["unique_id"]=random.randint(1,2**64)
260+
elifclass_def_paramsisnotNone:
246261
if"unique_id"inclass_def_params:
247262
inputs["unique_id"]=random.randint(1,2**64)
248263

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp