Vosr2 Image API Documentation

Vosr2 Image API Documentation

Playground

Try it on WaveSpeedAI!

VOSR2 Image Upscaler restores and upscales photos to 2K or 4K in a single pass, rebuilding fine structure, faces and small text with faithful color. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.

Features

VOSR2 Image Upscaler enlarges an input image to 2K or 4K while restoring fine visual detail in the same workflow. It is designed to improve hair, skin, foliage, fabric, small text, edges, and other high-frequency details while reducing blur and compression artifacts.

The input aspect ratio is preserved, making it suitable for photo restoration, portrait enhancement, product imagery, AI-generated images, and high-resolution display or print workflows.


Why Choose This?

  • 2K and 4K upscaling
    Generate higher-resolution outputs directly at the selected target resolution.

  • Detail restoration
    Recover fine structures such as hair, skin texture, fabric, foliage, edges, and small visual details.

  • Artifact cleanup
    Reduce blur, compression artifacts, and softness during the upscale process.

  • Aspect-ratio preservation
    Keep the original image composition and aspect ratio.

  • Simple workflow
    Upload an image, choose the target resolution and output format, then generate the enhanced result.

  • Fast processing
    Suitable for workflows where high-resolution output is needed without a lengthy restoration pipeline.


Parameters

ParameterRequiredDescription
imageYesURL of the image to upscale.
target_resolutionNoTarget output resolution: 2k or 4k. Default: 4k.
output_formatNoOutput image format: jpeg, png, or webp. Default: jpeg.

How to Use

  1. Provide an input image — Upload an image or provide its URL.
  2. Choose target resolution — Select 2k or 4k.
  3. Choose output format optional — Select jpeg, png, or webp.
  4. Submit — Generate the upscaled and restored image.
  5. Retrieve the result — Download the enhanced high-resolution output.

Pricing

Pricing is fixed at $0.01 per image.

Target ResolutionCost per Image
2K$0.01
4K$0.01

target_resolution and output_format do not add separate charges.


Best Use Cases

  • Photo restoration — Improve old, compressed, soft, or low-resolution photographs.
  • Portrait enhancement — Restore facial, hair, clothing, and skin detail.
  • Product imagery — Prepare product photos for e-commerce, advertising, or larger displays.
  • AI-generated images — Upscale generated artwork before publishing, printing, or further editing.
  • Print preparation — Create higher-resolution assets for posters, packaging, and physical media.
  • Large-display output — Improve image quality for presentations, screens, and high-resolution viewing.

Pro Tips

  • Use 2k when the source image is very small or when you want a more conservative upscale.
  • Use 4k when you need maximum output resolution for print, display, or detailed viewing.
  • Choose png when you want to avoid additional lossy compression.
  • Photographs and natural images generally benefit most from detail restoration.
  • For screenshots, charts, or flat graphics, inspect large uniform areas after upscaling because subtle texture may be introduced.
  • If a very small source looks overly smooth at 4k, try 2k instead.

Notes

  • image is required.
  • target_resolution defaults to 4k.
  • Supported target resolutions are 2k and 4k.
  • output_format defaults to jpeg.
  • Supported output formats are jpeg, png, and webp.
  • The original aspect ratio is preserved.
  • Very small inputs may require substantial enlargement, which can affect how much fine detail can be reconstructed.

Authentication

For authentication details, please refer to the Authentication Guide.

API Endpoints

Submit Task & Query Result

set -euo pipefail

export WAVESPEED_API_KEY="your-api-key"

REQUEST_BODY=$(cat <<'JSON'
{
  "image": "https://interactive-examples.mdn.mozilla.net/media/cc0-images/painted-hand-298-332.jpg",
  "target_resolution": "4k",
  "output_format": "jpeg"
}
JSON
)

# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
  -X POST "https://api.wavespeed.ai/api/v3/wavespeed-ai/vosr2/image" \
  -H "Authorization: Bearer ${WAVESPEED_API_KEY}" \
  -H "Content-Type: application/json" \
  -d "${REQUEST_BODY}")

TASK=$(printf '%s' "${SUBMIT_RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "${TASK}" | jq -r '.id // empty')
if [ -z "${PREDICTION_ID}" ]; then
  printf 'Submission response did not contain a prediction id
' >&2
  exit 1
fi
RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/${PREDICTION_ID}/result"

# 2. Poll until the prediction finishes.
while true; do
  RESPONSE=$(curl --silent --show-error --fail-with-body \
    "${RESULT_URL}" \
    -H "Authorization: Bearer ${WAVESPEED_API_KEY}")
  RESULT=$(printf '%s' "${RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
  STATUS=$(printf '%s' "${RESULT}" | jq -r '.status // empty')

  case "${STATUS}" in
    completed) printf '%s\n' "${RESULT}" | jq '.outputs'; break ;;
    failed|cancelled|timeout|deleted) printf '%s\n' "${RESULT}" | jq . >&2; exit 1 ;;
    *) sleep 2 ;;
  esac
done

Parameters

Task Submission Parameters

Request Parameters

ParameterTypeRequiredDefaultRangeDescription
imagestringYes-The URL of the image to upscale.
target_resolutionstringNo4k2k, 4kThe output resolution. 2k is about 4 megapixels and 4k about 16 megapixels; the aspect ratio of the input image is preserved.
output_formatstringNojpegjpeg, png, webpThe format of the output image.
enable_base64_outputbooleanNofalse-If set to `true`, the prediction's `output` strings are returned as **naked base64** (no `data:<mime>;base64,` prefix). When `false` (default), outputs are returned as URLs pointing to our CDN.
enable_sync_modebooleanNofalse-If set to `true`, the request attempts to wait for the generated result and return outputs in the same response. If the result is not ready within the sync wait window, the API can return a timeout body while the task continues processing. This option is only available via the API and is supported only by some models.

Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
data.idstringUnique identifier for the prediction, Task Id
data.modelstringModel ID used for the prediction
data.outputsarrayOutput values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed)
data.urlsobjectObject containing related API endpoints
data.statusstringTask status. completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses.
data.created_atstringISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”)
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds

Result Request Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Task ID

Result Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
dataobjectThe prediction data object containing all details
data.idstringUnique identifier for the prediction
data.modelstringModel ID used for the prediction
data.outputsarray<string | object>Array of generated outputs (empty when status is not completed). Items are usually URL strings, but may be text strings or structured result objects, depending on the model.
data.urlsobjectObject containing related API endpoints
data.statusstringStatus: completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses
data.created_atstringISO timestamp of when the request was created
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds
© 2026 WaveSpeedAI. All rights reserved.