Flux Pulid Serverless API
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.
POST /v2/flux-pulid · submit + poll 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5# Async (v2): submit to the queue and block until COMPLETED.
6# run() returns the final result dict (600s deadline, 1.0s poll by default).
7result = segmind.run(
8 "flux-pulid",
9 seed=720558,
10 width=896,
11 height=1152,
12 prompt="portrait of woman, neon color, cinematic",
13 main_face_image="https://segmind-sd-models.s3.amazonaws.com/display_images/flux-pulid-ip.jpeg",
14 true_cfg=1,
15 id_weight=1.05,
16 num_steps=20,
17 start_step=0,
18 num_outputs=1,
19 output_format="webp",
20 guidance_scale=4,
21 output_quality=80,
22 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",
23 max_sequence_length=128,
24)
25print(result["status"]) # COMPLETED
26print(result.get("output")) # model output (e.g. media URL)
27print(result["metrics"]["inference_time"]) # server compute seconds
28
29# --- Or submit + poll manually (track request_id, control the cadence) ---
30from segmind import SegmindClient, InferenceFailed, InferenceTimeout
31
32client = SegmindClient() # reads SEGMIND_API_KEY
33payload = {
34 "seed": 720558,
35 "width": 896,
36 "height": 1152,
37 "prompt": "portrait of woman, neon color, cinematic",
38 "main_face_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/flux-pulid-ip.jpeg",
39 "true_cfg": 1,
40 "id_weight": 1.05,
41 "num_steps": 20,
42 "start_step": 0,
43 "num_outputs": 1,
44 "output_format": "webp",
45 "guidance_scale": 4,
46 "output_quality": 80,
47 "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",
48 "max_sequence_length": 128,
49}
50job = client.submit_async("flux-pulid", **payload)
51print(job.request_id) # available immediately
52try:
53 result = job.wait(timeout=600, interval=1.0)
54except InferenceTimeout as e:
55 print("still running:", e.request_id)
56except InferenceFailed as e:
57 print("failed:", e.detail) 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5# Async (v2): submit to the queue and block until COMPLETED.
6# run() returns the final result dict (600s deadline, 1.0s poll by default).
7result = segmind.run(
8 "flux-pulid",
9 seed=720558,
10 width=896,
11 height=1152,
12 prompt="portrait of woman, neon color, cinematic",
13 main_face_image="https://segmind-sd-models.s3.amazonaws.com/display_images/flux-pulid-ip.jpeg",
14 true_cfg=1,
15 id_weight=1.05,
16 num_steps=20,
17 start_step=0,
18 num_outputs=1,
19 output_format="webp",
20 guidance_scale=4,
21 output_quality=80,
22 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",
23 max_sequence_length=128,
24)
25print(result["status"]) # COMPLETED
26print(result.get("output")) # model output (e.g. media URL)
27print(result["metrics"]["inference_time"]) # server compute seconds
28
29# --- Or submit + poll manually (track request_id, control the cadence) ---
30from segmind import SegmindClient, InferenceFailed, InferenceTimeout
31
32client = SegmindClient() # reads SEGMIND_API_KEY
33payload = {
34 "seed": 720558,
35 "width": 896,
36 "height": 1152,
37 "prompt": "portrait of woman, neon color, cinematic",
38 "main_face_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/flux-pulid-ip.jpeg",
39 "true_cfg": 1,
40 "id_weight": 1.05,
41 "num_steps": 20,
42 "start_step": 0,
43 "num_outputs": 1,
44 "output_format": "webp",
45 "guidance_scale": 4,
46 "output_quality": 80,
47 "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",
48 "max_sequence_length": 128,
49}
50job = client.submit_async("flux-pulid", **payload)
51print(job.request_id) # available immediately
52try:
53 result = job.wait(timeout=600, interval=1.0)
54except InferenceTimeout as e:
55 print("still running:", e.request_id)
56except InferenceFailed as e:
57 print("failed:", e.detail)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
Asynchronous requests (v2)
Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.
- 1
POST /v2/flux-pulidSubmit — returns request_id, status_url, response_url
- 2
GET /v2/requests/{id}/statusPoll — until COMPLETED or FAILED
- 3
GET /v2/requests/{id}Result — final response body
Status states
- A FAILED request is served as HTTP 422 — the body still carries the error detail.
- An unknown or expired request_id returns HTTP 404.
- Results are retained for 1 hour, then expire.
- Content / RAI blocks surface as FAILED, not a separate state.
- Track completion by polling the status endpoint.
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