bfl/flux-2/flex/edit
Flux 2 Flex Edit by BFL - AI-powered image editing, style transfer, and transformation. Edit photos with natural language instructions, remove backgrounds, change styles, and enhance images effortlessly.
PNG, JPEG, WebP, or GIF · 20 MiB maximum each
Example output — click Run to generate your own
Send your first request
OpenAI-compatible endpoint with unified authentication and usage tracking.
https://api.sandbase.ai/v1/runbfl/flux-2/flex/editInput Schema
7 parameters · 1 required · 6 optional
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Required | The prompt to generate an image from. |
seed | integer | Optional | The seed to use for the generation. |
images | string[] | Optional | List of URLs of input images for editing |
aspect_ratio | string | Optional | The aspect ratio of the generated image. · Options: 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16 21:916:93:24:35:41:14:53:42:39:16 |
output_format | string | Optional | The format of the generated image. · Options: jpeg, png · Default: "jpeg" jpegpng |
guidance_scale | number | Optional | The guidance scale to use for the generation. · Min: 1.5 · Max: 10 · Default: 3.5 |
num_inference_steps | integer | Optional | The number of inference steps to perform. · Min: 2 · Max: 50 · Default: 28 |
Output Schema
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the generation task |
status | string | Task status: pending, running, completed, failed, timeout |
model | string | Model used for the generation |
outputs | array | Array of output items |
outputs[].url | string | URL of the generated artifact |
outputs[].content_type | string | MIME type (e.g. image/png, video/mp4) |
error | object | null | Error details if failed, null on success |
error.type | string | Machine-readable error type code |
error.message | string | Human-readable error description |
Async Workflow
This model uses asynchronous execution. Submit a request and poll for the result.
- Submit — POST to /v1/run, receive an
id - Poll — GET /v1/run/{id} until status is
completed,failed, ortimeout - Retrieve — Read
outputsfrom the completed response
Code Examples
Ready-to-run snippets
# Step 1: Submit
curl -X POST https://api.sandbase.ai/v1/run \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "bfl/flux-2/flex/edit",
"images": [
"https://static.sandbase.ai/examples/bfl/flux-2/flex/edit/input_images_0.png"
],
"prompt": "Change colors of the vase. In a cozy living room setting, visualize a gradient vase placed on a table, flowing from rich #6a0dad to soft #ff69b4. Add an artistic carving text with a big font on vase says \"FLEX\" in the middle.",
"output_format": "jpeg",
"guidance_scale": 3.5,
"num_inference_steps": 28
}'
# Step 2: Poll result (replace <id>)
curl https://api.sandbase.ai/v1/run/<id> \
-H "Authorization: Bearer YOUR_API_KEY"API README
Flux 2 Flex Edit
Flux 2 Flex Edit is FLUX.2 Flex’s source-image editing route, specialized for typography, fine details, and deliberate visual control. It revises an existing composition while retaining small features, designed text, and source context that can be lost in broad regeneration.
Use Flex for posters, packaging, labels, editorial layouts, interface-like graphics, and product visuals where wording and small visual elements matter. Quote the text to replace, identify the regions that must remain stable, and describe how the revision should inherit the original styling. The route rewards explicit art direction rather than vague style keywords.
Highlights
- Typography-preserving edits. Changes visible wording or designed elements while retaining surrounding style and layout.
- Small-detail retention. Protects fine textures, labels, edges, and graphic features through revision.
- Precise source-aware control. Applies targeted semantic changes without discarding the established composition.
- Design-system continuity. Keeps hierarchy, spacing, color, and visual language coherent in updated assets.
Pricing
| Configuration | Billing unit | Price |
|---|---|---|
| Base generation | Per request | $0.05 |
When to Use
| ✅ Good fit | ❌ Consider alternatives |
|---|---|
| The project needs this exact generation or editing route | The intended task belongs to video, audio, or 3D media |
| Available references match every required local field | Required source assets or rights are unavailable |
| The brief can specify composition, color, and finish | Output must be deterministic at pixel level |
| Supported dimensions and formats fit final placement | Delivery requires unsupported canvas specifications |
| An asynchronous generated image fits production | A live frame-synchronous response is mandatory |
Prompt Guide
Write a complete visual brief: identify the subject and references, define composition and viewpoint, describe lighting, palette, materials, typography, and finish, then list exact preservation constraints. FLUX.2 Klein does not rely on prompt upsampling, so use clear descriptive sentences rather than sparse keywords.
{
"prompt": "A photorealistic editorial composition with precise subject placement, controlled lighting, exact colors, and clean typography",
"seed": 1,
"images": [
"https://example.com/reference.jpg"
],
"aspect_ratio": "21:9"
}
Technical Specs
| Spec | Value |
|---|---|
| Model ID | bfl/flux-2/flex/edit |
| Input fields | seed (integer)<br>images (array)<br>prompt (string)<br>aspect_ratio (string; 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16)<br>output_format (string; jpeg, png)<br>guidance_scale (number; 1.5–10)<br>num_inference_steps (integer; 2–50) |
| Required input | prompt |
| Output fields | url, content_type |
| Execution | Asynchronous job |
Related Models
bfl/flux-2-lora-gallery/apartment-stagingbfl/flux-2-lora-gallery/face-to-full-portraitbfl/flux-2-lora-gallery/multiple-angles

