Flux Pulid
Flux PuLID: Customize AI-generated images with your unique identity. Seamlessly integrate faces into text-to-image models for realistic and customizable results. High fidelity, tuning-free customization, and versatile editing options.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/flux-pulid"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "seed": 720558,
12 "width": 896,
13 "height": 1152,
14 "prompt": "portrait of woman, neon color, cinematic",
15 "main_face_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/flux-pulid-ip.jpeg",
16 "true_cfg": 1,
17 "id_weight": 1.05,
18 "num_steps": 20,
19 "start_step": 0,
20 "num_outputs": 1,
21 "output_format": "webp",
22 "guidance_scale": 4,
23 "output_quality": 80,
24 "negative_prompt": "bad quality, worst quality, text, signature, watermark, extra limbs, low resolution, partially rendered objects, deformed or partially rendered eyes, deformed, deformed eyeballs, cross-eyed, blurry",
25 "max_sequence_length": 128
26}
27
28response = requests.post(url, headers=headers, json=data)
29
30if response.status_code == 200:
31 result = response.json()
32 print(json.dumps(result, indent=2))
33else:
34 print(f"Error: {response.status_code}")
35 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/flux-pulid"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "seed": 720558,
12 "width": 896,
13 "height": 1152,
14 "prompt": "portrait of woman, neon color, cinematic",
15 "main_face_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/flux-pulid-ip.jpeg",
16 "true_cfg": 1,
17 "id_weight": 1.05,
18 "num_steps": 20,
19 "start_step": 0,
20 "num_outputs": 1,
21 "output_format": "webp",
22 "guidance_scale": 4,
23 "output_quality": 80,
24 "negative_prompt": "bad quality, worst quality, text, signature, watermark, extra limbs, low resolution, partially rendered objects, deformed or partially rendered eyes, deformed, deformed eyeballs, cross-eyed, blurry",
25 "max_sequence_length": 128
26}
27
28response = requests.post(url, headers=headers, json=data)
29
30if response.status_code == 200:
31 result = response.json()
32 print(json.dumps(result, indent=2))
33else:
34 print(f"Error: {response.status_code}")
35 print(response.text)API Endpoint
https://api.segmind.com/v1/flux-pulidParameters
main_face_imagerequiredstring (uri)Upload an ID image for face generation
"https://segmind-sd-models.s3.amazonaws.com/display_images/flux-pulid-ip.jpeg"promptrequiredstringEnter a text prompt to guide image generation
"portrait of woman, neon color, cinematic"guidance_scaleoptionalnumberSet the guidance scale for text prompt influence (1.0-10.0)
4Range: 1 - 10heightoptionalintegerSet the height of the generated image (256-1536 pixels)
1152Range: 256 - 1536id_weightoptionalnumberSet the weight of the ID image influence (0.0-3.0)
1.05Range: 0 - 3max_sequence_lengthoptionalintegerSet the max sequence length for prompt (T5), smaller is faster (128-512)
128Range: 128 - 512negative_promptoptionalstringEnter a negative prompt to specify what to avoid in the image
"bad quality, worst quality, text, signature, watermark, extra limbs, low resolution, partially rendered objects, deformed or partially rendered eyes, deformed, deformed eyeballs, cross-eyed, blurry"num_outputsoptionalintegerSet the number of images to generate (1-4)
1Range: 1 - 4num_stepsoptionalintegerSet the number of denoising steps (1-20)
20Range: 1 - 20output_formatoptionalstringAn enumeration.
"webp""png""jpg""webp"output_qualityoptionalintegerSet the quality of the output image for jpg and webp (1-100)
80Range: 1 - 100seedoptionalintegerSet a random seed for generation (leave blank or -1 for random)
720558start_stepoptionalintegerSet the timestep to start inserting ID (0-4 recommended, 0 for highest fidelity, 4 for more editability)
0Range: 0 - 10true_cfgoptionalnumberSet the Classifier-Free Guidance (CFG) scale. 1.0 uses standard CFG, while values >1.0 enable True CFG for more precise control over generation. Higher values increase adherence to the prompt at the cost of image quality.
1Range: 1 - 10widthoptionalintegerSet the width of the generated image (256-1536 pixels)
896Range: 256 - 1536Response 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