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"}'
NameTypeDescription
imagestringRequired. https:// URL, including a generation's output[0].url, or file in multipart/form-data (see Images).
scalestringRequired. Factor: x2 or x4.
metadataobjectFree-form key-value pairs attached to the generation and returned with it (see Metadata).
backgroundbooleantrue: 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 formatOutput with x2Output with x4
16:9 or more elongated3,840 px long side7,680 px long side
Squarer (4:3, 1:1…)8.4 million pixels33.5 million pixels
4:3 example3,344 × 2,5086,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. Use x4 instead.
  • Chaining: a 4K render in 16:9 can only be enlarged with x4, and the image produced by x2 can go through x4. An 8K render, or the image produced by x4, 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.
StatusCodeCause
400parameter_invalidscale missing or unknown, or metadata out of bounds.
400image_dimensions_invalidImage under 256 pixels on a side, or already as large as the chosen factor's output.
503mode_unavailableUpscaling temporarily unavailable.
Errors shared by every route (key, balance, images, limits) are in Errors.