Photon

photon

Photon is a high-speed, lightweight rendering engine for creating realistic graphics and animations in real-time

Fast Inference
REST API

Model Information

Response Time~11 sec
StatusActive
Version
0.0.1
Updated17 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": "photon",
"version": "0.0.1",
"input": {
"seed": null,
"prompt": "your prompt here",
"aspect_ratio": "16:9",
"image_reference_url": "your image reference url here",
"style_reference_url": "your style reference url here",
"image_reference_weight": "0.85",
"style_reference_weight": "0.85",
"character_reference_url": "your character reference url here"
}
}
)
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: ~11 seconds
  • Rate limit: 60 requests/minute
  • Concurrent requests: 10 maximum
  • Use long-polling to check prediction status until completion

Overview

Photon is an image model for generating visually stunning and customized content by leveraging a range of input parameters. Designed to produce high-quality outputs tailored to user preferences, it excels in creating imagery and sequences with precise control over visual elements such as aspect ratio, style, and character references. With its intuitive inputs and advanced capabilities, Photon allows users to explore their creativity and achieve great results.

Technical Specifications

  • Adaptive Visual Rendering: Employs advanced algorithms to synthesize outputs with high fidelity and detail.
  • Customizable Parameters: Photon offers a wide range of inputs for personalized and specific content creation.
  • Reference Integration: Photon supports multiple reference types (image, style, character) for contextual and stylistic guidance.
  • Aspect Ratio Flexibility: Ensures compatibility with diverse display formats, from square to ultra-wide.
  • Reproducibility: Facilitates consistent results using the seed parameter for controlled variations.

Key Considerations

  • Prompt Precision: The quality and relevance of the prompt significantly influence the output. Avoid vague or overly complex instructions.
  • Aspect Ratio Compatibility: Ensure the chosen aspect_ratio aligns with the intended use case to prevent cropping or distortion.
  • Reference Input Quality: High-resolution and contextually appropriate references enhance output fidelity.
  • Seed Reproducibility: Use the same seed for identical outputs or vary it to explore creative possibilities.


Legal Information for Photon

By using this model, you agree to:

Tips & Tricks

Prompt for Photon:

  • Keep prompts short yet descriptive to ensure clarity and relevance.
  • Use action-oriented language and specific keywords to guide the model effectively.

Aspect Ratio:

  • 1:1: Best for social media posts and profile pictures; ensures a balanced and symmetric composition.
  • 3:4: Suitable for portrait-oriented outputs, such as posters or digital art.
  • 4:3: Works well for classic photo frames and versatile display needs.
  • 9:16: Ideal for vertical content, including social media stories and mobile displays.
  • 16:9: The standard for widescreen displays, presentations, and cinematic visuals.
  • 9:21: Useful for ultra-vertical content in immersive or specialized displays.
  • 21:9: Perfect for ultra-wide monitors and cinematic effects.

Image, Style, and Character References:

  • Use clear and high-resolution URLs for reference inputs to guide the model effectively.
  • Combine image_reference_url and style_reference_url to create outputs that merge contextual relevance with artistic flair.
  • Adjust weights (image_reference_weight and style_reference_weight) to fine-tune the balance between reference influences.
  • Provide distinct character_reference_url inputs for outputs requiring character-specific details.

Seed:

  • Use a fixed seed value for consistency when generating iterative outputs.
  • Experiment with varying seed values to explore creative variations and discover unique possibilities.

Capabilities

Enhanced Visual Outputs

  • Generates high-quality, contextually rich visuals tailored to user inputs.
  • Combines multiple references seamlessly to create cohesive and visually striking outputs.

Adaptive Input Handling

  • Supports diverse input types and combinations for versatile content generation.
  • Offers robust control over visual style, composition, and thematic elements.

Creative Exploration for Photon

  • Enables experimentation with prompts, references, and aspect ratios for innovative results.
  • Facilitates reproducibility and variation through the seed parameter.

What can I use for?

  • Content Creation: with Photon, you can design stunning visuals for social media, branding, and marketing.
  • Artistic Exploration: Experiment with styles, compositions, and references to generate unique artwork.
  • Storytelling: Craft visually compelling narratives using customized references and prompts.
  • Educational Purposes: Create engaging visuals for teaching, tutorials, or demonstrations.

Things to be aware of

  • Combine multiple references (image, style, character) to explore unique compositions.
  • Experiment with aspect ratios to discover the best fit for your desired output.
  • Use varying weights for style and image references to find the perfect balance.
  • Test different seed values to uncover unexpected and creative results.
  • Create cohesive visual stories by linking prompt and reference inputs strategically.

Limitations

  • Prompt Dependency: Outputs are highly influenced by the clarity and specificity of the prompt.
  • Reference Quality: Poor-quality reference URLs may result in suboptimal outputs.
  • Aspect Ratio Constraints: Certain extreme ratios might not yield ideal results.

Output Format: JPG

Related AI Models

omni-zero-couples

Omni Zero Couple

omni-zero-couples

Text to Image
flux-hf-lora

FLUX HF LoRA

flux-hf-lora

Text to Image
stable-diffusion-3.5-medium

Stable Diffusion 3.5 Medium

stable-diffusion-3-5-medium

Text to Image
stable-diffusion-3.5-large-turbo

Stable Dıffusion 3.5 Large Turbo

stable-diffusion-3-5-large-turbo

Text to Image