Interface UpscaleImageOptions

Options for an upscaleImage call.

Example

const result = await upscaleImage({
provider: 'stability',
image: fs.readFileSync('lowres.png'),
scale: 4,
});
interface UpscaleImageOptions {
    provider?: string;
    model?: string;
    image: string | Buffer<ArrayBufferLike>;
    scale?: 2 | 4;
    width?: number;
    height?: number;
    apiKey?: string;
    baseUrl?: string;
    providerOptions?: Record<string, unknown> | ImageProviderOptionBag;
    usageLedger?: AgentOSUsageLedgerOptions;
}

Properties

provider?: string

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

model?: string

Model identifier. Most upscale providers use a fixed model so this is usually left unset.

image: string | Buffer<ArrayBufferLike>

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

scale?: 2 | 4

Integer scale factor. 2 doubles each dimension; 4 quadruples them. When both scale and width/height are provided, explicit dimensions take precedence.

Default

2
width?: number

Target width in pixels (alternative to scale).

height?: number

Target height in pixels (alternative to scale).

apiKey?: string

Override the provider API key instead of reading from env vars.

baseUrl?: string

Override the provider base URL.

providerOptions?: Record<string, unknown> | ImageProviderOptionBag

Arbitrary provider-specific options.

Optional usage ledger configuration.