Skip to main content
Generate images from natural language descriptions with PraisonAI Image Agents — sync or async, with DALL-E integration out of the box.
from praisonaiagents import ImageAgent

agent = ImageAgent(llm="dall-e-3")
agent.chat("A minimalist logo for a coffee shop")
The user describes an image; the image agent calls the generation API and returns a URL.

How It Works

Quick Start

1

Simple Usage

import os
from praisonaiagents import ImageAgent

agent = ImageAgent(llm="dall-e-3")
result = agent.chat("A cute baby sea otter playing with a laptop")
print(result)
Set OPENAI_API_KEY in your environment before running.
2

With Configuration

import os
from praisonaiagents import ImageAgent

agent = ImageAgent(
    name="ImageCreator",
    llm="dall-e-3",
    style="natural",
)

result = agent.chat("A minimalist logo for a coffee shop")
print(result)
3

Async

import asyncio
import os
from praisonaiagents import ImageAgent

async def main():
    agent = ImageAgent(name="ImageCreator", llm="dall-e-3", style="natural")
    result = await agent.achat("A cute baby sea otter playing with a laptop")
    print(result)

asyncio.run(main())
Install with LLM support: pip install "praisonaiagents[llm]"

Features

DALL-E Integration

Seamless integration with DALL-E for high-quality image generation.

Async Support

Asynchronous operations for better performance in concurrent environments.

Natural Style

Generate images with natural, realistic styling options.

Verbose Mode

Detailed output logging for better debugging and monitoring.

Best Practices

Read OPENAI_API_KEY from the environment — never hardcode keys in source files.
Use dall-e-3 for quality; switch models via the llm parameter when cost or speed matters more.
Use achat() when serving multiple concurrent image requests from a FastAPI or gateway handler.
Pass style="natural" or include style cues in the prompt for consistent visual output across runs.

Multimodal

Text, image, and audio processing with agents

Outbound Media Delivery

Deliver generated images to users via messaging bots