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

# ImageAgent

> Image generation and analysis

# ImageAgent

ImageAgent provides image generation and analysis capabilities.

## Quick Start

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { createImageAgent } from 'praisonai';

const agent = createImageAgent({
  llm: 'openai/gpt-4o-mini'
});

// Generate an image
const images = await agent.generate({
  prompt: 'A sunset over mountains',
  size: '1024x1024'
});

// Analyze an image
const analysis = await agent.analyze({
  imageUrl: 'https://example.com/image.jpg',
  prompt: 'Describe this image'
});
```

## Configuration

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
interface ImageAgentConfig {
  name?: string;
  llm?: string;
  imageModel?: string;  // Default: 'dall-e-3'
  verbose?: boolean;
}
```

## Image Generation

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
interface ImageGenerationConfig {
  prompt: string;
  size?: '256x256' | '512x512' | '1024x1024' | '1792x1024' | '1024x1792';
  quality?: 'standard' | 'hd';
  style?: 'vivid' | 'natural';
  n?: number;  // Number of images
}

const images = await agent.generate({
  prompt: 'A futuristic city',
  size: '1024x1024',
  quality: 'hd',
  style: 'vivid'
});
```

## Image Analysis

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
interface ImageAnalysisConfig {
  imageUrl: string;
  prompt?: string;
  detail?: 'low' | 'high' | 'auto';
}

const analysis = await agent.analyze({
  imageUrl: 'https://example.com/photo.jpg',
  prompt: 'What objects are in this image?',
  detail: 'high'
});
```

## CLI Usage

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Generate image
praisonai-ts image generate "A sunset over mountains"
praisonai-ts image generate "A cat" --size 1024x1024 --quality hd

# Analyze image
praisonai-ts image analyze https://example.com/image.jpg
praisonai-ts image analyze https://example.com/image.jpg "What is this?"
```
