Links

Upscaling Models

Overview

The DataCrunch Inference Service offers a powerful solution for image upscaling that employs advanced deep learning techniques to enhance image resolution. This documentation aims to provide a comprehensive guide for effectively utilizing this service.

Available Models

  • realesrgan: The Real-ESRGAN model is designed for image upscaling and enhancement. It uses Enhanced Super-Resolution Generative Adversarial Networks (ESRGAN) to upscale images, significantly improving their resolution and detail. This model is particularly adept at restoring finer details in images, making it ideal for enhancing low-resolution photos or graphics.
  • gfpgan: GFP-GAN, or Generative Facial Prior GAN, specializes in restoring and enhancing facial details in images. Leveraging advanced Generative Adversarial Networks, this model excels at correcting facial imperfections, enhancing facial features, and improving overall image quality. It is particularly useful for portrait photos where facial details are a key focus.

Examples of API Usage

To use the Upscaling Inference Service API, replace <MODEL> in the URL with realesrgan or gfpgan.
For example, use https://inference.datacrunch.io/v1/images/realesrgan/generate.

Upscale an Image

To upscale an image to twice its resolution use the following request:
cURL
Python
JavaScript
curl -X POST https://inference.datacrunch.io/v1/images/<MODEL>/generate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_api_key>" \
-d \
'{
"input_image": "<base64_encoded_image>"
}'
import requests
url = "https://inference.datacrunch.io/v1/images/<MODEL>/generate"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <your_api_key>"
}
data = {"input_image": "<base64_encoded_image>"}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const axios = require('axios');
const url = "https://inference.datacrunch.io/v1/images/<MODEL>/generate";
const headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your_api_key>'
};
const data = {"input_image": "<base64_encoded_image>"};
axios.post(url, data, { headers: headers })
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.error('Error:', error);
});

API Specification

post
https://inference.datacrunch.io/v1/images/realesrgan
/generate
Real-ESRGAN Upscaling

API Parameters

  • input_image (string, required): Base64 encoded string of the input image to be upscaled.
Last modified 1mo ago