Flux 2 | Flex | Edit
Edit images using text prompts with Flux 2 Flex. Features flexible guidance scale control, prompt expansion, and configurable safety tolerance levels.
Quick Start
Requires an each::labs API key. Get one at eachlabs.ai.
curl -X POST https://api.eachlabs.ai/v1/prediction \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"model": "flux-2-flex-edit",
"version": "0.0.1",
"input": {
"prompt": "add a dramatic sunset sky in the background",
"image_urls": ["https://example.com/photo.jpg"],
"guidance_scale": 3.5,
"image_size": "auto"
}
}'
Parameters
| Parameter |
Type |
Default |
Description |
| enable_prompt_expansion |
boolean |
true |
Whether to expand the prompt using the model's own knowledge. |
| enable_safety_checker |
boolean |
true |
Whether to enable the safety checker. |
| guidance_scale |
number |
3.5 |
The guidance scale to use for the generation. |
| image_size |
string |
auto |
The size of the generated image. enum: auto, square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9 |
| image_urls |
array |
|
List of URLs of input images for editing. |
| num_inference_steps |
integer |
28 |
The number of inference steps to perform. |
| output_format |
string |
jpeg |
The format of the generated image. enum: jpeg, png |
| prompt |
string |
|
The prompt to generate an image from. |
| safety_tolerance |
string |
2 |
The safety tolerance level. 1 is most strict, 5 is most permissive. enum: 1, 2, 3, 4, 5 |
| seed |
integer |
|
The seed to use for the generation. |
Examples
Background replacement:
curl -X POST https://api.eachlabs.ai/v1/prediction \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"model": "flux-2-flex-edit",
"version": "0.0.1",
"input": {
"prompt": "replace the background with a tropical beach at sunset",
"image_urls": ["https://example.com/portrait.jpg"],
"guidance_scale": 4.0,
"image_size": "portrait_4_3",
"output_format": "png",
"num_inference_steps": 30
}
}'
Style modification with seed:
curl -X POST https://api.eachlabs.ai/v1/prediction \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"model": "flux-2-flex-edit",
"version": "0.0.1",
"input": {
"prompt": "convert to watercolor painting, soft brush strokes",
"image_urls": ["https://example.com/landscape.jpg"],
"guidance_scale": 5.0,
"enable_prompt_expansion": false,
"seed": 42
}
}'
Related Models
Documentation
1---2name: flux-2-flex-edit3description: Flux 2 | Flex | Edit. Edit images with flexible guidance scale and prompt expansion. Triggers: image editing, flux, flex, photo edit, inpainting4---56# Flux 2 | Flex | Edit78Edit images using text prompts with Flux 2 Flex. Features flexible guidance scale control, prompt expansion, and configurable safety tolerance levels.910## Quick Start1112> Requires an each::labs API key. Get one at [eachlabs.ai](https://eachlabs.ai).1314```bash15curl -X POST https://api.eachlabs.ai/v1/prediction \16 -H "Content-Type: application/json" \17 -H "X-API-Key: $EACHLABS_API_KEY" \18 -d '{19 "model": "flux-2-flex-edit",20 "version": "0.0.1",21 "input": {22 "prompt": "add a dramatic sunset sky in the background",23 "image_urls": ["https://example.com/photo.jpg"],24 "guidance_scale": 3.5,25 "image_size": "auto"26 }27 }'28```2930## Parameters3132| Parameter | Type | Default | Description |33|-----------|------|---------|-------------|34| enable_prompt_expansion | boolean | true | Whether to expand the prompt using the model's own knowledge. |35| enable_safety_checker | boolean | true | Whether to enable the safety checker. |36| guidance_scale | number | 3.5 | The guidance scale to use for the generation. |37| image_size | string | auto | The size of the generated image. enum: auto, square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9 |38| image_urls | array | | List of URLs of input images for editing. |39| num_inference_steps | integer | 28 | The number of inference steps to perform. |40| output_format | string | jpeg | The format of the generated image. enum: jpeg, png |41| prompt | string | | The prompt to generate an image from. |42| safety_tolerance | string | 2 | The safety tolerance level. 1 is most strict, 5 is most permissive. enum: 1, 2, 3, 4, 5 |43| seed | integer | | The seed to use for the generation. |4445## Examples4647**Background replacement:**48```bash49curl -X POST https://api.eachlabs.ai/v1/prediction \50 -H "Content-Type: application/json" \51 -H "X-API-Key: $EACHLABS_API_KEY" \52 -d '{53 "model": "flux-2-flex-edit",54 "version": "0.0.1",55 "input": {56 "prompt": "replace the background with a tropical beach at sunset",57 "image_urls": ["https://example.com/portrait.jpg"],58 "guidance_scale": 4.0,59 "image_size": "portrait_4_3",60 "output_format": "png",61 "num_inference_steps": 3062 }63 }'64```6566**Style modification with seed:**67```bash68curl -X POST https://api.eachlabs.ai/v1/prediction \69 -H "Content-Type: application/json" \70 -H "X-API-Key: $EACHLABS_API_KEY" \71 -d '{72 "model": "flux-2-flex-edit",73 "version": "0.0.1",74 "input": {75 "prompt": "convert to watercolor painting, soft brush strokes",76 "image_urls": ["https://example.com/landscape.jpg"],77 "guidance_scale": 5.0,78 "enable_prompt_expansion": false,79 "seed": 4280 }81 }'82```8384## Related Models8586- [Flux 2 | Flex](../flux-2-flex/) - Text-to-image generation with Flex87- [Flux 2 Pro | Edit](../flux-2-pro-edit/) - Pro-tier image editing88- [Flux 2 | Edit](../flux-2-edit/) - Standard Flux 2 editing8990## Documentation9192- [each::labs Docs](https://docs.eachlabs.ai)93- [API Reference](https://docs.eachlabs.ai/api/overview)