> ## 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.

# variation • AI Agent SDK

> variation: Generate variations of an existing image.

# variation

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**ImageAgent**](../classes/ImageAgent) class in the [**image\_agent**](../modules/image_agent) module.

Generate variations of an existing image.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def variation(image: str, n: int, size: Optional[str]) -> Dict[str, Any]
```

## Parameters

<ParamField query="image" type="str" required={true}>
  Path or URL to the source image
</ParamField>

<ParamField query="n" type="int" required={false} default="1">
  Number of variations to generate
</ParamField>

<ParamField query="size" type="Optional" required={false}>
  Output image size \*\*kwargs: Additional provider-specific parameters
</ParamField>

### Returns

<ResponseField name="Returns" type="Dict[str, Any]">
  ImageResponse with image variations
</ResponseField>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
agent = ImageAgent(llm="openai/dall-e-2")
    result = agent.variation("original.png", n=3)
```

## Uses

* `litellm.image_variation`

## Used By

* [`ImageAgent.avariation`](../functions/ImageAgent-avariation)

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agent/image_agent.py#L309">
  `praisonaiagents/agent/image_agent.py` at line 309
</Card>
