Black Forest Labs
FLUX 3.1
flux-3.1/fast/edit-image
Black Forest Labs' FLUX 3.1 image models, available in Quality and Fast tiers, with separate pipelines for text-to-image and editing. Supports 1K, 2K, and native 4K, and editing accepts up to 10 reference images.
Try flux-3.1/fast/edit-image
Input
Showcases
View all showcasesOutput
Pricing
flux-3.1/fast/edit-image per image
| Specifications | Unit Price |
|---|---|
| 1K | |
| 2K | |
| 4K | |
Positioning overview
Input 1–10 reference images and a text editing instruction to obtain a modified still image. Supports 1k, 2k, and 4k resolution tiers and multiple aspect ratios, outputs jpeg or png, and offers optional automatic prompt expansion. It is suitable for e-commerce operations, marketing teams, and designers who need to make targeted edits to existing assets, such as changing a product's color scheme, adjusting the display background, or restyling a local area, and quickly produce images for product detail pages, ads, and social media.
Key highlights
- Joint editing with multiple image references — a single request can submit 1–10 https reference images and modify the image together with a prompt, making it suitable for comparing multiple variants against the same main image.
- Output specifications chosen as needed — resolution can be 1k, 2k, or 4k, aspect ratio offers multiple options from 21:9 to 9:21, and output formats support jpeg and png.
- Prompt expansion can be toggled — when enabled, short instructions are expanded into fuller descriptions; when disabled, execution strictly follows the original instruction, making it easy to control the scope of modifications.
Capability description
- Targeted reference-image editing: submit 1–10 reference images and one editing instruction to modify the image content and output the edited still image; prompts can be up to 4000 characters.
- Resolution tier selection: each request can choose one of 1k, 2k, or 4k as the output resolution, defaulting to 1k, making it easy to switch tiers based on preview or final-image needs.
- Aspect ratio control: choose one of multiple ratios such as auto, 21:9, 16:9, 1:1, and 9:16, defaulting to auto, making it convenient to match different display placements.
- Output format and moderation tolerance: output format can be jpeg or png, defaulting to jpeg; content moderation tolerance can be set from 0–6, with higher values being more permissive.
Use cases
- E-commerce operations product color changes — upload a product main image and specify the color replacement while preserving the style and angle, then output jpeg or png for the detail page and check whether the subject's colors and light-shadow transitions look natural.
- Marketing team ad mood variants — submit descriptions of different moods based on the same campaign visual, keep the main image's angle and lighting fixed, and output multiple versions in 1:1 or 9:16 for comparison before launch.
- Apparel display variation plans — upload apparel reference images, separately request adjustments to the display background or styling elements while preserving the garment's silhouette and fabric details, and output multiple images for catalogs or social media display.
- Designer local style adjustments — submit a design draft or reference image, use a short instruction to adjust the color tone or element style, and output png for further layout work; check whether the adjustments fall only within the target area.
Limitations and selection advice
Each request must provide at least 1 reference image, and reference image links must use https. Prompts can be up to 4000 characters. Resolution, aspect ratio, output format, and moderation tolerance are each set to a single choice per request. The output is a still image and does not include video or audio products. Editing results do not guarantee that unmodified areas will be completely identical to the original image, nor that image elements will be reproduced exactly.
What's new
View changelog →- New model New model release: flux-3.1/text-to-image
Frequently asked questions
View all FAQs →-
Can Quality text-to-image directly take a reference image and edit it?
No. This route only accepts text descriptions and does not accept any image input; to edit an image based on a reference image, use Quality Edit or Fast Edit instead, which require 1–10 HTTPS images. If you only have text-based creation needs, just use this route directly; aspect ratio, resolution, and output format are all set separately in the request.
-
How can I write Quality text-to-image prompts for more stable results?
Write in the order of "subject — action and scene — composition and viewpoint — lighting and atmosphere — style and image quality," covering these five categories of elements in a single paragraph; this is more reliable than piling up keywords. The prompt limit is 4000 characters, but you don't need to fill it up; put the elements you want to lock in first and secondary modifiers later, so it's easier for you to delete, edit, and pinpoint problems.
-
How many reference images can a single Quality edit take?
You can provide anywhere from 1 to 10, and they must all be HTTPS URLs. When using multiple images, clearly state in the edit instruction what role each image plays, for example which one is the main image and which one provides material or color reference; otherwise the model can only guess. The instruction is likewise subject to the 4000-character limit.
-
How do I configure Quality editing to output a large 4K image?
Just set resolution to 4k; the available values are 1k, 2k, and 4k, with 1k as the default. Specify the aspect ratio with aspect_ratio; auto lets the model decide on its own. For the output format, choose between jpeg and png with output_format; the default is jpeg. If you want lossless detail preservation, choose png.
Create a generation task
https://api.hiapi.sh/v1/tasks Headers
AuthorizationstringRequiredAccount API key. Required on every request. Example: Bearer YOUR_HIAPI_API_KEY. Get your API key
Content-TypestringOptionalThe request body is always parsed as JSON; when sent, only application/json (optionally with charset) is accepted — any other value returns 415. Example: application/json.
Idempotency-KeystringOptionalIdempotency key, up to 255 bytes. Retries with the same key from the same account create the task only once; replays return the original taskId.
On network timeouts or client retries, the same key creates the task only once — no double charges (scope: the API key's account). Use a business-unique identifier as the key (e.g. "order-42"); replays return the original taskId, and keys expire 24 hours after the first request. See the Unified Async API overview for the full scenario matrix.
Body
modelstringRequiredCurrent fixed value: flux-3.1/fast/edit-image
routestringOptionalCurrent fixed value: default
inputobjectRequired
Business parameters for flux-3.1/fast/edit-image and route default — see the parameter table below.
promptstringRequiredminLength 1maxLength 4000The edit instruction text, describing the modifications to be made to the reference image.
image_urlsarrayRequiredminItems 1maxItems 10An array of reference image URLs providing the input images needed for the edit; supports 1–10 images.
Array [ string ]
resolutionstringOptionalDefault: "1k"The output resolution tier, which determines the clarity level of the generated image; default is 1k.
1k2k4kaspect_ratiostringOptionalDefault: "auto"The output aspect ratio, controlling the width-to-height ratio of the generated image; default is auto.
auto21:92:116:93:27:54:35:4Show all (6)Show less
1:14:53:42:39:219:16output_formatstringOptionalDefault: "jpeg"The file format of the output image; default is jpeg.
jpegpngsafety_toleranceintegerOptionalDefault: 2min 0max 6The content moderation tolerance; higher values make moderation more permissive. Default is 2.
enable_prompt_expansionbooleanOptionalDefault: falseWhether to automatically expand the prompt; when enabled, the model expands the input instruction. Default is false.
callbackobjectOptional
Terminal-state notification config. When omitted, no callback is delivered — poll the task yourself. See the callback note below.
Provide callback.url when creating a task and HiAPI POSTs to your service once the task reaches a terminal state — no polling needed. The callback payload mirrors the task detail structure; signature verification, delivery retries and idempotency are documented on the Unified Async API overview page.
urlstringRequiredRequired when callback is present. A POST is sent to this URL once the task reaches a terminal state; must be a valid http(s) URL.
whenstringOptionalDefault: "final"Only final is supported today — notified on both success and fail.
finalstoragestringOptionalDefault: "temp"Artifact storage tier: temp (default, retained about 7 days) or persistent (long-term, billed by size). Insufficient balance or exceeding the storage cap silently downgrades to temp; the effective tier is shown in the task detail response.
temppersistentRequest examples
# Submit an async task; returns a taskId immediately (no waiting for generation)
curl -X POST "https://api.hiapi.sh/v1/tasks" \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-3.1/fast/edit-image",
"input": {
"prompt": "…",
"image_urls": "…",
"resolution": "1k",
"aspect_ratio": "auto",
"output_format": "jpeg",
"safety_tolerance": 2,
"enable_prompt_expansion": false
}
}' const res = await fetch("https://api.hiapi.sh/v1/tasks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HIAPI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "flux-3.1/fast/edit-image",
input: {
"prompt": "…",
"image_urls": "…",
"resolution": "1k",
"aspect_ratio": "auto",
"output_format": "jpeg",
"safety_tolerance": 2,
"enable_prompt_expansion": false
}
}),
});
const task = await res.json();
// { code: 200, message: "success", data: { taskId } } import os, requests
res = requests.post(
"https://api.hiapi.sh/v1/tasks",
headers={"Authorization": f"Bearer {os.environ['HIAPI_API_KEY']}"},
json={
"model": "flux-3.1/fast/edit-image",
"input": {
"prompt": "…",
"image_urls": "…",
"resolution": "1k",
"aspect_ratio": "auto",
"output_format": "jpeg",
"safety_tolerance": 2,
"enable_prompt_expansion": False
}
},
)
print(res.json()) # { code, message, data: { taskId } } 200 OK
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR"
}
} 400 Bad Request
{
"code": 400,
"message": "invalid request",
"data": null,
"error_code": "INVALID_REQUEST"
} Get task detail
https://api.hiapi.sh/v1/tasks/:id Response fields
taskIdstringRequiredTask ID, always prefixed with tk-hiapi-.
modelstringRequiredResolved full model name. Tasks submitted with the route parameter return base@route (e.g. gpt-image-2/text-to-image@ext); otherwise identical to the name passed at creation.
routestringOptionalPresent only when the task was submitted with an explicit route parameter; echoes the submitted value.
statusstringRequiredTask status.
queued Queued, not started yet.
handling Being processed.
archiving Processing finished, artifacts being prepared.
success Terminal: completed, artifacts available (output returned).
fail Terminal: failed (error returned).
After submission, check status: success and fail are terminal, everything else is non-terminal. Poll every 1–3 seconds until terminal. On success, download artifacts from output[].url and transfer them before expireAt; pass storage: "persistent" at creation time when long-term retention is needed.
creatednumberRequiredTask creation time (Unix seconds).
completednumberRequiredUnix seconds when the task reached a terminal state; fixed to 0 while not terminal.
outputarrayOptional
Present only when status == success. Artifact list — always an array; a single task may return multiple types at once (e.g. video + first_frame).
Array [ object ]
Array items
urlstringRequiredArtifact URL, directly downloadable.
typestringRequiredCurrent possible values: video, image, audio, first_frame, last_frame, thumbnail; more may be added later.
expireAtnumberRequiredUnix seconds until which the artifact remains accessible; download or transfer before it expires.
errorobjectOptional
Present only when status == fail.
codestringRequiredBusiness error code.
messagestringRequiredError description.
Response examples
Success
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR",
"model": "happyhorse-1-0",
"status": "success",
"created": 1777282033,
"completed": 1777282099,
"output": [
{
"url": "https://cdn.hiapi.ai/tasks/.../video.mp4",
"type": "video",
"expireAt": 1777886899
}
]
}
} Processing (non-terminal)
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "archiving",
"created": 1777282033,
"completed": 0
}
} Failed
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "fail",
"created": 1777282033,
"completed": 1777282099,
"error": {
"code": "TASK_FAILED",
"message": "task failed"
}
}
} Articles
View all articles →-
Tutorial
flux-3.1/fast/edit-image in practice: 5 high-value image editing scenarios developers can implement
From e-commerce hero images to batch asset production: integrating image editing into your business at $0.0215 per image
-
Comparison
flux-3.1/fast/edit-image selection guide: side-by-side comparison of image editing models and migration key points
-
Comparison
How to Choose Among the Four FLUX 3.1 Routes: A Decision Guide for Text-to-Image and Edit Routes
Choose Quality/Fast and text-to-image/edit based on asset type and resolution tier
-
Guide
flux-3.1/fast/edit-image Getting Started Guide: Capability Boundaries, API Integration, and Pricing Practices
A developer-oriented path for integrating an image editing model and evaluating costs
-
Tutorial
FLUX 3.1 Fast Poster Creative Comparison: Round-by-Round Practice with Text-to-Image and Image-Based Editing
-
Tutorial
FLUX 3.1 Reference Image Editing: How to Divide Roles Between the Main Image, Color Card, and Background Image
Related Models
View all models →Same Type
-
FIBO 1.5 Bria $0.058 /image -
GPT Image 2.5 OpenAI $0.0021 /image -
Recraft Creative Upscale Recraft $0.357 /image -
Z-Image Alibaba $0.008 /image -
Seedream 5.0 ByteDance $0.025 /image -
Grok Imagine xAI $0.011 /second -
Grok Imagine Quality xAI $0.070 /image -
Krea 3 Krea $0.036 /image -
BRIA Eraser Bria $0.058 /image -
Recraft Crisp Upscale Recraft $0.004 /image -
FLUX.2 Klein 4B Black Forest Labs $0.0004 /image -
GPT Image 2 OpenAI $0.007 /image
Same Provider
-
FLUX.2 Black Forest Labs $0.035 /image -
FLUX.1 Kontext Max Black Forest Labs $0.071 /image -
FLUX.2 Klein 9B Black Forest Labs $0.0086 /image -
FLUX.2 Klein 4B Black Forest Labs $0.0004 /image -
FLUX 3 Max Black Forest Labs $0.243 /second -
FLUX.1 Schnell Black Forest Labs $0.005 /image -
FLUX 3 Image Black Forest Labs $0.041 /image -
FLUX.1 Fill Pro Black Forest Labs $0.071 /image -
FLUX 1.1 Pro Black Forest Labs $0.050 /image -
FLUX 3 Image Klein Black Forest Labs $0.0092 /image -
FLUX 3 Video Black Forest Labs $0.090 /second


