Consistent Character
Create images of a given character in different poses
1import requests
2import json
3
4url = "https://api.segmind.com/v1/consistent-character"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "seed": 42,
12 "prompt": "a photo of a man at a beach, wearing hawaiian shirt, looking directly at the camera",
13 "subject": "https://segmind-sd-models.s3.amazonaws.com/display_images/consistant-character-ip.png",
14 "output_format": "webp",
15 "output_quality": 80,
16 "negative_prompt": "low quality,blur",
17 "randomise_poses": true,
18 "number_of_outputs": 1,
19 "number_of_images_per_pose": 1
20}
21
22response = requests.post(url, headers=headers, json=data)
23
24if response.status_code == 200:
25 result = response.json()
26 print(json.dumps(result, indent=2))
27else:
28 print(f"Error: {response.status_code}")
29 print(response.text)
1import requests
2import json
3
4url = "https://api.segmind.com/v1/consistent-character"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "seed": 42,
12 "prompt": "a photo of a man at a beach, wearing hawaiian shirt, looking directly at the camera",
13 "subject": "https://segmind-sd-models.s3.amazonaws.com/display_images/consistant-character-ip.png",
14 "output_format": "webp",
15 "output_quality": 80,
16 "negative_prompt": "low quality,blur",
17 "randomise_poses": true,
18 "number_of_outputs": 1,
19 "number_of_images_per_pose": 1
20}
21
22response = requests.post(url, headers=headers, json=data)
23
24if response.status_code == 200:
25 result = response.json()
26 print(json.dumps(result, indent=2))
27else:
28 print(f"Error: {response.status_code}")
29 print(response.text)
API Endpoint
https://api.segmind.com/v1/consistent-character
Parameters
negative_prompt
optionalstring
Things you do not want to see in your image
"low quality,blur"
number_of_images_per_pose
optionalinteger
The number of images to generate for each pose.
1
Range: 1 - 4number_of_outputs
optionalinteger
The number of images to generate.
1
Range: 1 - 20output_format
optionalstring
An enumeration.
"webp"
"webp"
"jpg"
"png"
output_quality
optionalinteger
Quality of the output images, from 0 to 100. 100 is best quality, 0 is lowest quality.
80
Range: 0 - 100prompt
optionalstring
Describe the subject. Include clothes and hairstyle for more consistency.
"a photo of a man at a beach, wearing hawaiian shirt, looking directly at the camera"
randomise_poses
optionalboolean
Randomise the poses used.
true
seed
optionalinteger
Set a seed for reproducibility. Random by default.
42
subject
optionalstring (uri)
An image of a person. Best images are square close ups of a face, but they do not have to be.
"https://segmind-sd-models.s3.amazonaws.com/display_images/consistant-character-ip.png"
Response Type
Returns: Image
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out