Variation options including the source image and desired count.
A promise resolving to the variation result with image data.
When the resolved provider does not implement image variations and has no img2img fallback.
When no provider can be determined or credentials are missing.
const result = await variateImage({
provider: 'openai',
image: 'https://example.com/hero.png',
n: 4,
});
result.images.forEach((img, i) => console.log(`Variation ${i}:`, img.url));
Generates visual variations of a source image using a provider-agnostic interface.
Resolves credentials via
resolveMediaProvider(), initialises the matching image provider, converts the input image to aBuffer, and dispatches to the provider'svariateImagemethod.For providers without a native variation endpoint, the high-level API falls back to an img2img call with
strength = varianceto produce similar output.