Consistent Character

Create images of a given character in different poses

~61.58s
~$0.085
 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

POSThttps://api.segmind.com/v1/consistent-character

Parameters

negative_promptoptional
string

Things you do not want to see in your image

Default: "low quality,blur"
number_of_images_per_poseoptional
integer

The number of images to generate for each pose.

Default: 1Range: 1 - 4
number_of_outputsoptional
integer

The number of images to generate.

Default: 1Range: 1 - 20
output_formatoptional
string

An enumeration.

Default: "webp"
Allowed values :
"webp""jpg""png"
output_qualityoptional
integer

Quality of the output images, from 0 to 100. 100 is best quality, 0 is lowest quality.

Default: 80Range: 0 - 100
promptoptional
string

Describe the subject. Include clothes and hairstyle for more consistency.

Default: "a photo of a man at a beach, wearing hawaiian shirt, looking directly at the camera"
randomise_posesoptional
boolean

Randomise the poses used.

Default: true
seedoptional
integer

Set a seed for reproducibility. Random by default.

Default: 42
subjectoptional
string (uri)

An image of a person. Best images are square close ups of a face, but they do not have to be.

Default: "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.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out