-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Description
I want to create a node in which a picture will be generated in parallel, how do I do this?
async def handle_generate_image(
args: FlowArgs, flow_manager: FlowManager
) -> tuple[None, NodeConfig]:
"""Handler for start_interview function"""
logger.info("----> Generating image...")
async with aiohttp.ClientSession() as session:
image_gen_service = OpenAIImageGenService(
api_key=config.openai_api_key,
aiohttp_session=session,
image_size="1024x1024",
)
async for i in image_gen_service.run_image_gen(
"draw gnomes having fun in the forest"
):
await flow_manager.task.queue_frame(i)
return None, None
generate_image_func = FlowsFunctionSchema(
handler=handle_generate_image,
name="generate_image",
description="Generate an image based on a context story",
properties={},
required=[],
)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels