1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const axios = require('axios');
const api_key = "YOUR API KEY";
const url = "https://api.segmind.com/workflows/66721b60458d41fc488fa95d-v1";
const data = {
face_image: "publicly accessible image link",
hair_color: "the user input string"
};
axios.post(url, data, {
headers: {
'x-api-key': api_key,
'Content-Type': 'application/json'
}
}).then((response) => {
console.log(response.data);
});
1
2
3
4
5
{
"poll_url": "<base_url>/requests/<some_request_id>",
"request_id": "some_request_id",
"status": "QUEUED"
}
You can poll the above link to get the status and output of your request.
1
2
3
{
"output_image": "image in URL Format"
}
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.
Our app utilizes the Grounding DINO and Segment Anything Model (SAM) to automatically generate precise hair masks, ensuring flawless identification and segmentation of your hair for perfect results every time.
With the state-of-the-art Fooocus inpaint feature, you can effortlessly experiment with an array of new hairstyles, allowing for both subtle changes and bold new looks to suit your preferences.
Experience a seamless, user-friendly interface that leverages the power of AI to redefine your style with ease, offering you a convenient and efficient way to transform your appearance. Try it now and unlock endless hairstyling possibilities.