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
| Input | upscale_factor | Output | Output MP |
|---|---|---|---|
| 1024×1024 | 1 | 1024×1024 | 1.05 |
| 1024×1024 | 2 (default) | 2048×2048 | 4.19 |
| 1024×1024 | 4 | 4096×4096 | 16.78 |
| 1024×1024 | 8 | 8192×8192 | 67.11 |
| 1646×1646 | 8 | — | 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.
Related Resources
- Market Overview — Explore all available models
Request Parameters
Body (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The 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。 |
callBackUrl | string | No | The 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。 |
input | object | Yes | Input parameters for the upscale task |
input.image_url | string | Yes | URL 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
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"
}
}'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())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());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))
}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
$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);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());{
"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.
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 是 | See the response field; handle the returned status before retrying. |
msg | string | 是 | Response message, error description when failed |
data | object | 是 | — |
{
"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
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 是 | Unified callback code: 200 for success, 501 for failure. Allowed values:200 / 501。 Example:200。 |
msg | string | 是 | Unified callback message. Allowed values:Playground task completed successfully. / Playground task failed.。 Example:Playground task completed successfully.。 |
data | object | 是 | — |
data.taskId | string | 是 | The unique task identifier. |
data.model | string | 是 | The model used for the task. Allowed values:modelfold/image-upscale。 Example:modelfold/image-upscale。 |
data.state | string | 是 | Terminal task state. Allowed values:success / fail。 Example:success。 |
data.param | string | 是 | JSON string containing the submitted task parameters. |
data.resultJson | string | 否 | JSON string containing resultUrls when successful. Present only when state is success. Result URLs expire after about 14 days. |
data.failCode | string | 否 | Failure code, a numeric string such as "400" or "500". Present only when state is fail. |
data.failMsg | string | 否 | Failure reason. Present only when state is fail. |
data.costTime | integer | 否 | Processing time in seconds. Present on both success and failure callbacks. |
data.completeTime | integer | 否 | Task completion timestamp. |
data.createTime | integer | 否 | Task creation timestamp. |
data.updateTime | integer | 否 | Use completeTime as the completion time; updateTime may equal createTime. |
Task completed successfully
{
"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
{
"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
}
}