1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/clarityai-flux-upscaler";
const data = {
"image": "https://segmind-resources.s3.amazonaws.com/input/d394591c-4f41-448a-83ba-2f899674116f-output-1762260846988.png",
"scale_factor": 4,
"creativity": 3,
"prompt": "A serene landscape with mountains and a clear sky."
};
(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);
}
})();Provide an image URL for inspiration. Use realistic images for clarity; none for AI creativity.
Defines the enlargement scale from 2 to 16. Choose 4 for moderate upscaling, 8 for high detail.
min : 2,
max : 16
Sets creativity level from -10 to 10. Use 0 for realism, 10 for maximal creativity.
min : -10,
max : 10
Guides the upscale aesthetic with a text prompt. Use detailed prompts for enriched imagery.
Link to a custom LoRa model. Use a link for personalized outputs.
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 5, 2025.
Clarity AI is an advanced image enhancement model that effectively improves low-resolution pictures into high-definition, without losing essential details or adding unnecessary visuals. It uses deep neural networks to enlarge images up to 16 times their original size while upholding textural details, outlines, and natural aspects close to the source image. The model works exceptionally well, performing several complex tasks: from reviving vintage photos to preparing print visuals or optimizing user-generated media, it renders professional-quality output through its simple web platform and flexible API access. Clarity AI is a perfect model for developers and creative professionals who need accurate visual results with controllable upscaling.
Unlike traditional interpolation methods, which blur or pixelate images when enlarged, Clarity AI uses neural networks to intelligently reconstruct missing details based on learned patterns from millions of images.
The 0 value faithfully preserves the original image character. Positive values perform interpretive enhancement and detail reconstruction, while negative values prioritize conservative upscaling with minimal AI interpretation.
Yes, the API supports automated workflows; you can integrate it into your pipeline for processing multiple images with consistent parameters.
Clarity AI is perfect when it comes to upscaling photographic content, product images, and artwork. Additionally, it smoothly handles faces, landscapes, textures, and architectural details.
Input size depends on the selected scale_factor; the model processes standard image formats, with output resolution determined by original dimensions multiplied by the scale_factor.
You can strike a balance based on your preferred quality and latency; lower scale factors (2x-4x) process faster while higher values (8x-16x) require more compute time but deliver maximum detail enhancement.