POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 const axios = require('axios'); const FormData = require('form-data'); const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/clarity-upscaler"; const reqBody = { "seed": 1337, "image": "https://segmind-sd-models.s3.amazonaws.com/display_images/clarity_upscale_input.png", "prompt": "masterpiece, best quality, highres, <lora:more_details:0.5> <lora:SDXLrender_v2.0:1>", "dynamic": 6, "handfix": "disabled", "sharpen": 0, "sd_model": "juggernaut_reborn.safetensors [338b85bc4f]", "scheduler": "DPM++ 3M SDE Karras", "creativity": 0.35, "downscaling": false, "resemblance": 0.6, "scale_factor": 1, "tiling_width": 112, "output_format": "png", "tiling_height": 144, "negative_prompt": "(worst quality, low quality, normal quality:2) JuggernautNegative-neg", "num_inference_steps": 18, "downscaling_resolution": 768 }; (async function() { try { const formData = new FormData(); // Append regular fields for (const key in reqBody) { if (reqBody.hasOwnProperty(key)) { formData.append(key, reqBody[key]); } } // Convert and append images as Base64 if necessary const response = await axios.post(url, formData, { headers: { 'x-api-key': api_key, ...formData.getHeaders() } }); console.log(response.data); } catch (error) { console.error('Error:', error.response ? error.response.data : error.message); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


seedint ( default: 1337 )

Random seed. Leave blank to randomize the seed


imagestr *

input image


maskstr ( default: 1 )

Mask image to mark areas that should be preserved during upscaling


promptstr ( default: masterpiece, best quality, highres, <lora:more_details:0.5> <lora:SDXLrender_v2.0:1> )

Prompt


dynamicfloat ( default: 6 )

HDR, try from 3 - 9

min : 1,

max : 50


handfixenum:str ( default: disabled )

An enumeration.

Allowed values:


sharpenfloat ( default: 1 )

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

min : 0,

max : 10


sd_modelenum:str ( default: juggernaut_reborn.safetensors [338b85bc4f] )

An enumeration.

Allowed values:


schedulerenum:str ( default: DPM++ 3M SDE Karras )

An enumeration.

Allowed values:


creativityfloat ( default: 0.35 )

Creativity, try from 0.3 - 0.9

min : 0,

max : 1


lora_linksstr ( default: 1 )

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


downscalingbool ( default: 1 )

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


resemblancefloat ( default: 0.6 )

Resemblance, try from 0.3 - 1.6

min : 0,

max : 3


scale_factorfloat ( default: 1 )

Scale factor


tiling_widthenum:str ( default: 112 )

An enumeration.

Allowed values:


output_formatenum:str ( default: png )

An enumeration.

Allowed values:


tiling_heightenum:str ( default: 144 )

An enumeration.

Allowed values:


custom_sd_modelstr ( default: 1 )


negative_promptstr ( default: (worst quality, low quality, normal quality:2) JuggernautNegative-neg )

Negative Prompt


num_inference_stepsint ( default: 18 )

Number of denoising steps

min : 1,

max : 100


downscaling_resolutionint ( default: 768 )

Downscaling resolution

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Clarity Upscaler

Clarity Upscaler transforms blurry images into crisp, high-definition versions. This powerful tool analyzes each pixel within an image and uses machine learning to fill in missing information, effectively increasing the resolution. Beyond simple upscaling, Clarity Upscaler acts as an intelligent enhancer. It analyzes your photos and strategically adds details to improve image quality. This can include sharpening textures in landscapes or increasing clarity in portraits. The level of detail added is entirely customizable. Clarity Upscaler offers user control over the AI's influence, allowing you to tailor the final image to your specific needs. Restore faded memories, create high-quality social media content, or simply enhance your existing photos – Clarity Upscaler enables you to achieve professional-looking results with ease.