



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-lora-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-lora-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
The Flux 2 LoRA Edit model is a cutting-edge, specialized image editing AI, meticulously fine-tuned leveraging LoRA (Low-Rank Adaptation) technology on the robust Flux 2 architecture. This innovation empowers users to achieve precise, brand-consistent, and product-specific image transformations with unparalleled efficiency and extensive customization potential.
Technical Specifications
- 🚀 Model Type: FLUX.2 [dev] LoRA-edited version
- 🧠 Architecture: Combines a 24B parameter vision-language model (Mistral-3) with a rectified flow transformer for advanced image generation and editing.
- 🖼️ Input/Output Resolution: Supports high-resolution image editing up to 4 megapixels. Note: Input images are resized to 1 MP for pricing calculations.
- 📝 Prompt Type: Versatile prompting options, supporting both natural language and structured JSON prompts for detailed control over scene, style, composition, and more.
Performance Benchmarks
- ✅ Achieves superior prompt adherence and visual fidelity compared to other open-weight models.
- ✨ Outperforms alternative open models in both single and multi-reference editing tasks.
Key Features
- 🎨 Specialized Transformation Capabilities: Adapt the model to consistently maintain brand style, execute product-specific edits, or apply unique visual effects.
- ⚡ Efficient Training and Deployment: LoRA fine-tuning significantly reduces training costs and enables instant deployment on editing endpoints.
- 🤝 Multi-Image Editing: Seamlessly combine multiple image references in a single operation, leveraging the model's learned contextual understanding.
FLUX.2 API Pricing
$0.02205 per Megapixel (1 MP input + N MP output).
Key Use Cases
- 🛒 Brand-consistent image editing for marketing materials and campaigns.
- 📦 Product-specific visual adjustments, ideal for packaging or promotional imagery.
- 🖌️ Custom style transfers tailored for creatives and agencies.
- 🛠️ High-fidelity corrections and enhancements in professional photography and design workflows.
- 📈 Automated multi-image content generation for social media, advertisements, and various digital assets.
Code Sample & Documentation
// Example snippet for Flux 2 LoRA Edit API
import requests
url = "https://api.example.com/flux-2-lora-edit" // Replace with actual API endpoint
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"input_image_url": "https://example.com/my-image.jpg",
"prompt": "Change the background to a sunny beach, add sunglasses to the person.",
"style_reference_url": "https://example.com/style-ref.jpg" // Optional
}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
print(response.json().get("edited_image_url"))
else:
print("Error:", response.text)
For comprehensive API documentation, refer to the Flux 2 LoRA Edit API Documentation.
Comparison with Other Leading Models
Flux 2 LoRA vs. Nano Banana 2
Flux 2 LoRA excels in production-grade generation, multi-reference style control, and strong typography, making it highly suitable for brand-consistent marketing content. In contrast, Nano Banana 2 emphasizes semantic editing, high-resolution 4K-class visuals, and complex scene reasoning with consistent characters across multiple edits.
Flux 2 LoRA vs. Midjourney
Flux 2 LoRA supports detailed, production-ready editing workflows, featuring a structured JSON prompt mechanism and extensive brand customization capabilities. Midjourney, while highly creative and artistic with an emphasis on stylistic generation, offers less focus on precise editing and multi-image input fusion.
Flux 2 LoRA vs. DALL·E 3
Flux 2 LoRA provides advanced multi-reference editing and detailed layout control, with high-resolution editing up to 4MP, making it ideal for professional and marketing applications. DALL·E 3, on the other hand, excels at creative image synthesis from text but offers less specialized fine-tuning for maintaining a consistent brand visual identity.
Frequently Asked Questions (FAQs)
Q: What is the primary purpose of the Flux 2 LoRA Edit model?
A: The Flux 2 LoRA Edit model is an AI designed for precise, brand-consistent, and product-specific image transformations, optimized for efficiency and customization.
Q: What are the key resolutions supported by the model?
A: It supports image editing up to 4 megapixels. Input images are resized to 1 MP for pricing.
Q: How does LoRA technology benefit the Flux 2 Edit model?
A: LoRA fine-tuning significantly reduces training costs and enables instant deployment, making specialized transformations more accessible and efficient.
Q: Can Flux 2 LoRA handle multiple image inputs?
A: Yes, it features multi-image editing, allowing users to combine multiple image references in one operation with learned contextual understanding.
Q: What are some ideal use cases for this API?
A: It's perfect for brand-consistent marketing images, product adjustments, custom style transfers, high-fidelity corrections, and automated content generation for ads and social media.
Learn how you can transformyour company with AICC APIs



Log in