Clarity Upscaler

High resolution creative image Upscaler and Enhancer. A free Magnific alternative.

~17.72s
~$0.017
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/clarity-upscaler"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "seed": 1337,
12    "image": "sample text",
13    "mask": "sample text",
14    "prompt": "masterpiece, best quality, highres, <lora:more_details:0.5> <lora:SDXLrender_v2.0:1>",
15    "dynamic": 6,
16    "handfix": "disabled",
17    "sharpen": 1,
18    "sd_model": "juggernaut_reborn.safetensors [338b85bc4f]",
19    "scheduler": "DPM++ 3M SDE Karras",
20    "creativity": 0.35,
21    "lora_links": "sample text",
22    "downscaling": false,
23    "resemblance": 0.6,
24    "scale_factor": 1,
25    "tiling_width": 112,
26    "output_format": "png",
27    "tiling_height": 144,
28    "custom_sd_model": "sample text",
29    "negative_prompt": "(worst quality, low quality, normal quality:2) JuggernautNegative-neg",
30    "num_inference_steps": 18,
31    "downscaling_resolution": 768
32}
33
34response = requests.post(url, headers=headers, json=data)
35
36if response.status_code == 200:
37    result = response.json()
38    print(json.dumps(result, indent=2))
39else:
40    print(f"Error: {response.status_code}")
41    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/clarity-upscaler

Parameters

imagerequired
string (base64)

input image

creativityoptional
number

Creativity, try from 0.3 - 0.9

Default: 0.35Range: 0 - 1
custom_sd_modeloptional
string
Default: ""
downscalingoptional
boolean

Downscale the image before upscaling. Can improve quality and speed for images with high resolution but lower quality

Default: false
downscaling_resolutionoptional
integer

Downscaling resolution

Default: 768
dynamicoptional
number

HDR, try from 3 - 9

Default: 6Range: 1 - 50
handfixoptional
string

An enumeration.

Default: "disabled"
Allowed values :
"disabled""hands_only""image_and_hands"
lora_linksoptional
string

Link to a lora file you want to use in your upscaling. Multiple links possible, seperated by comma

Default: ""
maskoptional
string (base64)

Mask image to mark areas that should be preserved during upscaling

Default: null
negative_promptoptional
string

Negative Prompt

Default: "(worst quality, low quality, normal quality:2) JuggernautNegative-neg"
num_inference_stepsoptional
integer

Number of denoising steps

Default: 18Range: 1 - 100
output_formatoptional
string

An enumeration.

Default: "png"
Allowed values :
"webp""jpg""png"
promptoptional
string

Prompt

Default: "masterpiece, best quality, highres, <lora:more_details:0.5> <lora:SDXLrender_v2.0:1>"
resemblanceoptional
number

Resemblance, try from 0.3 - 1.6

Default: 0.6Range: 0 - 3
scale_factoroptional
number

Scale factor

Default: 1
scheduleroptional
string

An enumeration.

Default: "DPM++ 3M SDE Karras"
Allowed values (30 total):
"DPM++ 2M Karras""DPM++ SDE Karras""DPM++ 2M SDE Exponential""DPM++ 2M SDE Karras""Euler a""Euler""LMS""Heun""DPM2""DPM2 a"+20 more
sd_modeloptional
string

An enumeration.

Default: "juggernaut_reborn.safetensors [338b85bc4f]"
Allowed values :
"epicrealism_naturalSinRC1VAE.safetensors [84d76a0328]""juggernaut_reborn.safetensors [338b85bc4f]""flat2DAnimerge_v45Sharp.safetensors"
seedoptional
integer

Random seed. Leave blank to randomize the seed

Default: 1337
sharpenoptional
number

Sharpen the image after upscaling. The higher the value, the more sharpening is applied. 0 for no sharpening

Default: 0Range: 0 - 10
tiling_heightoptional
integer

An enumeration.

Default: 144
Allowed values (16 total):
163248648096112128144160+6 more
tiling_widthoptional
integer

An enumeration.

Default: 112
Allowed values (16 total):
163248648096112128144160+6 more

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