Skip to content

ModelFold - Image Upscale ​

Endpoint ​

POST /jobs/createTask

Full URL: https://modelfold.ai/v1/jobs/createTask

Authentication: every request must include the Authorization: Bearer <API_KEY> header.

Upscale an image by 1x, 2x, 4x, or 8x while keeping the original aspect ratio. Detail is restored generatively, and text regions are upscaled with a fidelity pass so the text is never rewritten.

upscale_factor multiplies both width and height. 1 enhances quality at the same size (denoise, sharpen, preserve text) without changing dimensions.

Input limits ​

  • Publicly downloadable HTTP(S) image URL
  • File size ≤ 20 MB
  • Formats: JPG, PNG, WEBP, GIF (first frame only)

Output limits ​

  • Output total pixels ≤ 67,108,864 (67 MP, about 8192×8192), and each side ≤ 16,384 px
Inputupscale_factorOutputOutput MP
1024×102411024×10241.05
1024×10242 (default)2048×20484.19
1024×102444096×409616.78
1024×102488192×819267.11
1646×16468—173 → 422

Output ​

  • Output width and height = input width and height × upscale_factor (exact integers, nothing is cropped)
  • Format follows the input: JPG → JPG, WEBP → WEBP, everything else → PNG. Transparent backgrounds are filled with white
  • Result URL expires after about 14 days — download and store it if you need it longer

Create Task ​

Submit with model=modelfold/image-upscale on the unified task endpoint.

  • Get Task Details — After submission, use the unified query endpoint to check task progress and retrieve results

TIP

For production use, we recommend providing the callBackUrl parameter so your service can receive completion notifications instead of polling for task status. Callbacks may be delivered more than once — deduplicate by taskId.

Request Parameters ​

Body (application/json) ​

ParameterTypeRequiredDescription
modelstringYesThe model name to use for generation. Required field.
- Must be modelfold/image-upscale for this endpoint Default:"modelfold/image-upscale"。 Allowed values:modelfold/image-upscale。 Example:modelfold/image-upscale。
callBackUrlstringNoThe URL to receive generation task completion updates. Optional but recommended for production use.
- System will POST task status and results to this URL when generation completes
- Callback includes generated content URLs and task information
- Your callback endpoint should accept POST requests with JSON payload containing results
- Alternatively, use the Get Task Details endpoint to poll task status
- Callbacks may be delivered more than once — deduplicate by taskId
- To ensure callback security, see Webhook Verification Guide for signature verification implementation Example:https://your-domain.com/api/callback。
inputobjectYesInput parameters for the upscale task
  input.image_urlstringYesURL of the image to upscale. Required.
- Must be a publicly downloadable HTTP(S) URL
- Max file size: 20 MB
- Supported formats: JPG, PNG, WEBP, GIF (only the first frame is used)
- Use a file URL after upload, not the file content itself Example:https://static.aiquickdraw.com/tools/example/1794381136822_zlQCnA1z.jpg。

Request Example ​

bash
curl -X POST "https://modelfold.ai/v1/jobs/createTask" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "modelfold/image-upscale",
  "callBackUrl": "https://your-domain.com/api/callback",
  "input": {
    "image_url": "https://static.aiquickdraw.com/tools/example/1794381136822_zlQCnA1z.jpg",
    "upscale_factor": "2"
  }
}'
python
import os
import requests

resp = requests.post(
    "https://modelfold.ai/v1/jobs/createTask",
    headers={
        "Authorization": "Bearer " + os.environ["MODELFOLD_API_KEY"],
        "Content-Type": "application/json",
    },
    json={
        "model": "modelfold/image-upscale",
        "callBackUrl": "https://your-domain.com/api/callback",
        "input": {
            "image_url": "https://static.aiquickdraw.com/tools/example/1794381136822_zlQCnA1z.jpg",
            "upscale_factor": "2",
        },
    },
)
print(resp.json())
javascript
const resp = await fetch("https://modelfold.ai/v1/jobs/createTask", {
  method: "POST",
  headers: {
    "Authorization": "Bearer " + process.env.MODELFOLD_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "modelfold/image-upscale",
    "callBackUrl": "https://your-domain.com/api/callback",
    "input": {
      "image_url": "https://static.aiquickdraw.com/tools/example/1794381136822_zlQCnA1z.jpg",
      "upscale_factor": "2"
    }
  }),
});
console.log(await resp.json());
go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
	"strings"
)

func main() {
	body := strings.NewReader(`{"model":"modelfold/image-upscale","callBackUrl":"https://your-domain.com/api/callback","input":{"image_url":"https://static.aiquickdraw.com/tools/example/1794381136822_zlQCnA1z.jpg","upscale_factor":"2"}}`)
	req, _ := http.NewRequest("POST", "https://modelfold.ai/v1/jobs/createTask", body)
	req.Header.Set("Authorization", "Bearer " + os.Getenv("MODELFOLD_API_KEY"))
	req.Header.Set("Content-Type", "application/json")
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	out, _ := io.ReadAll(resp.Body)
	fmt.Println(string(out))
}
java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        String body = "{\"model\":\"modelfold/image-upscale\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"input\":{\"image_url\":\"https://static.aiquickdraw.com/tools/example/1794381136822_zlQCnA1z.jpg\",\"upscale_factor\":\"2\"}}";
        HttpRequest req = HttpRequest.newBuilder()
            .uri(URI.create("https://modelfold.ai/v1/jobs/createTask"))
            .header("Authorization", "Bearer " + System.getenv("MODELFOLD_API_KEY"))
            .header("Content-Type", "application/json")
            .method("POST", HttpRequest.BodyPublishers.ofString(body))
            .build();
        HttpResponse<String> resp = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
        System.out.println(resp.body());
    }
}
php
<?php
$ch = curl_init('https://modelfold.ai/v1/jobs/createTask');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv("MODELFOLD_API_KEY"),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => '{"model":"modelfold/image-upscale","callBackUrl":"https://your-domain.com/api/callback","input":{"image_url":"https://static.aiquickdraw.com/tools/example/1794381136822_zlQCnA1z.jpg","upscale_factor":"2"}}',
]);
echo curl_exec($ch);
curl_close($ch);
csharp
using System;
using System.Net.Http;
using System.Text;

var client = new HttpClient();
var req = new HttpRequestMessage(new HttpMethod("POST"), "https://modelfold.ai/v1/jobs/createTask");
req.Headers.TryAddWithoutValidation("Authorization", "Bearer " + Environment.GetEnvironmentVariable("MODELFOLD_API_KEY"));
req.Content = new StringContent("{\"model\":\"modelfold/image-upscale\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"input\":{\"image_url\":\"https://static.aiquickdraw.com/tools/example/1794381136822_zlQCnA1z.jpg\",\"upscale_factor\":\"2\"}}", Encoding.UTF8, "application/json");
var resp = await client.SendAsync(req);
Console.WriteLine(await resp.Content.ReadAsStringAsync());
json
{
  "model": "modelfold/image-upscale",
  "callBackUrl": "https://your-domain.com/api/callback",
  "input": {
    "image_url": "https://static.aiquickdraw.com/tools/example/1794381136822_zlQCnA1z.jpg",
    "upscale_factor": "2"
  }
}

Response ​

200 — Request successful ​

500 — Server error. ​

参数类型必填说明
codeinteger是See the response field; handle the returned status before retrying.
msgstring是Response message, error description when failed
dataobject是—
json
{
  "code": 500,
  "msg": "Server Error - An unexpected error occurred while processing the request",
  "data": null
}

Callback ​

imageTaskCompleted ​

Callback URL: {request.body#/callBackUrl} (the callBackUrl in the request body).

The system sends this callback when the modelfold/image-upscale task succeeds or fails.

Callback body parameters

参数类型必填说明
codeinteger是Unified callback code: 200 for success, 501 for failure. Allowed values:200 / 501。 Example:200。
msgstring是Unified callback message. Allowed values:Playground task completed successfully. / Playground task failed.。 Example:Playground task completed successfully.。
dataobject是—
  data.taskIdstring是The unique task identifier.
  data.modelstring是The model used for the task. Allowed values:modelfold/image-upscale。 Example:modelfold/image-upscale。
  data.statestring是Terminal task state. Allowed values:success / fail。 Example:success。
  data.paramstring是JSON string containing the submitted task parameters.
  data.resultJsonstring否JSON string containing resultUrls when successful. Present only when state is success. Result URLs expire after about 14 days.
  data.failCodestring否Failure code, a numeric string such as "400" or "500". Present only when state is fail.
  data.failMsgstring否Failure reason. Present only when state is fail.
  data.costTimeinteger否Processing time in seconds. Present on both success and failure callbacks.
  data.completeTimeinteger否Task completion timestamp.
  data.createTimeinteger否Task creation timestamp.
  data.updateTimeinteger否Use completeTime as the completion time; updateTime may equal createTime.

Task completed successfully

json
{
  "code": 200,
  "msg": "Playground task completed successfully.",
  "data": {
    "taskId": "task_example_image_webhook_001",
    "model": "modelfold/image-upscale",
    "state": "success",
    "param": "{\"input\": \"{\\\"image_url\\\": \\\"https://example.com/input-image.png\\\", \\\"upscale_factor\\\": \\\"2\\\"}\", \"callBackUrl\": \"https://example.com/callback\", \"model\": \"modelfold/image-upscale\"}",
    "resultJson": "{\"resultUrls\": [\"https://example.com/upscaled-image.png\"]}",
    "costTime": 15,
    "completeTime": 1234567890,
    "createTime": 1234560000,
    "updateTime": 1234567890
  }
}

Task failed

json
{
  "code": 501,
  "msg": "Playground task failed.",
  "data": {
    "taskId": "task_example_image_webhook_001",
    "model": "modelfold/image-upscale",
    "state": "fail",
    "param": "{\"input\": \"{\\\"image_url\\\": \\\"https://example.com/input-image.png\\\", \\\"upscale_factor\\\": \\\"2\\\"}\", \"callBackUrl\": \"https://example.com/callback\", \"model\": \"modelfold/image-upscale\"}",
    "failCode": "400",
    "failMsg": "<error detail>",
    "costTime": 3
  }
}

ModelFold — one API for all the best AI models.