ClarityAI Flux Upscaler

Clarity AI transforms low-resolution images into stunning high-quality visuals with unmatched detail preservation.

~174.75s
~$0.583
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/clarityai-flux-upscaler"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "image": "https://segmind-resources.s3.amazonaws.com/input/d394591c-4f41-448a-83ba-2f899674116f-output-1762260846988.png",
12    "scale_factor": 4,
13    "creativity": 3,
14    "prompt": "A serene landscape with mountains and a clear sky."
15}
16
17response = requests.post(url, headers=headers, json=data)
18
19if response.status_code == 200:
20    result = response.json()
21    print(json.dumps(result, indent=2))
22else:
23    print(f"Error: {response.status_code}")
24    print(response.text)

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

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