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
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/clarityai-creative-upscaler";
const data = {
"image": "https://segmind-resources.s3.amazonaws.com/input/be12721d-9990-4202-bbca-198812452fdf-3_before.png",
"scale_factor": 4,
"creativity": 4,
"resemblance": 3,
"dynamic": 4,
"fractality": 1,
"style": "portrait",
"prompt": "masterpiece, best quality, highres."
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();Provides a reference image for styling. Use unique images for specific effects.
Determines upscaling quality. Use 4x for high detail, and 8x for larger projects.
min : 2,
max : 16
Adjusts the creativity effect; higher values for unique transformations, 2 for balance.
min : -10,
max : 10
Controls how much the result resembles the original; use 3 for moderate similarity.
min : -10,
max : 10
Modifies dynamic range; 0 retains original, higher for more contrast.
min : -10,
max : 10
Adds fractal texture; 1 for subtlety, 5 for pronounced detail.
min : -10,
max : 10
Selects final image style; 'portrait' for faces, 'anime' for stylized art.
Allowed values:
Guides the upscaling process with text; use 'vibrant color' for vivid results.
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.
Edited by Segmind Team on November 7, 2025.
Clarity AI is a sophisticated model that leverages advanced AI to upscale images by boosting resolution, while simultaneously preserving crucial, intricate details and making them finer for excellent outputs. Staying true to its name, Clarity AI employs cutting-edge computer vision algorithms to reconstruct images with sharper textures, improved contrast, and superior visual definition, making it a better alternative to other conventional methods that often cause blurriness or unwanted artifacts. The model delivers high-definition results, supporting upscaling from 2x to 16x, making it suitable for a range of applications, i.e., from web visuals to high-quality print images. Clarity AI seamlessly adapts to varied visual styles and quality demands, utilizing its specialized style modes for portraits and anime, along with precise creative control options.
Use 4x scale factor for most applications, as it will ensure excellent improvement in visual quality, with low processing times. Choose 2x for subtle enhancement or when file size is crucial. Go 8x or higher to produce visuals for large-format printing or when maximum detail recovery is needed, even if it takes longer processing.
Traditional upscale methods, such as bicubic interpolation, primarily work by stretching pixels, creating blur, and soft edges in the outputs. On the other hand, Clarity AI uses deep learning to analyze image context and intelligently reconstruct missing details, to produce sharper textures, clearer edges, and more natural-looking outputs that are professional grade.
The portrait mode is ideal for images featuring human faces as it will preserve skin texture, facial features, and natural skin tone. Default mode works best for landscapes, products, architecture, and general photography. Anime mode is optimized for illustrated content with distinct line art and stylized coloring.
Creativity parameter controls how much the AI "interprets" versus "preserves" the image. Higher values generate more detail but may deviate from the original content. On the contrary, the resemblance parameter ensures the output stays faithful to the source. To generate predictable results, keep both parameters near defaults: creativity to 2 and resemblance to 3.
Yes, Clarity AI offers full API support for workflow integration, making it possible to process images programmatically. This feature is perfect for e-commerce platforms that want to streamline product photo enhancement, content management systems, or custom applications that require on-demand upscaling.
AI upscaling has its limits when it comes to source images with really low resolution or that are heavily compressed. But increasing the creativity parameter slightly (to 3-4) allows more detail generation. Also, ensure you are using appropriate scale factors; creating poster-size images from thumbnails may require 8x scaling with higher fractality settings for best texture reconstruction.
