flux-2-flex/edit
flux-2-flex/edit
FLUX.2 [flex] Edit delivers precise image-to-image editing from Black Forest Labs—apply natural-language instructions and exact hex color control for consistent, studio-quality results. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
Examples
Parameters
| Name | Type | Default | Constraints | Description |
|---|---|---|---|---|
| prompt *Prompt | textarea | — | ≤ 5000 chars | The positive prompt for the generation. |
| images *Images | image_upload | — | image/* · 1–3 items | List of URLs of input images for editing. The maximum number of images is 3. |
| sizeSize | text | — | ≤ 500 chars | The size of the generated media in pixels (width*height). |
| seedSeed | number | — | step 1 | The random seed to use for the generation. -1 means a random seed will be used. |
Output fields
| Field | Type | Description |
|---|---|---|
| images | array<string> |
API
Call this model through one unified REST API. Get a key on the API Keys page.
cURL
# 1) Submit — returns { "task_uuid": "..." }
curl -X POST "https://www.namifusion.com/api/v1/marketplace/run/flux-2-flex/edit" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"prompt": "Edit the product photo to create a clean studio-style result: change the background to soft light gray, make the packaging matte white with the accent stripe in #2E7DFF, remove minor reflections and dust, keep the logo and overall shape unchanged, and preserve realistic lighting and shadows.",
"images": [
"https://d1s3annbwribom.cloudfront.net/marketplace/examples/2026/10/08/a1ab22050817.jpeg"
],
"size": "1024*1024",
"seed": -1
}
}'
# 2) Poll until status is "completed", then read the output URLs
curl "https://www.namifusion.com/api/v1/marketplace/run/tasks/TASK_UUID" \
-H "Authorization: Bearer YOUR_API_KEY"Python
import time, requests
API_KEY = "YOUR_API_KEY"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
# 1) Submit
resp = requests.post(
"https://www.namifusion.com/api/v1/marketplace/run/flux-2-flex/edit",
headers=HEADERS,
json={
"input": {
"prompt": "Edit the product photo to create a clean studio-style result: change the background to soft light gray, make the packaging matte white with the accent stripe in #2E7DFF, remove minor reflections and dust, keep the logo and overall shape unchanged, and preserve realistic lighting and shadows.",
"images": [
"https://d1s3annbwribom.cloudfront.net/marketplace/examples/2026/10/08/a1ab22050817.jpeg"
],
"size": "1024*1024",
"seed": -1
}
},
)
resp.raise_for_status() # 401/402/429/5xx stop here instead of polling a bad task
task = resp.json()
# 2) Poll until a terminal state (completed / failed / cancelled).
# This model is allowed up to 1800s server-side.
deadline = time.time() + 1860
while task.get("status") not in ("completed", "failed", "cancelled"):
if time.time() > deadline:
raise TimeoutError(f"still {task.get('status')} — keep the task_uuid and poll later")
time.sleep(3)
poll = requests.get(f"https://www.namifusion.com/api/v1/marketplace/run/tasks/{task['task_uuid']}", headers=HEADERS)
poll.raise_for_status()
task = poll.json()
print(task["status"], task.get("output"))JavaScript
const API_KEY = "YOUR_API_KEY";
const HEADERS = { Authorization: `Bearer ${API_KEY}` };
// 1) Submit
const resp = await fetch("https://www.namifusion.com/api/v1/marketplace/run/flux-2-flex/edit", {
method: "POST",
headers: { ...HEADERS, "Content-Type": "application/json" },
body: JSON.stringify({
"input": {
"prompt": "Edit the product photo to create a clean studio-style result: change the background to soft light gray, make the packaging matte white with the accent stripe in #2E7DFF, remove minor reflections and dust, keep the logo and overall shape unchanged, and preserve realistic lighting and shadows.",
"images": [
"https://d1s3annbwribom.cloudfront.net/marketplace/examples/2026/10/08/a1ab22050817.jpeg"
],
"size": "1024*1024",
"seed": -1
}
}),
});
if (!resp.ok) throw new Error(`submit failed: ${resp.status} ${await resp.text()}`);
let task = await resp.json();
// 2) Poll until a terminal state (completed / failed / cancelled).
// This model is allowed up to 1800s server-side.
const deadline = Date.now() + 1860 * 1000;
while (!["completed", "failed", "cancelled"].includes(task.status)) {
if (Date.now() > deadline) throw new Error(`still ${task.status} — keep the task_uuid and poll later`);
await new Promise((r) => setTimeout(r, 3000));
const poll = await fetch(`https://www.namifusion.com/api/v1/marketplace/run/tasks/${task.task_uuid}`, { headers: HEADERS });
if (!poll.ok) throw new Error(`poll failed: ${poll.status}`);
task = await poll.json();
}
console.log(task.status, task.output);Documentation
flux-2-flex/edit
flux-2-flex/edit
FLUX.2 [flex] Edit delivers precise image-to-image editing from Black Forest Labs—apply natural-language instructions and exact hex color control for consistent, studio-quality results. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
Parameters
| Parameter | Type | Required | Default | Limits / description |
|---|---|---|---|---|
prompt | string | Yes | — | max 5000 chars; The positive prompt for the generation. |
images | array | Yes | — | 1–3 URLs; List of URLs of input images for editing. The maximum number of images is 3. |
size | string | No | — | max 500 chars; The size of the generated media in pixels (width*height). |
seed | integer | No | — | The random seed to use for the generation. -1 means a random seed will be used. |
Image inputs use URL arrays in Nami, including single-image fields. Multi-image edit accepts 1–3 URLs.
Pricing
$0.12 per generated image = 12 credits. The price is fixed for this endpoint.
WaveSpeed standard list price; USD 1 = 100 credits. Account discounts are separate.
API
curl -X POST https://www.namifusion.com/api/v1/marketplace/run/flux-2-flex/edit \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"input": {
"prompt": "Edit the product photo to create a clean studio-style result: change the background to soft light gray, make the packaging matte white with the accent stripe in #2E7DFF, remove minor reflections and dust, keep the logo and overall shape unchanged, and preserve realistic lighting and shadows.",
"images": [
"https://d1s3annbwribom.cloudfront.net/marketplace/examples/2026/10/08/a1ab22050817.jpeg"
],
"size": "1024*1024",
"seed": -1
}
}'
curl 'https://www.namifusion.com/api/v1/marketplace/run/tasks/TASK_UUID' \
-H "Authorization: Bearer $API_KEY"
Submit returns task_uuid. Poll until completed or failed. Successful output: output.images (URL array). This API is asynchronous and returns URLs.
Related models
xAI Grok Imagine Image v2.0 Edit
xAI Grok Imagine Image V2.0 Edit transforms input images with text prompts, with configurable resolution and quality for precise image editing, visual refinements, creative variations, social content, marketing assets, and production workflows. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
qwen-image-edit-spicy
Precisely edit images with text instructions. Add, remove, or modify visual elements, transfer styles, and replace backgrounds for photo retouching and visual design.
Qwen Image 3.0 Pro Edit | Fast Image Editing
Qwen Image 3.0 Pro Edit is a professional-grade image editing model with superior quality and advanced instruction understanding. Up to 2k. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
OpenAI GPT Image 2.5 Sunburst Edit
High-fidelity image editing for precise transformations using up to 16 reference images.
OpenAI GPT Image 2.5 Flare Edit
Fast, balanced image editing from natural-language instructions and up to 16 reference images.
Head Swap (Image)
Swap the head in a photo with the head from a reference image. Upload the target photo first, then the head reference.
Nano Banana Image Edit
Fast & Affordable Editing. Intuitive object replacement and style transfer without manual masking.
Nano Banana Pro Image Edit
4K Semantic Editing.Modifies existing images via natural language with context awareness and multilingual text editing.