Documentation Index
Fetch the complete documentation index at: https://docs.bfl.ml/llms.txt
Use this file to discover all available pages before exploring further.
Edit images like magic. Describe what you want changed, and FLUX.2 makes it happen. Combine furniture from multiple photos into one room. Replace people with animals while keeping proportions perfect. Change backgrounds, swap textures, edit text—all while maintaining photorealism that matches professional photography.
Reference multiple images simultaneously - up to 8 via API, up to 10 in the playground. Use [max] for highest precision editing, [pro] for production at scale, [flex] for fine-grained control, or [klein] for cost-efficient high-volume editing.
Try it live - Upload images and describe your edits in our playground. See the magic happen in seconds.
Examples
Single Reference
Change the weather to a warm sunny day with clear blue sky and add a flock of birds flying over the treetops.
Multi Reference
API Integration
Create Request
import os
import requests
# Using image URLs directly (simplest)
# flux-2-pro-preview reflects our latest advances (use flux-2-pro for a pinned model)
response = requests.post(
'https://api.bfl.ai/v1/flux-2-pro-preview',
headers={
'accept': 'application/json',
'x-key': os.environ.get("BFL_API_KEY"),
'Content-Type': 'application/json',
},
json={
'prompt': '<What you want to edit on the image>',
'input_image': 'https://example.com/your-image.jpg',
# 'input_image_2': 'https://example.com/reference-2.jpg', # Optional
},
).json()
request_id = response["id"]
polling_url = response["polling_url"]
Poll for Result
# This assumes that the `polling_url` variable is set.
import time
import os
import requests
while True:
time.sleep(0.5)
result = requests.get(
polling_url,
headers={
'accept': 'application/json',
'x-key': os.environ.get("BFL_API_KEY"),
},
).json()
if result['status'] == 'Ready':
print(f"Image ready: {result['result']['sample']}")
break
elif result['status'] in ['Error', 'Failed']:
print(f"Generation failed: {result}")
break
Signed URLs are only valid for 10 minutes. Please retrieve your result within this timeframe.
For all available parameters and endpoint details, see the API Reference.