Flux Canny Pro

flux-canny-pro

Flux Canny Pro Model delivers accurate edge detection for precise outlines and detailed image edits

Partner Model
Fast Inference
REST API

Model Information

Response Time~15 sec
StatusActive
Version
0.0.1
Updated10 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": "flux-canny-pro",
"version": "0.0.1",
"input": {
"seed": null,
"steps": "50",
"prompt": "your prompt here",
"guidance": "30",
"control_image": "your_file.image/jpeg",
"output_format": "jpg",
"safety_tolerance": "2",
"prompt_upsampling": 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: ~15 seconds
  • Rate limit: 60 requests/minute
  • Concurrent requests: 10 maximum
  • Use long-polling to check prediction status until completion

Overview

Flux Canny Pro enables the creation of high-quality outputs from customizable inputs, blending textual prompts, visual elements, and advanced parameter settings. It is designed for users seeking versatility, from generating creative art to producing detailed, photorealistic images.

Technical Specifications

  • Guided Outputs: Combines user-provided control_image inputs with textual prompts for tailored results.
  • Configurable Parameters: Offers fine-tuning through adjustable steps, guidance, and output_format.
  • Safety Options: Includes a safety_tolerance slider for balancing content filtering.

Key Considerations

  • Prompt Clarity: Vague prompts may result in unexpected outputs. Be specific and descriptive.
  • Steps vs. Time: Higher steps values improve quality but require longer processing times.
  • Guidance Balance: Excessive guidance may limit creativity; experiment to find the ideal balance.
  • Control Image Quality: Ensure uploaded images are high-resolution and relevant to the desired outcome.
  • Safety Tolerance: Modify cautiously to prevent undesired content from being generated.


Legal Information

By using this model, you agree to:

  • Black Forest Labs API agreement
  • Black Forest Labs Terms of Service

Tips & Tricks

  • Iterative Design: Start with basic prompts and refine progressively by adding details or tweaking parameters.
  • Seed: Use the seed parameter to generate consistent variations, then select the best.
  • Guidance Experimentation: Try varying guidance values for creative exploration versus strict adherence.
  • Enhanced Outputs: Enable prompt_upsampling for crisp, detailed images, especially in professional projects.
  • Control Image Fusion: Combine text and visual inputs for unique, blended results.
  • Prompt Design: Craft clear and detailed prompts for the best results. For instance, describe settings vividly (e.g., "a peaceful mountain valley at sunrise with soft mist").

Capabilities

Creates stunning visuals from a mix of images and text.

Provides flexibility for creative and professional applications.

Supports multiple output formats for various use cases.

What can I use for?

  • Artistic Creation: Design unique digital artwork and concept illustrations.
  • Professional Visualization: Generate visuals for branding, marketing, and presentations.
  • Rapid Prototyping: Test and iterate ideas quickly with adjustable settings.

Things to be aware of

  • Detailed Scenarios: Combine prompts like "a futuristic city skyline" with a control_image for context.
  • Guidance Exploration: Adjust guidance for outputs that range from freeform creativity to precise control.
  • Iterative Refinement: Use moderate steps for previews, then increase for the final output.
  • Hybrid Inputs: Experiment with blending descriptive prompts and high-quality images to create unique designs.

Limitations

  • Abstract Prompts: May struggle with interpreting highly abstract or ambiguous descriptions.
  • Processing Demands: High steps or large outputs require significant computational time.
  • Safety Overrides: Disabling or lowering safety_tolerance increases the risk of generating unintended content.

Output Format: JPG,PNG

Related AI Models

each-upscaler

Image Upscaler by Each AI

each-upscaler

Image to Image
flux-redux-schnell

Flux Redux Schnell

flux-redux-schnell

Image to Image
recraft-creative-upscale

Recraft Creative Upscale

recraft-creative-upscale

Image to Image
eachlabs-couple

Couple Image Generation

eachlabs-couple

Image to Image