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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const axios = require('axios');
const FormData = require('form-data');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/consistent-character";
const reqBody = {
"seed": 42,
"prompt": "a photo of a man at a beach, wearing hawaiian shirt, looking directly at the camera",
"subject": "https://segmind-sd-models.s3.amazonaws.com/display_images/consistant-character-ip.png",
"output_format": "webp",
"output_quality": 80,
"negative_prompt": "low quality,blur",
"randomise_poses": true,
"number_of_outputs": 1,
"number_of_images_per_pose": 1
};
(async function() {
try {
const formData = new FormData();
// Append regular fields
for (const key in reqBody) {
if (reqBody.hasOwnProperty(key)) {
formData.append(key, reqBody[key]);
}
}
// Convert and append images as Base64 if necessary
const response = await axios.post(url, formData, {
headers: {
'x-api-key': api_key,
...formData.getHeaders()
}
});
console.log(response.data);
} catch (error) {
console.error('Error:', error.response ? error.response.data : error.message);
}
})();
Set a seed for reproducibility. Random by default.
Describe the subject. Include clothes and hairstyle for more consistency.
An image of a person. Best images are square close ups of a face, but they do not have to be.
An enumeration.
Allowed values:
Quality of the output images, from 0 to 100. 100 is best quality, 0 is lowest quality.
min : 0,
max : 100
Things you do not want to see in your image
Randomise the poses used.
The number of images to generate.
min : 1,
max : 20
The number of images to generate for each pose.
min : 1,
max : 4
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.
Consistent Character lets you generate new images of a specific person with remarkable consistency. It takes just one reference image and a text description of the desired pose variations. The magic lies in its ability to seamlessly transfer the person's unique characteristics onto a new body in a different pose. Unlike Insta Depth Model, this one doesn't rely on pre-defined poses. Instead, it cleverly generates a variety of poses on the fly, ensuring the character's identity remains constant while introducing exciting pose diversity. Under the hood of Consistent Character model is a combination of IP Adapter Face and instant id for image generation followed by upscaling.