1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/bria-enhance-image";
const data = {
"image": "https://segmind-resources.s3.amazonaws.com/input/a53c2a29-1e2c-473b-ad5a-2dfdb1184dfa-e8a1673f-7919-463e-b6fb-e12ad39140f1.jpeg",
"visual_input_content_moderation": true,
"visual_output_content_moderation": true,
"seed": 123456,
"steps_num": 30,
"resolution": "4MP",
"preserve_alpha": true
};
(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 the URL of the source image. Use a valid URI for best results.
Applies moderation to input. Enable for sensitive content.
Moderates output content for safety. Enable to filter results.
Sets result predictability. Use the same seed for repeatable results.
min : 1,
max : 999999
Defines the number of refinement iterations. Higher numbers provide more detail.
min : 10,
max : 50
Selects output image resolution. Choose based on display or quality needs.
Allowed values:
Retains alpha channel from input to output. Use true for transparency.
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.
Bria AI is a next-generation generative image editing model engineered for precise, high-quality enhancements and manipulations. Powered by advanced diffusion and generative fill algorithms, Bria AI excels in background removal, replacement, blurring, object erasing, image expansion, upscaling, and smart cropping. Unlike traditional upscalers, it enriches textures and preserves original detail—including alpha channels—while safeguarding content with built‐in moderation. Asynchronous processing and status tracking streamline integration into creative pipelines, and full source code is available on Hugging Face for developers seeking customization.
1MP
, 2MP
, or 4MP
) based on final display needs. For print or large format, select 4MP.Q: How do I remove a background with Bria AI?
A: Supply the image URI and set your prompt to “remove background.” The model’s generative fill will cleanly separate subject from background.
Q: Can Bria AI upscale without losing quality?
A: Yes. Choose a higher resolution (up to 4MP) and increase steps for finer texture enrichment and edge clarity.
Q: Does Bria AI preserve transparency?
A: Enable the preserve_alpha parameter to carry forward any alpha channel from the source image.
Q: Where can I customize the model?
A: The full model code and checkpoints are available on Hugging Face under the Segmind/Bria-AI repository for advanced tuning.