Skip to content

Commit

Permalink
fix(api/core/workflow/nodes/iteration/iteration_node.py): Extend outp…
Browse files Browse the repository at this point in the history
…ut in iteration if output is a array. (#6647)

Signed-off-by: -LAN- <[email protected]>
  • Loading branch information
laipz8200 authored Jul 24, 2024
1 parent fb5e366 commit 4ec9a87
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/core/workflow/nodes/iteration/iteration_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ def _resolve_current_output(self, variable_pool: VariablePool, state: IterationS
variable_pool.remove([self.node_id] + output_selector[1:])
state.current_output = output
if output is not None:
state.outputs.append(output)
# NOTE: This is a temporary patch to process double nested list (for example, DALL-E output in iteration).
if isinstance(output, list):
state.outputs.extend(output)
else:
state.outputs.append(output)

@classmethod
def _extract_variable_selector_to_variable_mapping(cls, node_data: IterationNodeData) -> dict[str, list[str]]:
Expand Down

0 comments on commit 4ec9a87

Please sign in to comment.