WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit a4226db

Browse files
committed
Removed redundant code - dynamic stuff no longer happens in OOP way
1 parent 90f17a2 commit a4226db

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

comfy_api/latest/_io.py

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,10 +1351,9 @@ def finalize(self):
13511351
if output.id is None:
13521352
output.id = f"_{i}_{output.io_type}_"
13531353

1354-
def get_v1_info(self, cls, live_inputs: dict[str, Any]=None) -> NodeInfoV1:
1355-
# NOTE: live_inputs will not be used anymore very soon and this will be done another way
1354+
def get_v1_info(self, cls) -> NodeInfoV1:
13561355
# get V1 inputs
1357-
input = create_input_dict_v1(self.inputs, live_inputs)
1356+
input = create_input_dict_v1(self.inputs)
13581357
if self.hidden:
13591358
for hidden in self.hidden:
13601359
input.setdefault("hidden", {})[hidden.name] = (hidden.value,)
@@ -1468,33 +1467,20 @@ def parse_class_inputs(out_dict: dict[str, Any], live_inputs: dict[str, Any], cu
14681467
if curr_prefix:
14691468
out_dict["dynamic_paths"][finalized_id] = finalized_id
14701469

1471-
def create_input_dict_v1(inputs: list[Input], live_inputs: dict[str, Any]=None) -> dict:
1470+
def create_input_dict_v1(inputs: list[Input]) -> dict:
14721471
input = {
14731472
"required": {}
14741473
}
1475-
add_to_input_dict_v1(input, inputs, live_inputs)
1476-
return input
1477-
1478-
def add_to_input_dict_v1(d: dict[str, Any], inputs: list[Input], live_inputs: dict[str, Any]=None, curr_prefix: list[str] | None=None):
14791474
for i in inputs:
1480-
if isinstance(i, DynamicInput):
1481-
add_to_dict_v1(i, d, curr_prefix=curr_prefix)
1482-
if live_inputs is not None:
1483-
i.expand_schema_for_dynamic(d, live_inputs, curr_prefix)
1484-
else:
1485-
add_to_dict_v1(i, d, curr_prefix=curr_prefix)
1475+
add_to_dict_v1(i, input)
1476+
return input
14861477

1487-
def add_to_dict_v1(i: Input, d: dict, dynamic_dict: dict=None, curr_prefix: list[str] | None=None):
1478+
def add_to_dict_v1(i: Input, d: dict):
14881479
key = "optional" if i.optional else "required"
14891480
as_dict = i.as_dict()
14901481
# for v1, we don't want to include the optional key
14911482
as_dict.pop("optional", None)
1492-
if dynamic_dict is None:
1493-
value = (i.get_io_type(), as_dict)
1494-
else:
1495-
value = (i.get_io_type(), as_dict, dynamic_dict)
1496-
actual_id = finalize_prefix(curr_prefix, i.id)
1497-
d.setdefault(key, {})[actual_id] = value
1483+
d.setdefault(key, {})[i.id] = (i.get_io_type(), as_dict)
14981484

14991485
def add_to_dict_v3(io: Input | Output, d: dict):
15001486
d[io.id] = (io.get_io_type(), io.as_dict())

0 commit comments

Comments
 (0)