Function upscaleImage

  • 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

    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);