Fix case of ExecutionBlocker not handled correctly with INPUT_IS_LIST.

This commit is contained in:
comfyanonymous 2024-12-15 08:41:35 -05:00
parent 1b3a650f19
commit 6d1a3f7d00

View File

@ -144,11 +144,16 @@ def _map_node_over_list(obj, input_data_all, func, allow_interrupt=False, execut
return {k: v[i if len(v) > i else -1] for k, v in d.items()} return {k: v[i if len(v) > i else -1] for k, v in d.items()}
results = [] results = []
def process_inputs(inputs, index=None): def process_inputs(inputs, index=None, input_is_list=False):
if allow_interrupt: if allow_interrupt:
nodes.before_node_execution() nodes.before_node_execution()
execution_block = None execution_block = None
for k, v in inputs.items(): for k, v in inputs.items():
if input_is_list:
for e in v:
if isinstance(e, ExecutionBlocker):
v = e
break
if isinstance(v, ExecutionBlocker): if isinstance(v, ExecutionBlocker):
execution_block = execution_block_cb(v) if execution_block_cb else v execution_block = execution_block_cb(v) if execution_block_cb else v
break break
@ -160,7 +165,7 @@ def _map_node_over_list(obj, input_data_all, func, allow_interrupt=False, execut
results.append(execution_block) results.append(execution_block)
if input_is_list: if input_is_list:
process_inputs(input_data_all, 0) process_inputs(input_data_all, 0, input_is_list=input_is_list)
elif max_len_input == 0: elif max_len_input == 0:
process_inputs({}) process_inputs({})
else: else: