ClarityAI Flux Upscaler Serverless API

Transform low-resolution images into stunning high-quality visuals.

~343.97s
POST /v2/clarityai-flux-upscaler · submit + poll
 1# pip install "segmind>=1.1.0"
 2# export SEGMIND_API_KEY="YOUR_API_KEY"
 3import segmind
 4
 5# Async (v2): submit to the queue and block until COMPLETED.
 6# run() returns the final result dict (600s deadline, 1.0s poll by default).
 7result = segmind.run(
 8    "clarityai-flux-upscaler",
 9    image="https://segmind-resources.s3.amazonaws.com/input/d394591c-4f41-448a-83ba-2f899674116f-output-1762260846988.png",
10    scale_factor=4,
11    creativity=3,
12    prompt="A serene landscape with mountains and a clear sky.",
13)
14print(result["status"])                      # COMPLETED
15print(result.get("output"))                  # model output (e.g. media URL)
16print(result["metrics"]["inference_time"])   # server compute seconds
17
18# --- Or submit + poll manually (track request_id, control the cadence) ---
19from segmind import SegmindClient, InferenceFailed, InferenceTimeout
20
21client = SegmindClient()                      # reads SEGMIND_API_KEY
22payload = {
23    "image": "https://segmind-resources.s3.amazonaws.com/input/d394591c-4f41-448a-83ba-2f899674116f-output-1762260846988.png",
24    "scale_factor": 4,
25    "creativity": 3,
26    "prompt": "A serene landscape with mountains and a clear sky.",
27}
28job = client.submit_async("clarityai-flux-upscaler", **payload)
29print(job.request_id)                         # available immediately
30try:
31    result = job.wait(timeout=600, interval=1.0)
32except InferenceTimeout as e:
33    print("still running:", e.request_id)
34except InferenceFailed as e:
35    print("failed:", e.detail)

API Endpoint

POSThttps://api.segmind.com/v1/clarityai-flux-upscaler

Parameters

creativityoptional
integer

Sets creativity level from -10 to 10. Use 0 for realism, 10 for maximal creativity.

Default: 3Range: -10 - 10
imageoptional
string (uri)

Provide an image URL for inspiration. Use realistic images for clarity; none for AI creativity.

Default: "https://segmind-resources.s3.amazonaws.com/input/d394591c-4f41-448a-83ba-2f899674116f-output-1762260846988.png"
lora_linkoptional
string

Link to a custom LoRa model. Use a link for personalized outputs.

Default: ""
promptoptional
string

Guides the upscale aesthetic with a text prompt. Use detailed prompts for enriched imagery.

Default: "A serene landscape with mountains and a clear sky."
scale_factoroptional
integer

Defines the enlargement scale from 2 to 16. Choose 4 for moderate upscaling, 8 for high detail.

Default: 4Range: 2 - 16

Response Type

Returns: Image

Asynchronous requests (v2)

Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.

  1. 1
    POST /v2/clarityai-flux-upscaler

    Submitreturns request_id, status_url, response_url

  2. 2
    GET /v2/requests/{id}/status

    Polluntil COMPLETED or FAILED

  3. 3
    GET /v2/requests/{id}

    Resultfinal response body

Status states

QUEUEDAccepted, waiting for a worker
PROCESSINGRunning on a worker
COMPLETEDDone — result body is ready
FAILEDErrored (incl. content/RAI blocks)
  • A FAILED request is served as HTTP 422 — the body still carries the error detail.
  • An unknown or expired request_id returns HTTP 404.
  • Results are retained for 1 hour, then expire.
  • Content / RAI blocks surface as FAILED, not a separate state.
  • Track completion by polling the status endpoint.

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out