Skip to main content

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

Red vintage car
Green vintage car

Change the red to #32de10.

Multi Reference

Combine character references with scene direction to produce consistent editorial shoots across multiple setups.
Multi-reference fashion editorial with consistent characters across scenes

Create a fashion editorial with consistent characters across multiple scenes

Combine furniture from multiple photos into one room and apply textures from other images.
Interior design combining furniture and textures from multiple reference images

Use the empty illuminated concrete space from the first image as the room, place all the furniture from the images inside this space, and use the purple knit texture from the uploaded image to create a blanket draped over the red chair.

Replace people with animals from different reference images while keeping proportions and scene composition natural.
Scene with animals replacing people, maintaining natural proportions

Replace the people in the image with the animals from images 2, 3, 4, 5, and 6. Adjust them to the space and style so they sit naturally in the scene. Adjust the proportions of the animals to each other and to the space

Upload a pose reference image and FLUX.2 matches it precisely — perfect for maintaining consistency across shots or recreating specific poses.
Character with matched pose from reference
Input reference images for pose and character
Reference a color from another image or use hex codes for precise color matching in edits.
Original image with gloves
Color swatch reference
Gloves changed to match reference color

Change the color of the gloves to the color of image 2

For best color matching performance, include a color square of the desired color in your reference images. FLUX.2 will match the exact color from the reference.
Use a single input image containing a collage layout to guide composition. Useful for quick layout experiments.
Quality may be slightly lower with the collage method compared to using multiple separate input images. For best results, use individual reference images when possible.
Collage input with building, people, and accessories
Cinematic street scene composed from collage elements

Create a cinematic street scene in front of the pastel-colored corner building. The man in the dark suit is leaning against the wall near the café entrance. The woman is walking past him, carrying one of the Azzedine Alaïa tote bags. The focus is on their contrasting styles — her relaxed, creative vibe versus his confident, formal look. The black boots are part of her outfit

API Integration

Create Request

# Using image URLs (simplest method)
# flux-2-pro-preview reflects our latest advances (use flux-2-pro for a pinned model)
request=$(curl -X POST \
  'https://api.bfl.ai/v1/flux-2-pro-preview' \
  -H 'accept: application/json' \
  -H "x-key: ${BFL_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
    "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"
  }')
echo $request
request_id=$(echo $request | jq -r .id)
polling_url=$(echo $request | jq -r .polling_url)

Poll for Result

while true; do
  sleep 0.5
  result=$(curl -s -X 'GET' \
    "${polling_url}" \
    -H 'accept: application/json' \
    -H "x-key: ${BFL_API_KEY}")
  
  status=$(echo $result | jq -r .status)
  echo "Status: $status"
  
  if [ "$status" == "Ready" ]; then
    echo "Result: $(echo $result | jq -r .result.sample)"
    break
  elif [ "$status" == "Error" ] || [ "$status" == "Failed" ]; then
    echo "Generation failed: $result"
    break
  fi
done
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.