Skip to main content
POST
/
v1
/
upscale
Upscale Image
curl --request POST \
  --url https://api.legnext.ai/api/v1/upscale \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "jobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "imageNo": 0,
  "type": 0,
  "callback": "<string>"
}
'
Enhance the resolution and quality of generated images using advanced AI upscaling technology.

Endpoint

POST https://api.legnext.ai/api/v1/upscale

Headers

HeaderTypeRequiredDescription
x-api-keystringYesYour API key

Request Body

ParameterTypeRequiredDescription
jobIdstringYesID of the original image generation task
imageNointegerYesImage number to upscale (0/1/2/3)
typeintegerYesUpscaling type (0 or 1)
callbackstringNoCallback URL for task completion notifications

Upscale Types

TypeNameDescriptionSupported Models
0SubtleConservative enhancement preserving original detailsv6, niji6, v6.1, v7
1CreativeMore aggressive enhancement with artistic interpretationv6, niji6, v6.1, v7
22x2x resolution increase (deprecated)v5, niji5
34x4x resolution increase (deprecated)v5, niji5

Example Requests

Subtle Upscale

curl -X POST "https://api.legnext.ai/api/v1/upscale" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jobId": "5dd94ec3-7282-4f04-9445-59e850ef1822",
    "imageNo": 0,
    "type": 0,
    "callback": "https://webhook.site/c98cb890-fb92-439f-8d60-42c8a51eb52d"
  }'

Creative Upscale

curl -X POST "https://api.legnext.ai/api/v1/upscale" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jobId": "5dd94ec3-7282-4f04-9445-59e850ef1822",
    "imageNo": 0,
    "type": 1,
    "callback": "https://webhook.site/c98cb890-fb92-439f-8d60-42c8a51eb52d"
  }'

Response

Returns a task object containing the task information.
{
    "job_id": "8541c46c-6af7-49a5-a5a2-dd82eae7e6c8",
    "model": "midjourney",
    "task_type": "upscale",
    "status": "completed",
    "config": {
        "service_mode": "public",
        "webhook_config": {
            "endpoint": "https://webhook.site/c98cb890-fb92-439f-8d60-42c8a51eb52d",
            "secret": ""
        }
    },
    "input": null,
    "output": {
        "image_url": "https://cdn.legnext.ai/temp/1760686286022.png",
        "image_urls": [
            "https://cdn.legnext.ai/temp/1760686286022.png"
        ],
        "seed": "1632799488"
    },
    "meta": {
        "created_at": "2025-10-17T07:30:26Z",
        "started_at": "2025-10-17T07:30:27Z",
        "ended_at": "2025-10-17T07:31:27Z",
        "usage": {
            "type": "point",
            "frozen": 120,
            "consume": 120
        }
    },
    "detail": null,
    "logs": [],
    "error": {
        "code": 0,
        "raw_message": "",
        "message": "",
        "detail": null
    }
}

Upscale Types Comparison

Subtle (Type 0)

  • Best For: Photography, realistic images, preserving original details
  • Characteristics:
    • Minimal artistic interpretation
    • Preserves original composition and style
    • Clean, sharp enhancement
    • Suitable for professional use

Creative (Type 1)

  • Best For: Artistic images, illustrations, creative projects
  • Characteristics:
    • Enhanced artistic details
    • More dramatic improvement
    • May add creative interpretation
    • Good for artistic workflows

Authorizations

x-api-key
string
header
required

API key for authentication

Body

application/json
jobId
string<uuid>
required

ID of the original image generation task

imageNo
integer
required

Image number to upscale (0, 1, 2, or 3)

Required range: 0 <= x <= 3
Example:

0

type
enum<integer>
required

Upscaling type (0=Subtle, 1=Creative)

Available options:
0,
1
callback
string<uri>

Callback URL for task completion notifications

Response

200

Upscale task created successfully