Clarity AI Creative Upscaler API Documentation

Clarity AI Creative Upscaler API Documentation

Playground

Try it on WaveSpeedAI!

Creative Upscaler enlarges images with style and detail control, restoring photos or adding micro-textures for portraits and anime. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.

Features

Clarity AI Creative Upscaler enlarges and enhances images with controllable detail generation, making it useful for both faithful restoration and more stylized creative upscaling. It is well suited for interiors, portraits, product images, artwork, and other assets that need higher resolution with adjustable enhancement strength.


Why Choose This?

  • Creative image upscaling Increase image resolution while enhancing sharpness, textures, and overall visual clarity.

  • Megapixel-based output control Choose the target output size directly in megapixels for more predictable delivery needs.

  • Flexible detail generation Use creativity to balance source-faithful restoration against stronger generated detail.

  • Simple workflow Upload one image, choose the target megapixels, adjust creativity, and generate the enhanced result.

  • Production-ready API Suitable for image enhancement workflows, creative tooling, print preparation, and commercial asset delivery.


Parameters

ParameterRequiredDescription
imageYesInput image to upscale.
target_megapixelsNoTarget output size in megapixels. Higher values produce larger outputs.
creativityNoControls how much new detail is added. Lower values stay closer to the source, while higher values add stronger enhancement.

How to Use

  1. Upload your image — provide the source image you want to enhance.
  2. Choose target megapixels — set the desired output size based on your delivery needs.
  3. Adjust creativity (optional) — keep it low for more faithful results, or increase it for stronger enhancement.
  4. Submit — run the model and download the upscaled image.

Example Use Case

Upscale an interior design photo for higher-resolution presentation output while preserving structure, lighting, and clean material textures.


Pricing

Pricing is based on the selected target_megapixels tier.

Target MegapixelsCost
<= 4 MP$0.05
> 4 MP and <= 8 MP$0.10
> 8 MP and <= 16 MP$0.20
> 16 MP and <= 25 MP$0.40
> 25 MP and <= 50 MP$0.80
> 50 MP$1.60

Billing Rules

  • Pricing is based on target_megapixels
  • Cost uses fixed megapixel tiers rather than scaling linearly
  • Higher megapixel tiers increase the price step by step
  • creativity does not affect pricing

Best Use Cases

  • Photo enhancement — Improve clarity and resolution for real-world photography.
  • Interior and architecture images — Preserve structure and clean lines while increasing output size.
  • Product and commercial visuals — Prepare sharper assets for catalogs, campaigns, and listings.
  • Artwork and illustration upscaling — Generate larger outputs for presentation or print use.
  • Creative asset preparation — Produce higher-resolution images for design, marketing, and publishing workflows.
  • Controlled restoration vs enhancement — Adjust creativity based on how close the result should stay to the original.

Pro Tips

  • Start with a lower megapixel tier first, then increase only if you need a larger final output.
  • Keep creativity low when structure accuracy and source fidelity matter most.
  • Increase creativity gradually if you want stronger texture generation or more stylized enhancement.
  • Use the cleanest source image available for better results.
  • For print or large-format delivery, choose a higher megapixel tier only when the extra size is necessary.

Notes

  • image is the only required field.
  • Pricing depends on the selected target_megapixels tier.
  • creativity affects the look of the result, but not the price.
  • Larger target sizes may be more suitable for print, presentation, or premium delivery workflows.

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_megapixels": 4,
  "creativity": 0
}
JSON
)

# 1. Submit the prediction once. Never retry this request automatically:
# a retry after an unclear failure can create a second, billed task.
CHECK='The task may already exist. Check History or the predictions list before submitting again.'
if ! SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
  --connect-timeout 10 --max-time 60 \
  -X POST "https://api.wavespeed.ai/api/v3/clarity-ai/creative-upscaler" \
  -H "Authorization: Bearer ${WAVESPEED_API_KEY}" \
  -H "Content-Type: application/json" \
  -d "${REQUEST_BODY}"); then
  printf 'Submit failed. %s\n' "${CHECK}" >&2
  exit 1
fi

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. %s\n' "${CHECK}" >&2
  exit 1
fi
RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/${PREDICTION_ID}/result"

# 2. Poll until the prediction reaches a final status.
BODY_FILE=$(mktemp)
trap 'rm -f "${BODY_FILE}"' EXIT
while true; do
  # Transient errors (429, 5xx) are retried, honoring Retry-After.
  HTTP_CODE=$(curl --silent --show-error --fail-with-body \
    --connect-timeout 10 --max-time 60 --retry 5 --retry-delay 2 \
    --output "${BODY_FILE}" --write-out '%{http_code}' \
    "${RESULT_URL}" \
    -H "Authorization: Bearer ${WAVESPEED_API_KEY}" || true)
  case "${HTTP_CODE}" in
    2??) ;;
    000|429|5??)  # dropped connection or temporary error: keep polling
      printf 'Task %s: HTTP %s, polling again in 10s\n' "${PREDICTION_ID}" "${HTTP_CODE}" >&2
      sleep 10; continue ;;
    *) printf 'Task %s: HTTP %s\n' "${PREDICTION_ID}" "${HTTP_CODE}" >&2
      cat "${BODY_FILE}" >&2; exit 1 ;;
  esac
  RESULT=$(jq 'if type == "object" and has("data") then .data else . end' "${BODY_FILE}")
  STATUS=$(printf '%s' "${RESULT}" | jq -r '.status // empty')

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

Retry temporary errors only while polling, never the submit request. Errors, retries and timeouts

Parameters

Task Submission Parameters

Request Parameters

ParameterTypeRequiredDefaultRangeDescription
imagestringYes-Input image to upscale.
target_megapixelsnumberNo41 ~ 64Requested output size in megapixels. Range: 1-64 MP.
creativitynumberNo0-10 ~ 10Negative values stay stricter to the source; positive values add more generated detail.

Every model also accepts the global request options enable_sync_mode and enable_base64_output; see their pages for details.

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.