POST
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 import requests api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/consistent-character" # Prepare data and files data = {} files = {} data['seed'] = 42 data['prompt'] = "a photo of a man at a beach, wearing hawaiian shirt, looking directly at the camera" # For parameter "subject", you can send a raw file or a URI: # files['subject'] = open('IMAGE_PATH', 'rb') # To send a file # data['subject'] = 'IMAGE_URI' # To send a URI data['output_format'] = "webp" data['output_quality'] = 80 data['negative_prompt'] = "low quality,blur" data['randomise_poses'] = True data['number_of_outputs'] = 1 data['number_of_images_per_pose'] = 1 headers = {'x-api-key': api_key} response = requests.post(url, data=data, files=files, headers=headers) print(response.content) # The response is the generated image
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


seedint ( default: 42 )

Set a seed for reproducibility. Random by default.


promptstr ( default: a photo of a man at a beach, wearing hawaiian shirt, looking directly at the camera )

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


subjectstr ( default: https://segmind-sd-models.s3.amazonaws.com/display_images/consistant-character-ip.png )

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


output_formatenum:str ( default: webp )

An enumeration.

Allowed values:


output_qualityint ( default: 80 )

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

min : 0,

max : 100


negative_promptstr ( default: low quality,blur )

Things you do not want to see in your image


randomise_posesbool ( default: true )

Randomise the poses used.


number_of_outputsint ( default: 1 )

The number of images to generate.

min : 1,

max : 20


number_of_images_per_poseint ( default: 1 )

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

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.