Flux 2 Edit

Fal.ai's powerful multi-image composition model. Combine up to 9 reference images with advanced control over the generation process.

POST
/api/v1/models/flux-edit/edit

Edit and compose images using Flux 2

Model
Flux 2 Edit (fal.ai)
Cost
15 credits/image
Avg. Time
8-15 seconds

Multi-Image Composition

Flux 2 Edit is unique in its ability to combine up to 9 reference images. Reference them in your prompt as "the person in image 1", "the building in image 2", etc.

Request Body

NameTypeDescription
promptrequiredstringText instructions for the edit. Reference images as 'image 1', 'image 2', etc.
imageUrlrequiredstringPrimary source image URL (required)
imageUrlsstring[]Array of additional reference image URLs (up to 8 more)
resolutionstringDefault: 2KOutput resolution: '1K', '2K', '4K'
numImagesnumberDefault: 1Number of images to generate (1-4)
aspectRatiostringOutput aspect ratio
outputFormatstringDefault: png'png' or 'jpeg'
guidanceScalenumberDefault: 2.5How closely to follow the prompt (0-10)
numInferenceStepsnumberDefault: 28Quality/speed tradeoff (1-50)
seednumberRandom seed for reproducibility

Single Image Edit

"text">-purple-600">curl "text-blue-600">-X POST https://vydra.app/api/v1/models/flux"text-blue-600">-edit/edit \
  "text-blue-600">-H "Authorization: Bearer YOUR_API_KEY" \
  "text-blue-600">-H "Content">-Type: application/json" \
  "text-blue-600">-d '{
    "imageUrl": "https://example.com/portrait.jpg",
    "prompt": "Place this person on a beach at sunset, photorealistic, golden hour lighting",
    "resolution": "2K",
    "guidanceScale": 3.0
  }'

Multi-Image Composition

Combine multiple reference images into one cohesive output:

"text">-purple-600">curl "text-blue-600">-X POST https://vydra.app/api/v1/models/flux"text-blue-600">-edit/edit \
  "text-blue-600">-H "Authorization: Bearer YOUR_API_KEY" \
  "text-blue-600">-H "Content">-Type: application/json" \
  "text-blue-600">-d '{
    "imageUrl": "https://example.com/living">-room.jpg",
    "imageUrls": [
      "https://example.com/sofa.jpg",
      "https://example.com/lamp.jpg"
    ],
    "prompt": "Redesign this living room. Place the sofa from image 2 in the center and add the lamp from image 3 in the corner. Modern minimalist style.",
    "resolution": "2K"
  }'

Image Numbering

The first image (imageUrl) is "image 1". Additional images inimageUrls are numbered sequentially: "image 2", "image 3", etc.

Response

200 OKjson
{
  "images": [
    {
      "url": "https://fal.media/files/xxx/output_0.png",
      "width": 2048,
      "height": 2048,
      "content_type": "image/png"
    }
  ],
  "description": "Generated with Flux 2 Edit",
  "creditsCharged": 15,
  "durationMs": 12340
}

Response Fields

NameTypeDescription
imagesarrayArray of generated image objects
images[].urlstringPublic URL of the generated image
images[].widthnumberImage width in pixels
images[].heightnumberImage height in pixels
descriptionstringGeneration description
creditsChargednumberCredits deducted (15 × numImages)
durationMsnumberProcessing time in milliseconds

Advanced Parameters

Guidance Scale

Controls how closely the model follows your prompt. Higher values = more literal interpretation.

  • 1-2 - More creative freedom
  • 2.5 - Balanced (default)
  • 3-5 - Closer to prompt
  • 5+ - Very literal, may reduce quality

Inference Steps

More steps = higher quality but slower generation.

  • 15-20 - Fast, decent quality
  • 28 - Balanced (default)
  • 35-50 - Maximum quality

Seed

Set a specific seed for reproducible results. Using the same seed, prompt, and parameters will generate the same image.

Use Cases

Product Placement

Place products from one image into different scenes or contexts.

Interior Design

Combine furniture and decor from multiple sources into room photos.

Character Compositing

Place people from different photos into the same scene.

Style Mixing

Combine elements from different styles or time periods.

Tips for Best Results

Be Specific with References

Instead of "add the person", say "place the person from image 2 in the foreground, facing left, at about 2/3 the height of the frame".

Match Lighting

For realistic composites, try to use source images with similar lighting. Or specify "match the lighting of image 1" in your prompt.

Use Higher Steps for Complex Scenes

When combining many images, increase numInferenceSteps to 35-40 for better coherence.