PuLID
Novel tuning-free ID customization method for text-to-image generation.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/pulid-base"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "seed": 451312,
12 "width": 1024,
13 "height": 1024,
14 "prompt": "anime middle aged professional guy",
15 "face_image": "https://segmind-sd-models.s3.amazonaws.com/outputs/realvis_xl.jpeg",
16 "face_style": "high-fidelity",
17 "output_format": "png",
18 "output_quality": 80,
19 "checkpoint_model": "general - dreamshaperXL_alpha2Xl10",
20 "number_of_images": 1
21}
22
23response = requests.post(url, headers=headers, json=data)
24
25if response.status_code == 200:
26 result = response.json()
27 print(json.dumps(result, indent=2))
28else:
29 print(f"Error: {response.status_code}")
30 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/pulid-base"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "seed": 451312,
12 "width": 1024,
13 "height": 1024,
14 "prompt": "anime middle aged professional guy",
15 "face_image": "https://segmind-sd-models.s3.amazonaws.com/outputs/realvis_xl.jpeg",
16 "face_style": "high-fidelity",
17 "output_format": "png",
18 "output_quality": 80,
19 "checkpoint_model": "general - dreamshaperXL_alpha2Xl10",
20 "number_of_images": 1
21}
22
23response = requests.post(url, headers=headers, json=data)
24
25if response.status_code == 200:
26 result = response.json()
27 print(json.dumps(result, indent=2))
28else:
29 print(f"Error: {response.status_code}")
30 print(response.text)API Endpoint
https://api.segmind.com/v1/pulid-baseParameters
face_imagerequiredstring (uri)The face image to use for the generation
"https://segmind-sd-models.s3.amazonaws.com/outputs/realvis_xl.jpeg"checkpoint_modeloptionalstringAn enumeration.
"general - dreamshaperXL_alpha2Xl10""general - albedobaseXL_v21""general - dreamshaperXL_alpha2Xl10""animated - starlightXLAnimated_v3""animated - pixlAnimeCartoonComic_v10""realistic - rundiffusionXL_beta""realistic - RealVisXL_V4.0""realistic - sdxlUnstableDiffusers_nihilmania""cinematic - CinematicRedmond"face_styleoptionalstringAn enumeration.
"high-fidelity""high-fidelity""stylized"heightoptionalintegerHeight of the output image (ignored if structure image given)
1024negative_promptoptionalstringThings you do not want to see in your image
number_of_imagesoptionalintegerNumber of images to generate
1Range: 1 - 10output_formatoptionalstringAn enumeration.
"webp""webp""jpg""png"output_qualityoptionalintegerQuality of the output images, from 0 to 100. 100 is best quality, 0 is lowest quality.
80Range: 0 - 100promptoptionalstringYou might need to include a gender in the prompt to get the desired result
"anime middle aged professional guy"seedoptionalintegerSet a seed for reproducibility. Random by default.
-1widthoptionalintegerWidth of the output image (ignored if structure image given)
1024Response 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