The Image Upscaling API is the latest addition to WorqHat AI’s existing set of image generation and editing APIs, like the popular text-to-image and image-to-image APIs. Upscaling adds to those popular tools by expanding small images into larger ones while maintaining – or even improving – their level of detail. Read more at https://docs.worqhat.com/ai-models/image-generation/image-upscale

Parameters

ParameterTypeDescription
existing_imageFile or stringThe existing image to be upscaled. It can be a File object or a URL or base64 encoded image data. This is a required parameter.
scalenumberThe scale factor for the image upscaling. This is an optional parameter. Make sure to use a value between 1 and 4 so that it does not scale one side beyond 2048px. Default value is 1.
output_typestringThe output type of the upscaled image. It can be either “url” or “blob”. This is an optional parameter. The default value is “url”.

Initialize AI Modules

const worqhat = require('worqhat');

var config = new worqhat.Configuration({
    apiKey: "your-api-key",
    debug: true,
    max_retries: 3,
});

worqhat.initializeApp(config);

let ai = worqhat.ai();

Implementation

ai.upscaleImage.v2({
    existing_image: './1692628607418.png',
    scale: 4,
    output_type: 'url'
}).then((response) => {
    console.log(response);
}).catch((error) => {
    console.log(error);
});