ClarityAI Flux Upscaler
Clarity AI transforms low-resolution images into stunning high-quality visuals with unmatched detail preservation.
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) 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
https://api.segmind.com/v1/clarityai-flux-upscalerParameters
creativityoptionalintegerSets creativity level from -10 to 10. Use 0 for realism, 10 for maximal creativity.
3Range: -10 - 10imageoptionalstring (uri)Provide an image URL for inspiration. Use realistic images for clarity; none for AI creativity.
"https://segmind-resources.s3.amazonaws.com/input/d394591c-4f41-448a-83ba-2f899674116f-output-1762260846988.png"lora_linkoptionalstringLink to a custom LoRa model. Use a link for personalized outputs.
""promptoptionalstringGuides the upscale aesthetic with a text prompt. Use detailed prompts for enriched imagery.
"A serene landscape with mountains and a clear sky."scale_factoroptionalintegerDefines the enlargement scale from 2 to 16. Choose 4 for moderate upscaling, 8 for high detail.
4Range: 2 - 16Response Type
Returns: Image
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out