Guides
Upscaling
POST /v1/upscales enlarges an image without altering it, whatever its origin: a photo, a render from other software, or the image produced by a generation (render, edit, decoration, upscale).curl https://api.renderthink.com/v1/upscales \-H "Authorization: Bearer $RENDERTHINK_API_KEY" \-H "Content-Type: application/json" \-d '{"image": "https://developers.renderthink.com/assets/scenes/sejour-charpente-rendu.webp", "scale": "x2"}'
| Name | Type | Description |
|---|---|---|
image | string | Required. https:// URL, including a generation's output[0].url, or file in multipart/form-data (see Images). |
scale | string | Required. Factor: x2 or x4. |
metadata | object | Free-form key-value pairs attached to the generation and returned with it (see Metadata). |
background | boolean | true: immediate response, result by webhook or by reading it (see Generations). |
Key permission:
upscales.The ended generation, of type
upscale (200); with background: true, the generation in progress (202). The output image is in output[0].url. input.scale repeats the factor and input.quality is null.The output is normally WebP (
content_type).The output size depends on the factor and on the proportions of the image, not on its size. Proportions are kept.
| Image format | Output with x2 | Output with x4 |
|---|---|---|
| 16:9 or more elongated | 3,840 px long side | 7,680 px long side |
| Squarer (4:3, 1:1…) | 8.4 million pixels | 33.5 million pixels |
| 4:3 example | 3,344 × 2,508 | 6,688 × 5,016 |
- At least 256 pixels on each side.
- At most, the image limits (8,192 pixels per side, 36 million pixels), and the output must be larger than the image: an image already as large as the output (a 3,840-pixel long side in 16:9 with
x2) is refused, nothing charged. Usex4instead. - Chaining: a 4K render in 16:9 can only be enlarged with
x4, and the image produced byx2can go throughx4. An 8K render, or the image produced byx4, already has the maximum output size: it cannot be enlarged again. - In test mode, the output image always has a 1,024-pixel long side: a chain accepted in test mode can be refused in live mode.
- The price depends on the factor only, never on the size of the received image.
| Status | Code | Cause |
|---|---|---|
| 400 | parameter_invalid | scale missing or unknown, or metadata out of bounds. |
| 400 | image_dimensions_invalid | Image under 256 pixels on a side, or already as large as the chosen factor's output. |
| 503 | mode_unavailable | Upscaling temporarily unavailable. |
Errors shared by every route (key, balance, images, limits) are in Errors.