Interface VariateImageOptions

Options for a variateImage call.

Example

const result = await variateImage({
provider: 'openai',
image: fs.readFileSync('hero.png'),
n: 3,
variance: 0.4,
});
interface VariateImageOptions {
    provider?: string;
    model?: string;
    image: string | Buffer<ArrayBufferLike>;
    n?: number;
    variance?: number;
    size?: string;
    apiKey?: string;
    baseUrl?: string;
    providerOptions?: Record<string, unknown> | ImageProviderOptionBag;
    usageLedger?: AgentOSUsageLedgerOptions;
}

Properties

provider?: string

Provider name (e.g. "openai", "stability", "stable-diffusion-local"). When omitted, auto-detection via env vars is attempted.

model?: string

Model identifier. When omitted, the provider's default variation model is used (e.g. dall-e-2 for OpenAI).

image: string | Buffer<ArrayBufferLike>

Source image as a base64 data URL, raw base64 string, Buffer, local file path, or HTTP/HTTPS URL.

n?: number

Number of variations to generate.

Default

1
variance?: number

How different from the original each variation should be. 0 = nearly identical, 1 = very different.

For providers that support strength/denoising (Stability, A1111), this is mapped to that parameter. OpenAI's variations API does not expose a strength control so this value is advisory only.

Default

0.5
size?: string

Desired output size (e.g. "1024x1024").

apiKey?: string

Override the provider API key.

baseUrl?: string

Override the provider base URL.

providerOptions?: Record<string, unknown> | ImageProviderOptionBag

Arbitrary provider-specific options.

Optional usage ledger configuration.