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
26
27
28
29
30
31
32
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/flux-pulid";
const data = {
"seed": 720558,
"width": 896,
"height": 1152,
"prompt": "portrait of woman, neon color, cinematic",
"main_face_image": "https://segmind-sd-models.s3.amazonaws.com/display_images/flux-pulid-ip.jpeg",
"true_cfg": 1,
"id_weight": 1.05,
"num_steps": 20,
"start_step": 0,
"num_outputs": 1,
"output_format": "webp",
"guidance_scale": 4,
"output_quality": 80,
"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",
"max_sequence_length": 128
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();
Set a random seed for generation (leave blank or -1 for random)
Set the width of the generated image (256-1536 pixels)
min : 256,
max : 1536
Set the height of the generated image (256-1536 pixels)
min : 256,
max : 1536
Enter a text prompt to guide image generation
Upload an ID image for face generation
Set 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.
min : 1,
max : 10
Set the weight of the ID image influence (0.0-3.0)
min : 0,
max : 3
Set the number of denoising steps (1-20)
min : 1,
max : 20
Set the timestep to start inserting ID (0-4 recommended, 0 for highest fidelity, 4 for more editability)
min : 0,
max : 10
Set the number of images to generate (1-4)
min : 1,
max : 4
An enumeration.
Allowed values:
Set the guidance scale for text prompt influence (1.0-10.0)
min : 1,
max : 10
Set the quality of the output image for jpg and webp (1-100)
min : 1,
max : 100
Enter a negative prompt to specify what to avoid in the image
Set the max sequence length for prompt (T5), smaller is faster (128-512)
min : 128,
max : 512
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.
Flux PuLID (Pure and Lightning ID Customization) is an advanced AI model designed to seamlessly integrate specific identities, such as faces, into text-to-image models without altering their core functionalities. This model is particularly effective for generating high-fidelity images that maintain the unique identity features while allowing extensive customization through text prompts.
High Identity Fidelity: Ensures that the generated images closely resemble the input identity, maintaining high similarity and naturalness.
Tuning-Free Customization: Provides a hassle-free ID customization solution for FLUX.1-dev, eliminating the need for extensive parameter tuning.
Versatile Editing: Allows users to modify attributes, styles, and backgrounds using simple text prompts, making it ideal for both realistic and stylized image generation.
Timestep for ID Insertion (Start_Step): For Realistic Images: Set the timestep to 4. This ensures high fidelity to the input identity while maintaining a natural look. For Stylized Images: Set the timestep to 0-1. This allows for more creative and artistic interpretations of the identity.
CFG Scale: For Photorealistic Scenes: Use the “fake CFG” setting. This helps in generating scenes that look more realistic and natural. High ID Fidelity in Stylized Scenes: Use the “true CFG” setting. This ensures that the identity features are prominent even in stylized images.
*Use detailed and specific text prompts to guide the model in generating the desired attributes, styles, and backgrounds.
Personalized Avatars: Create avatars that closely resemble real individuals for use in virtual environments, games, and social media.
Digital Art: Generate customized digital art pieces with specific identity features, enhancing creativity and personalization.
Marketing and Advertising: Produce targeted marketing materials with personalized visuals that resonate with specific audiences.