Skip to main content

Function: upscaleImage()

upscaleImage(opts): Promise<UpscaleImageResult>

Defined in: packages/agentos/src/api/upscaleImage.ts:124

Upscales an image using a provider-agnostic interface.

Resolves credentials via resolveMediaProvider(), initialises the matching image provider, converts the input image to a Buffer, and dispatches to the provider's upscaleImage method.

Parameters

opts

UpscaleImageOptions

Upscale options including the source image and desired scale.

Returns

Promise<UpscaleImageResult>

A promise resolving to the upscale result with the higher-resolution image.

Throws

When the resolved provider does not implement image upscaling.

Throws

When no provider can be determined or credentials are missing.

Example

const result = await upscaleImage({
provider: 'stability',
image: 'https://example.com/lowres.jpg',
scale: 4,
});
console.log(result.image.dataUrl);