> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Images

> Image generation using PraisonAI capabilities

## Overview

Generate images from text prompts using DALL-E and other image generation models.

## Python Usage

### Basic Image Generation

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai.capabilities import image_generate

result = image_generate(
    prompt="A sunset over mountains",
    model="dall-e-3",
    size="1024x1024"
)

print(f"URL: {result[0].url}")
print(f"Revised prompt: {result[0].revised_prompt}")
```

### DALL-E 2 (Faster, Lower Cost)

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai.capabilities import image_generate

result = image_generate(
    prompt="A blue circle on white background",
    model="dall-e-2",
    size="256x256",
    n=1
)

print(f"URL: {result[0].url}")
```

### Save Image to File

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai.capabilities import image_generate

result = image_generate(
    prompt="A beautiful landscape",
    model="dall-e-3"
)

# Save to file
result[0].save("landscape.png")
```

### Async Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import asyncio
from praisonai.capabilities import aimage_generate

async def main():
    result = await aimage_generate(
        prompt="A futuristic city",
        model="dall-e-3"
    )
    print(f"URL: {result[0].url}")

asyncio.run(main())
```

## Parameters

| Parameter         | Type  | Default     | Description                          |
| ----------------- | ----- | ----------- | ------------------------------------ |
| `prompt`          | str   | Required    | Image description                    |
| `model`           | str   | "dall-e-3"  | Model to use                         |
| `n`               | int   | 1           | Number of images                     |
| `size`            | str   | "1024x1024" | Image size                           |
| `quality`         | str   | "standard"  | "standard" or "hd" (DALL-E 3 only)   |
| `style`           | str   | None        | "vivid" or "natural" (DALL-E 3 only) |
| `response_format` | str   | "url"       | "url" or "b64\_json"                 |
| `timeout`         | float | 600.0       | Request timeout                      |

## Result Object

The `ImageResult` object contains:

* `url`: Image URL
* `b64_json`: Base64 encoded image (if requested)
* `revised_prompt`: DALL-E 3's revised prompt
* `model`: Model used
* `save(path)`: Method to save image to file
