



const main = async () => {
const response = await fetch('https://api.ai.cc/v1/images/generations', {
method: 'POST',
headers: {
Authorization: 'Bearer ',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'blackforestlabs/flux-2-pro-edit',
prompt: 'Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect.',
image_urls: [
'https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png',
'https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blue-mug.jpg',
],
}),
}).then((res) => res.json());
console.log('Generation:', response);
};
main();
import requests
def main():
response = requests.post(
"https://api.ai.cc/v1/images/generations",
headers={
"Authorization": "Bearer ",
"Content-Type": "application/json",
},
json={
"model": "blackforestlabs/flux-2-pro-edit",
"prompt": "Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect.",
"image_urls": [
"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png",
"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blue-mug.jpg",
],
},
)
response.raise_for_status()
data = response.json()
print("Generation:", data)
if __name__ == "__main__":
main()
-
AI Playground

Test all API models in the sandbox environment before you integrate.
We provide more than 300 models to integrate into your app.


Product Detail
FLUX.2 [pro] is a production-grade image editing model from Black Forest Labs, engineered for high-precision, multi-reference image editing workflows. It delivers state-of-the-art image quality that rivals top closed models, seamlessly combining prompt adherence, visual fidelity, speed, efficiency, and reliability. This model empowers users to execute detailed modifications through natural language commands, eliminating the need for complex manual editing or intricate masks.
⚙️Technical Specifications
- Output Resolution: Up to 4 megapixels (MP)
- Input Images: Supports multiple reference images (up to 9 images totaling 9 MP input)
- Editing Control: Natural language edits with hex color code accuracy for precise brand color matching
- Output Formats: PNG and JPEG
- Speed: Optimized for rapid iteration and production workflows with reduced latency
- Architecture: Combines latent flow transformer with a vision-language model (Mistral-3, 24B parameters) for spatial and contextual understanding
📊Performance Benchmarks
- ✅ Matches or exceeds prompt adherence and visual fidelity compared to leading closed-source image editing models.
- ⚡ Achieves faster generation times and lower costs per megapixel than comparable high-quality editing solutions.
✨Key Features
- Multi-Reference Editing: Seamlessly blends and composites up to 9 images with explicit indexing to control elements from each source image precisely.
- Natural Language Precision: Edit complex scenes, replace backgrounds, or adjust colors by describing changes in plain English.
- Hex Color Control: Utilize exact color codes for consistent and accurate branding and style adherence.
- Structural Consistency: Maintains original layout and scene integrity while enhancing textures, lighting, and detail realistically.
- Typography and UI Editing: Accurately handles text renderings and complex infographics within images.
- Iterative Editing: Supports chaining of edits for refined output quality over multiple revision cycles.
💰API Pricing
$0.0315 / MP input + $0.0315 / MP output
💡Use Cases
- 🚀 High-volume content replacement and style transformation pipelines.
- 🛍️ E-commerce product image compositing and branding asset refinement.
- 📐 UI mockups and digital design corrections, including signage and infographics.
- 🖼️ Automated background replacement and object insertion in video or image production.
- 🎯 Rapid prototyping for marketing campaigns requiring precise visual coherence.
💻Code Sample
For a full API reference, please visit: API References: Image Models / FLUX / FLUX.2 [pro] Edit
curl -X POST https://api.aimlapi.com/image/flux-edit \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "blackforestlabs/flux-2-pro-edit",
"input_images": [
{
"url": "https://example.com/image1.png",
"index": 0
}
],
"prompt": "Change the background to a sunny beach with palm trees and a clear blue sky."
}'
🆚Comparison with Other Models
vs Stable Diffusion: FLUX.2 [pro] excels in speed and multi-reference editing with natural language precision and production-ready reliability. Stable Diffusion, while capable of higher photorealistic detail and intricate textures through iterative denoising, is generally slower.
vs DALL·E 3: FLUX.2 [pro] offers superior multi-image compositing and pixel-level editing capabilities, optimized for production use with exact color control. DALL·E 3 is stronger at creative text-to-image generation with wide stylistic variation but less specialized for precise image editing and multiple reference integration.
vs Midjourney: Midjourney is known for artistic and stylized image generation with abstract qualities. FLUX.2 [pro] focuses on photorealism, detailed edits, and brand consistency, making it better suited for commercial and production applications.
❓Frequently Asked Questions (FAQ)
Q1: What is FLUX.2 [pro] designed for?
FLUX.2 [pro] is a production-grade image editing model tailored for high-precision, multi-reference image editing workflows, offering state-of-the-art quality and efficiency.
Q2: What are the main technical capabilities?
It supports output resolutions up to 4 MP, takes up to 9 input reference images, and allows for natural language edits with hex color code accuracy for precise control.
Q3: How does FLUX.2 [pro] handle complex edits?
The model uses natural language precision for complex scene edits, background replacement, and color adjustments, alongside features like structural consistency and typography editing, making intricate modifications straightforward.
Q4: What are the primary advantages over other models like Stable Diffusion or DALL·E 3?
FLUX.2 [pro] excels in speed, multi-reference image compositing, pixel-level editing, and maintaining brand consistency, making it superior for production-grade, precise image editing tasks compared to the broader creative focus of DALL·E 3 and Midjourney, or the slower iterative process of Stable Diffusion.
Q5: What are common use cases for this API?
Key applications include high-volume content transformation, e-commerce image refinement, UI mockups, automated background replacement, and rapid prototyping for marketing campaigns.
Learn how you can transformyour company with AICC APIs



Log in