Overview
Workflows allow you to sequentially chain agents together to process images. They provide a framework for executing and visualizing a sequence of image processing steps.Arguments
An immutable list of agents to serially execute
Example
Methods
Workflow.execute(input_image)
Executes the workflow on the given input image and returns the final results and the execution graph.Arguments:
input_image
(PIL.Image.Image
): The input image to be processed by the workflow.
result, graph
(Tuple[List[ExecutionNode], ExecutionGraph]
): A tuple containing the final execution nodes and the execution graph.
Workflow.visualize(graph)
Visualizes the workflow using the Gradio library, displaying each agent’s inputs and outputs in a structured format.Arguments:
graph
(ExecutionGraph
): The execution graph of the workflow.
- Spawns a Gradio instance that runs until it is closed.