Flux Img-to-Img
flux-trained
FLUX PuLID: FLUX-dev based Pure and Lightning ID Customization via Contrastive Alignment
Model Information
Input
Configure model parameters
Output
View generated results
Result
Preview, share or download your results with a single click.




Prerequisites
- Create an API Key from the Eachlabs Console
- Install the required dependencies for your chosen language (e.g., requests for Python)
API Integration Steps
1. Create a Prediction
Send a POST request to create a new prediction. This will return a prediction ID that you'll use to check the result. The request should include your model inputs and API key.
import requestsimport timeAPI_KEY = "YOUR_API_KEY" # Replace with your API keyHEADERS = {"X-API-Key": API_KEY,"Content-Type": "application/json"}def create_prediction():response = requests.post("https://api.eachlabs.ai/v1/prediction/",headers=HEADERS,json={"model": "flux-trained","version": "0.0.1","input": {"seed": 0,"width": 896,"height": 1152,"prompt": "portrait, color, cinematic","true_cfg": 1,"id_weight": 1,"num_steps": 20,"start_step": 1,"num_outputs": 1,"output_format": "webp","guidance_scale": 4,"output_quality": 80,"main_face_image": "your_file.image/jpeg","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}})prediction = response.json()if prediction["status"] != "success":raise Exception(f"Prediction failed: {prediction}")return prediction["predictionID"]
2. Get Prediction Result
Poll the prediction endpoint with the prediction ID until the result is ready. The API uses long-polling, so you'll need to repeatedly check until you receive a success status.
def get_prediction(prediction_id):while True:result = requests.get(f"https://api.eachlabs.ai/v1/prediction/{prediction_id}",headers=HEADERS).json()if result["status"] == "success":return resultelif result["status"] == "error":raise Exception(f"Prediction failed: {result}")time.sleep(1) # Wait before polling again
3. Complete Example
Here's a complete example that puts it all together, including error handling and result processing. This shows how to create a prediction and wait for the result in a production environment.
try:# Create predictionprediction_id = create_prediction()print(f"Prediction created: {prediction_id}")# Get resultresult = get_prediction(prediction_id)print(f"Output URL: {result['output']}")print(f"Processing time: {result['metrics']['predict_time']}s")except Exception as e:print(f"Error: {e}")
Additional Information
- The API uses a two-step process: create prediction and poll for results
- Response time: ~41 seconds
- Rate limit: 60 requests/minute
- Concurrent requests: 10 maximum
- Use long-polling to check prediction status until completion
Overview
PuLID-FLUX is a tuning-free ID customization solution designed for the FLUX.1-dev text-to-image model. It enables the seamless integration of specific identities, such as faces, into generated images without altering the core functionalities of the base model. This approach maintains high identity fidelity while allowing extensive customization through text prompts.
Technical Specifications
PuLID-FLUX is a highly efficient and flexible model enhancement that integrates seamlessly with the FLUX.1-dev text-to-image generator. It specializes in adding identity-specific details to generated images, making it ideal for applications where facial accuracy and identity preservation are key.
Input Requirements
Minimum Input Size: 256x256 pixels
Maximum Input Size: 1024x1024 pixels
Optimal Input Size: 512x512 pixels (best for quality and speed).
Ensure your input images fall within these dimensions to achieve high-quality results.
Output Details
Default Resolution: 512x512 pixels.
Key Considerations
Image customization with identity preservation
Integrated with FLUX.1-dev text-to-image model
High identity similarity maintenance
Background, lighting, and style consistency
Advanced editing options
Tips & Tricks
Adjusting Identity Insertion Timestep: Modifying this parameter can balance between identity fidelity and image editability.
Image Resolution: Providing input images within the recommended size range (256x256 to 1024x1024 pixels) ensures optimal performance.
Experimentation: Varying prompts and settings can yield diverse and creative outputs; users are encouraged to experiment to achieve desired results.
Capabilities
Identity Customization: Seamless integration of specific identities into generated images.
Attribute Modification: Ability to alter attributes such as age, expression, and hairstyle through text prompts.
High-Quality Output: Generation of images with high resolution and fidelity.
What can I use for?
Avatar Creation: Design personalized avatars for social media, gaming, or virtual environments.
Digital Art: Produce artworks featuring specific individuals in various styles and settings.
Prototyping: Visualize character designs for
Things to be aware of
- Combine Text Prompts with Visual Inputs
Use creative and descriptive text prompts alongside input images to generate dynamic and unique outputs. For example:- "A futuristic version of [input identity] in a cyberpunk city"
- "A hand-drawn sketch of [input identity] in an ancient warrior's armor."
- Style Transformation
Explore various artistic styles, such as watercolor, oil painting, or surrealism, while preserving the subject’s identity.- Example: "An oil painting of [input identity] in the style of the Renaissance."
- Attribute Modification
Modify age, expression, or other features using text prompts.- Example: "Make [input identity] look 20 years older with a happy expression."
- Background Customization
Experiment with generating outputs in different settings.- Example: "[Input identity] standing on a tropical beach during sunset."
- High-Quality Outputs for Printing
Use input images with resolutions of 512x512 or higher and set parameters for ultra-high-quality outputs suitable for printing or showcasing. - Focus on Lighting and Composition
Add lighting effects or scene descriptions for dramatic results.- Example: "A cinematic portrait of [input identity] under a spotlight in a dark theater."
- Multiple Identity Blends
Try blending multiple identities or input features to create hybrid outputs.- Example: "A fusion of [input identity 1] and [input identity 2] as a superhero."
- Creative Use Cases
Push the boundaries of the model’s capabilities by combining functionality with other AI tools.- Example: Use outputs as input for video editing, digital animations, or augmented reality applications.
Experiment with different timestep values
Test various styles and compositions
Try different lighting and background combinations
Compare stylized and realistic outputs
Experiment with portrait and full-body photos
Create images in various artistic styles
Limitations
Identity Fidelity: While improved, the model may still struggle with accurately replicating certain identities, particularly male faces.
Output Format: PNG, WEBP