Flux 2 Edit
Fal.ai's powerful multi-image composition model. Combine up to 9 reference images with advanced control over the generation process.
/api/v1/models/flux-edit/editEdit and compose images using Flux 2
Multi-Image Composition
Request Body
| Name | Type | Description |
|---|---|---|
promptrequired | string | Text instructions for the edit. Reference images as 'image 1', 'image 2', etc. |
imageUrlrequired | string | Primary source image URL (required) |
imageUrls | string[] | Array of additional reference image URLs (up to 8 more) |
resolution | stringDefault: 2K | Output resolution: '1K', '2K', '4K' |
numImages | numberDefault: 1 | Number of images to generate (1-4) |
aspectRatio | string | Output aspect ratio |
outputFormat | stringDefault: png | 'png' or 'jpeg' |
guidanceScale | numberDefault: 2.5 | How closely to follow the prompt (0-10) |
numInferenceSteps | numberDefault: 28 | Quality/speed tradeoff (1-50) |
seed | number | Random 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
imageUrl) is "image 1". Additional images inimageUrls are numbered sequentially: "image 2", "image 3", etc.Response
{
"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
| Name | Type | Description |
|---|---|---|
images | array | Array of generated image objects |
images[].url | string | Public URL of the generated image |
images[].width | number | Image width in pixels |
images[].height | number | Image height in pixels |
description | string | Generation description |
creditsCharged | number | Credits deducted (15 × numImages) |
durationMs | number | Processing time in milliseconds |
Advanced Parameters
Guidance Scale
Controls how closely the model follows your prompt. Higher values = more literal interpretation.
1-2- More creative freedom2.5- Balanced (default)3-5- Closer to prompt5+- Very literal, may reduce quality
Inference Steps
More steps = higher quality but slower generation.
15-20- Fast, decent quality28- 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.