> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-docs-scavio-google-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Image With Team

> Legacy DalleTools team example for prompt refinement and image generation.

The source-fidelity team uses `DalleTools`, whose supported DALL-E models are deprecated. Migrate the image member to GPT Image 2 before use.

<Warning>
  DALL-E models are deprecated. This source-fidelity example is preserved for reference and should not be run as written. Use [Image Generation Agent](/models/providers/native/openai/responses/usage/image-generation-agent) with GPT Image 2.
</Warning>

```python generate_image_with_team.py theme={null}
"""
Generate Image With Team
========================

Demonstrates collaborative prompt optimization and DALL-E image generation.
"""

from typing import Iterator

from agno.agent import Agent, RunOutputEvent
from agno.models.openai import OpenAIResponses
from agno.team import Team
from agno.tools.dalle import DalleTools
from agno.utils.common import dataclass_to_dict
from rich.pretty import pprint

# ---------------------------------------------------------------------------
# Create Members
# ---------------------------------------------------------------------------
image_generator = Agent(
    name="Image Creator",
    role="Generate images using DALL-E",
    model=OpenAIResponses(id="gpt-5.2"),
    tools=[DalleTools()],
    instructions=[
        "Use the DALL-E tool to create high-quality images",
        "Return image URLs in markdown format: `![description](URL)`",
    ],
)

prompt_engineer = Agent(
    name="Prompt Engineer",
    role="Optimize and enhance image generation prompts",
    model=OpenAIResponses(id="gpt-5.2"),
    instructions=[
        "Enhance user prompts for better image generation results",
        "Consider artistic style, composition, and technical details",
    ],
)

# ---------------------------------------------------------------------------
# Create Team
# ---------------------------------------------------------------------------
image_team = Team(
    name="Image Generation Team",
    model=OpenAIResponses(id="gpt-5.2"),
    members=[prompt_engineer, image_generator],
    instructions=[
        "Generate high-quality images from user prompts.",
        "Prompt Engineer: First enhance and optimize the user's prompt.",
        "Image Creator: Generate images using the enhanced prompt with DALL-E.",
    ],
    markdown=True,
)

# ---------------------------------------------------------------------------
# Run Team
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    run_stream: Iterator[RunOutputEvent] = image_team.run(
        "Create an image of a yellow siamese cat",
        stream=True,
        stream_events=True,
    )
    for chunk in run_stream:
        pprint(dataclass_to_dict(chunk, exclude={"messages"}))
        print("---" * 20)
```

## Current Alternative

Follow [Image Generation Agent](/models/providers/native/openai/responses/usage/image-generation-agent) to generate images with GPT Image 2.

Full source: [cookbook/03\_teams/19\_multimodal/generate\_image\_with\_team.py](https://github.com/agno-agi/agno/blob/main/cookbook/03_teams/19_multimodal/generate_image_with_team.py)
