variation • AI Agent SDK

variation: Generate variations of an existing image.

variation

Method

</div>

This is a method of the ImageAgent class in the image_agent module.

Generate variations of an existing image.

Signature

python
def variation(image: str, n: int, size: Optional[str]) -> Dict[str, Any]

Parameters

ParamField str

Path or URL to the source image

ParamField int

Number of variations to generate

ParamField Optional[str]

Output image size **kwargs: Additional provider-specific parameters

Returns

ResponseField Dict[str, Any]

ImageResponse with image variations

Usage

python
agent = ImageAgent(llm="openai/dall-e-2")
    result = agent.variation("original.png", n=3)

Uses

  • litellm.image_variation

Source

View on GitHub

praisonaiagents/agent/image_agent.py at line 326