diff --git a/gallery/meme.json b/gallery/meme.json index 950dee56f..59637dbf3 100644 --- a/gallery/meme.json +++ b/gallery/meme.json @@ -262,7 +262,6 @@ "name": "ImageComposition", "data": { "args": { - "image_urls": [], "titles": "['我的朋友认为我...', '我的父母认为我...', '实际上我...']", "output_path": "meme.jpg", "row": 1, diff --git a/gallery/story.json b/gallery/story.json index f2e0e9d02..44085b11e 100644 --- a/gallery/story.json +++ b/gallery/story.json @@ -432,7 +432,6 @@ "name": "ImageComposition", "data": { "args": { - "image_urls": [], "titles": "[\"第一幕\", \"第二幕\", \"第三幕\", \"第四幕\"]", "output_path": "test.png", "row": 2, diff --git a/src/agentscope/studio/static/js/workstation.js b/src/agentscope/studio/static/js/workstation.js index 852dd814a..85ab5c791 100644 --- a/src/agentscope/studio/static/js/workstation.js +++ b/src/agentscope/studio/static/js/workstation.js @@ -831,7 +831,6 @@ async function addNodeToDrawFlow(name, pos_x, pos_y) { editor.addNode('ImageComposition', 1, 1, pos_x, pos_y, 'ImageComposition', { "args": { - "image_urls": [], "titles": "", "output_path": "", "row": 1, diff --git a/src/agentscope/web/workstation/workflow_dag.py b/src/agentscope/web/workstation/workflow_dag.py index 1621b4d41..87ccdb227 100644 --- a/src/agentscope/web/workstation/workflow_dag.py +++ b/src/agentscope/web/workstation/workflow_dag.py @@ -110,9 +110,11 @@ def run(self) -> None: ] if not inputs: values[node_id] = self.exec_node(node_id) - elif len(inputs): + elif len(inputs) == 1: # Note: only support exec with the first predecessor now values[node_id] = self.exec_node(node_id, inputs[0]) + elif len(inputs) > 1: + values[node_id] = self.exec_node(node_id, inputs) else: raise ValueError("Too many predecessors!") diff --git a/src/agentscope/web/workstation/workflow_node.py b/src/agentscope/web/workstation/workflow_node.py index a231a1a3d..31d08affe 100644 --- a/src/agentscope/web/workstation/workflow_node.py +++ b/src/agentscope/web/workstation/workflow_node.py @@ -3,7 +3,7 @@ from abc import ABC, abstractmethod from enum import IntEnum from functools import partial -from typing import List, Optional +from typing import List, Optional, Any from agentscope import msghub from agentscope.agents import ( @@ -95,7 +95,7 @@ def __init__( if is_callable_expression(value): self.opt_kwargs[key] = convert_str_to_callable(value) - def __call__(self, x: dict = None): # type: ignore[no-untyped-def] + def __call__(self, x: Any = None): # type: ignore[no-untyped-def] """ Invokes the node's operations with the provided input. @@ -1087,7 +1087,9 @@ def __init__( ) self.pipeline = partial(stitch_images_with_grid, **self.opt_kwargs) - def __call__(self, x: dict = None) -> dict: + def __call__(self, x: list = None) -> dict: + if isinstance(x, dict): + x = [x] return self.pipeline(x) def compile(self) -> dict: