1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/bria-mask-generator";
const data = {
"image_url": "https://segmind-inference-inputs.s3.amazonaws.com/fc8ac0d8-9459-49ba-afeb-7b0fb6fc0041-e22ba32d6851fb33157dca6b1172533a.png",
"content_moderation": false
};
(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);
}
})();
Enter the URL or Base64 string of your image. Use a URL for online images, Base64 for local images.
Toggle to enable or disable automatic content moderation. Enable for unknown sources, disable for known safe images.
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 Get Masks is an intuitive model that works on the principle of "image segmentation." It is capable of creating masks (outlines) within an image to create clear masks for different objects. This advanced function of creating element isolation using detailed segmentation maps within the image empowers the developers to edit the images with precision and execute the workflows flawlessly. Bria AI Get Masks model is adept at paving the way for precise object modification, replacing background elements without disturbing surrounding elements, and image customization with superior results.
When using Bria AI Get Masks, follow these tips to get optimal mask generation results -
The optional content moderation feature (when enabled) processes images from unknown sources. So, this ensures that only the safe and appropriate content is processed; if you have images from trusted sources, you can disable this option.
The model can be used for online and local processing as it is designed to accept images via URL or Base64 encoding.
The model can produce highly accurate masks for each object in an image. This supports detailed and precise editing and modification of each element.
Yes, the model supports asynchronous processing, i.e., it can execute multiple tasks at the same time. This allows the model to process a large number of images simultaneously and handle more work as needed.
The model supports API endpoints that users can integrate with existing image editing workflows with ease. This supports workflows for different tasks - content editing, image improvement, and object modification at a granular level.