PuLID

Novel tuning-free ID customization method for text-to-image generation.

~70.68s
~$0.205
 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

POSThttps://api.segmind.com/v1/pulid-base

Parameters

face_imagerequired
string (uri)

The face image to use for the generation

Default: "https://segmind-sd-models.s3.amazonaws.com/outputs/realvis_xl.jpeg"
checkpoint_modeloptional
string

An enumeration.

Default: "general - dreamshaperXL_alpha2Xl10"
Allowed values :
"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_styleoptional
string

An enumeration.

Default: "high-fidelity"
Allowed values :
"high-fidelity""stylized"
heightoptional
integer

Height of the output image (ignored if structure image given)

Default: 1024
negative_promptoptional
string

Things you do not want to see in your image

number_of_imagesoptional
integer

Number of images to generate

Default: 1Range: 1 - 10
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

You might need to include a gender in the prompt to get the desired result

Default: "anime middle aged professional guy"
seedoptional
integer

Set a seed for reproducibility. Random by default.

Default: -1
widthoptional
integer

Width of the output image (ignored if structure image given)

Default: 1024

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