Photomaker - Image Generation

photomaker

Create photos, paintings and avatars for anyone in any style within seconds.

A40 48GB
Fast Inference
REST API

Model Information

Response Time~73 sec
StatusActive
Version
0.0.1
Updated8 days ago

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 requests
import time
API_KEY = "YOUR_API_KEY" # Replace with your API key
HEADERS = {
"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": "photomaker",
"version": "0.0.1",
"input": {
"seed": null,
"prompt": "A photo of a person img",
"num_steps": "20",
"style_name": "Photographic (Default)",
"input_image": "your_file.image/jpeg",
"num_outputs": "1",
"input_image2": "your_file.image/jpeg",
"input_image3": "your_file.image/jpeg",
"input_image4": "your_file.image/jpeg",
"guidance_scale": "5",
"negative_prompt": "nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry",
"style_strength_ratio": "20",
"disable_safety_checker": false
}
}
)
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 result
elif 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 prediction
prediction_id = create_prediction()
print(f"Prediction created: {prediction_id}")
# Get result
result = 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: ~73 seconds
  • Rate limit: 60 requests/minute
  • Concurrent requests: 10 maximum
  • Use long-polling to check prediction status until completion

Overview

PhotoMaker is an advanced AI model designed to create stunning, photorealistic transformations of input images. It specializes in portrait enhancement, style transfer, and creative image modifications, making it an ideal choice for artists, designers, and content creators.

Technical Specifications

Model Type: Deep neural network specializing in image transformation and style transfer.

Input Requirements:

  • File Formats: JPEG, PNG.
  • Recommended Resolution: Minimum 512x512 pixels for best results.
  • Max File Size: Up to 10 MB.

Output Features:

  • Supports various styles, including photorealistic and artistic effects.
  • Output formats: JPEG, PNG with a maximum resolution of 4K.

Key Considerations

Ethical Usage:

Avoid using the model for deceptive purposes or creating harmful content.

Processing Limitations:

Batch processing may not be supported. Check if manual input is required for each image.

Privacy Concerns:

Uploaded images might be stored temporarily. Refer to the privacy policy before using sensitive content.

Complete necessary data preprocessing steps before using the Photomaker - Image Generation, such as resizing or normalizing images.

Ensure your system meets the minimum requirements for running the Photomaker - Image Generation efficiently.

Verify that input data formats (.jpg, .png,.jpeg,.webp) and structures are correct to avoid errors during execution.

A word 'img' needs to be used in the prompt as well.It is necessary to use the word 'img' only once in the prompt.

Tips & Tricks

Maximize Style Customization:

Blend multiple styles for unique effects by layering transformations.

Lighting Adjustments:

Use the lighting tools to correct shadows or highlights for a more natural output.

Portrait Enhancements:

Focus on facial clarity by using specific enhancement tools for features like eyes and skin texture.

Experiment with the guidance_scale parameter to balance prompt adherence and creativity in outputs.

If you encounter errors, check input file paths and verify all required parameters are included.

Seed Parameter:

  • The seed parameter controls the randomness in the image generation process. Here’s how different values affect the output:
    • Fixed Seed: Reproduces the same result for consistent outputs.
    • Random Seed: Introduces variations, ideal for creative exploration.

Capabilities

Portrait Enhancement:

  • Automatically improves skin texture, lighting, and overall clarity.

Style Transfer:

  • Transforms photos into unique artistic styles such as Cinematic, Disney Character, Digital Art, Photographic, Fantasy Art, Neonpunk, Enhance, Comic Book, Lowpoly, and Line Art.

Creative Transformations:

  • Modify images for creative use in marketing, social media, or personal projects.

Background Adjustments:

  • Seamlessly edit or replace backgrounds while preserving subject integrity.

  • Combine up to four input images for enhanced results.
  • Generate images using textual prompts with adjustable guidance.
  • Apply prebuilt or custom styles to create unique visuals.
  • Produce multiple output images in a single execution.
  • Fine-tune image details with parameters like style_strength_ratio and guidance_scale.

What can I use for?

Content Creation with Photomaker:

  • Design eye-catching visuals for social media or advertising campaigns.

Photography Post-Processing:

  • Enhance and stylize portraits for professional or personal use.

Artistic Exploration:

  • Experiment with unique styles and compositions for creative projects.

Prototyping Visual Concepts:

  • Use AI-driven outputs as drafts for larger creative works.
  • Enhancing or restyling existing photographs.
  • Generating creative visuals for artistic or commercial projects.
  • Rapid prototyping and visualization of ideas.
  • Exploring various aesthetic styles for photography.

Things to be aware of

Portrait Glow-Up:

  • Upload a casual portrait and enhance it to look studio-quality.

Stylized Scenes:

  • Turn a photo of your cityscape into an oil painting or a cyberpunk-style visual.

Background Swaps:

  • Replace a cluttered background with a minimalistic or abstract one.

Vintage Effects with Photomaker:

  • Apply sepia tones and grainy textures to give images a nostalgic look.
  • Use prompts like "sunset over a lake in a painterly style" with different guidance_scale values to see creative variations.
  • Combine an input image with a textual prompt for style transfer (e.g., turn a photo into an oil painting).
  • Experiment with multiple input images to create unique blends.
  • Try disabling the safety checker to explore unrestricted outputs.

Limitations

Detail Loss:

  • Overly stylized outputs might lose finer details, especially in complex backgrounds.

Restricted Outputs:

  • Current model versions may not support 3D transformations or animations.

Maximum input image size: 1024x1024 pixels (larger images may need to be resized).

Known limitations include slight inaccuracies in style blending for highly complex input prompts.


Output Format: PNG

Related AI Models

fooocus-api

Fooocus

fooocus-api

Text to Image
flux-1.1-pro-ultra

Flux 1.1 Pro Ultra

flux-1-1-pro-ultra

Text to Image
recraft-20b

Recraft 20B

recraft-20b

Text to Image
imagen-3-fast

Imagen 3 Fast

imagen-3-fast

Text to Image