# Upscale V2 - Documentation

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown is available with `Accept: text/markdown` and `.md` URL variants.

Source: /docs/api-reference/model-apis-upscale-v2-deprecated

# Upscale V2

POST

/

v2

/

upscale

Try it

Upscale V2

cURL

```
curl --request POST \
--url https://api.novita.ai/v2/upscale \
--header 'Authorization: &#x3C;authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"image": "&#x3C;string>",
"upscaler_1": {},
"resize_mode": {},
"upscaling_resize": {},
"upscaling_resize_w": {},
"upscaling_resize_h": {},
"upscaling_crop": {},
"upscaler_2": {},
"extras_upscaler_2_visibility": {},
"gfpgan_visibility": {},
"codeformer_visibility": {},
"codeformer_weight": {},
"img_expire_ttl": 123
}
'
```

200

```
{
"code": 123,
"msg": "&#x3C;string>",
"data": {
"task_id": "&#x3C;string>",
"warn": "&#x3C;string>"
}
}
```

The Upscale V2 API is deprecated and will be removed in the future. Please migrate to [Upscale V3](/docs/api-reference/model-apis-upscale).

##

[​](#post-upscale-v2)

POST Upscale V2

An indispensable tool for improving the quality of images generated by Stable Diffusion.

##

[​](#request-headers)

Request Headers

[​](#param-authorization)

Authorization

string

required

##

[​](#request-body)

Request Body

[​](#param-image)

image

string

required

Base64 encoded image

[​](#param-upscaler-1)

upscaler_1

string|null

AI upscalers are models trained with massive amounts of data.

[​](#param-resize-mode)

resize_mode

integer|null

Resizing mode:

[​](#param-upscaling-resize)

upscaling_resize

number|null

The magnification factor of the image. For example, if you input upscaling_resize:2 with an image size of 512x512, it will return images of 1024x1024 (the maximum image size is 2048).

[​](#param-upscaling-resize-w)

upscaling_resize_w

integer|null

The target image width; the maximum image size is 2048.

[​](#param-upscaling-resize-h)

upscaling_resize_h

integer|null

The target image height; the maximum image size is 2048.

[​](#param-upscaling-crop)

upscaling_crop

boolean|null

Zoom in after cropping.

[​](#param-upscaler-2)

upscaler_2

string|null

AI upscalers are models trained with massive amounts of data.

[​](#param-extras-upscaler-2-visibility)

extras_upscaler_2_visibility

number|null

Range [0~1], Extras upscaler 2 visibility.

[​](#param-gfpgan-visibility)

gfpgan_visibility

number|null

Range [0~1], GFPGAN visibility.

[​](#param-codeformer-visibility)

codeformer_visibility

number|null

Range [0~1], CodeFormer visibility.

[​](#param-codeformer-weight)

codeformer_weight

number|null

Range [0~1], CodeFormer weight (0 = maximum effect, 1 = minimum effect).

[​](#param-img-expire-ttl)

img_expire_ttl

integer

Image storage time (seconds). Range [0, 604800].

##

[​](#response)

Response

[​](#param-code)

code

integer

CodeNormal=0, CodeInternalError=-1, CodeInvalidJSON=1, CodeModelNotExist=2, CodeTaskIdNotExist=3, CodeInvalidAuth=4, CodeHostUnavailable=5, CodeParamRangeOutOfLimit=6, CodeCostBalanceFailure=7, CodeSamplerNotExist=8, CodeTimeout=9, CodeNotSupport=10

[​](#param-msg)

msg

string

[​](#param-data)

data

object

Show properties

[​](#param-task-id)

task_id

string

[​](#param-warn)

warn

string

##

[​](#example)

Example

request

```
curl --location 'https://api.novita.ai/v2/upscale' \
--header 'Authorization: Bearer {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
'image': '{{base64 encoded image}}',
'upscaler_1': 'R-ESRGAN 4x+',
'resize_mode': 1,
'upscaling_resize': null,
'upscaling_resize_w': 1024,
'upscaling_resize_h': 1024,
'upscaling_crop': true,
'upscaler_2': 'R-ESRGAN 4x+',
'extras_upscaler_2_visibility': 0.5,
'gfpgan_visibility': 0.5,
'codeformer_visibility': 0.5,
'codeformer_weight': 0.5,
'img_expire_ttl': null
}'
```

response

```
{
"code": null,
"msg": "",
"data": {
"task_id": "",
"warn": ""
}
}
```

Last modified on December 25, 2024
