Guide
flux-3.1/edit-image Getting Started Guide: Capability Boundaries, API Parameters, and Pricing Practices
On this page
What flux-3.1/edit-image is and what problems it is suited to solve
flux-3.1/edit-image is an image editing model: you give it an input image and an editing instruction, and it returns a modified image. The output type is image and the capability tag is edit-image, and these two points determine its boundaries—it does not generate text, nor is it responsible for conceiving a scene from scratch.
Tasks suitable to hand over to it typically have these characteristics:
- There is a "base image" as a starting point, such as a product image, portrait, scene photo, or design draft screenshot.
- The modification intent can be clearly described in natural language, such as replacing the background, adding or removing elements, adjusting the style, locally changing colors, or extending the frame.
- The requirement is "to make changes on existing content," not "to generate a new image out of thin air."
Unsuitable scenarios are equally clear:
- Pure text-to-image: without an input image, an editing model has nothing to work with, so a text-to-image model should be used instead.
- Text tasks: description, classification, rewriting, and structured extraction are all outside its capability scope.
- Tasks that require multi-turn conversational reasoning before generating an image; it is recommended to split them into two stages: "language model planning + editing model execution."
One-sentence criterion: as long as your request contains an image that needs to be modified, it is eligible to be a candidate; otherwise rule it out directly. To confirm the model's current availability, check the model page: /models/flux-3.1-edit-image.

Integration path on a model aggregation platform
Calling it on an aggregation platform like HiAPI.ai can be condensed into three steps, with no need to maintain a separate vendor account and key for each individual model.
Step one, select the model. Initiate the request with the model identifier flux-3.1/edit-image, and the platform handles routing to the corresponding capability. The model page provides the currently supported invocation methods and parameter descriptions; reading them before integration is better than troubleshooting afterward.
Step two, construct the request body. There are only two core parts: the input image (a URL or other forms supported by the platform) and the editing instruction text. Output specifications are attached as needed. All "how to use it" questions fall into this layer and do not involve any direct upstream operations.
Step three, process the response. What is returned is an image result, which needs to be saved to disk or transferred to your object storage; at the same time, record on the business side the model identifier, input image fingerprint, and instruction summary of each call, to facilitate later reproduction and cost attribution.
Engineering preparations recommended:
- An image address accessible to the platform (the validity period of the temporary signed URL must cover the entire invocation window).
- A unified invocation wrapper layer that centralizes the model identifier, timeouts, retries, and logging in one place, making it easy to switch models later.
- A call metadata table, with fields including at least request_id, model, input image hash, latency, and result status.

API parameter essentials: what to focus on for editing requests
Editing requests have few parameter dimensions, but each dimension involves trade-offs. The following is ordered by importance; the specific field names are subject to the model page.
Input image. This is the first factor determining success or failure. If the resolution is too low, the model does not have enough pixels for fine changes; if it is too high, it slows down processing and amplifies perceived cost. It is recommended to keep an appropriate size close to the original image and avoid uploading overly compressed images. The composition of the input image also affects the result—if the subject is half cropped out of the frame, it is difficult for the model to "guess back" the complete subject. In addition, if the input image contains sensitive content, it may directly trigger a rejection, so the caller should perform a compliance check before uploading.
Editing instruction. Most editing models understand instructions as "global semantics + local references." The more explicit the location words in the instruction (top-left corner, background, the object in the person's hand), the higher the hit rate. A counterexample is vague expressions like "make it look a bit better," where the model can only improvise randomly.
Output specifications. Whether aspect ratio and size limits can be specified depends on the parameter set currently supported by the model. The principle is: pass whatever the business needs, and do not pass an oversized size "just to be safe"—the storage and subsequent distribution costs of the output are borne by you. If the model does not expose that parameter, do not assume it exists in your code; instead use post-processing cropping.
Other common dimensions. Some editing models support strength-type parameters (degree of change), random seeds, and number of results. Seeds can be used for reproduction; the number of results can improve the hit rate of a single attempt, but it multiplies the call volume, so whether to enable it depends on your budget model.
An easily overlooked engineering point: store the parameters together with the results. When you look back three months later at an unsatisfactory output, without the complete request parameters from that time, you cannot determine whether it was a prompt problem or a parameter problem.
Pricing and cost estimation: how to calculate at $0.0429 per image
This model is billed per image, at a unit price of $0.0429 per image. The billing basis is straightforward: one successful image generation counts as one image, regardless of the pixel count of the output image (unless the platform states otherwise). This means cost estimation can be written as a one-line formula:
Daily cost ≈ daily number of images × unit price; monthly cost ≈ daily number of images × 30 × unit price.
Here are a few rough calculations at this basis for direct conversion in budget meetings:
- An average of 100 images per day: about $4.29/day, on the order of under a hundred dollars per month.
- An average of 1,000 images per day: about $42.9/day, on the order of about $1,287 per month.
- An average of 10,000 images per day: about $429/day, on the order of about $12,870 per month.
(The above are examples converted on a 30-day month basis; actual billing prevails; for real-time prices, refer to the site's pricing panel.)
What really needs attention is not the unit price, but the effective number of images. User retries, reruns after failures, and discarded drafts in batch tasks all count toward consumption. Cost control measures, ordered by cost-effectiveness:
- Improve the one-time success rate. Prompt standardization and input image pre-checks often save more money than any discount.
- Classify failures. Do not retry clear parameter errors as-is; fix them first and then send again.
- Set limits on batch tasks. Give each batch job a quota of images, and interrupt and alert when the limit is exceeded.
- Record the business attribution of each call (feature, user, experiment group), so that when costs are abnormal you can immediately locate the source.

Best practices: prompts, resolution, and retry strategies
Prompts. Writing editing instructions in a four-part pattern of "verb + object + location + expected result" significantly improves the success rate. For example, "replace the background with pure white and keep the person's original lighting." Parts that need to be preserved should be stated explicitly—the model may by default change what it thinks should be changed, so explicitly saying "keep the person's face unchanged" is a meaningful constraint. One instruction should do only one thing; splitting multiple changes into multiple calls is more controllable than stuffing them into one long description.
Input image quality. Do three things before uploading: check whether the format and size are within the supported range, confirm the subject is complete, and remove obviously blurry or overexposed images. For scenarios with user uploads, it is recommended to add an automatic pre-check to block unqualified inputs before invocation; what is saved is exactly the number of invalid images.
Concurrency and rate limiting. In batch scenarios, do not saturate all at once; use a fixed-size concurrency pool (for example, start with 4–8 concurrent requests) together with exponential backoff. Observing P95 latency and then adjusting the concurrency limit is more reliable than setting a number by feel.
Retry strategy. Distinguish three types of results: success, retryable failure (timeout, rate limiting, temporary server-side errors), and non-retryable failure (non-compliant input, illegal parameters, content rejected). Only the second type is worth retrying with backoff; the third type must go back to the input side for correction. It is recommended to cap retries at two to three times and log every attempt—otherwise you will not notice even if one task burns through five images.
Result validation. If the output image will enter downstream processes (such as automatic listing), at least perform a size and format validation, and add manual spot checks when necessary. Editing models occasionally produce results that "look completed but the subject has changed"; such problems can only be caught by business-side rules.
Common issues and troubleshooting approaches
The vast majority of failures encountered when integrating editing models can be grouped into the following categories. The troubleshooting order is recommended to proceed from the input side toward the service side.
Input image cannot be fetched. This manifests as the task failing directly or not responding for a long time. Check whether the image URL is publicly accessible, whether the signature has expired, and whether the Content-Type is correct. This is the most frequent issue and deserves the first place on the troubleshooting checklist.
Input rejected as non-compliant. Size exceeds the limit, format unsupported, or content triggers moderation. The error message usually indicates the direction; do not retry with the same image as-is; first replace the image or change the size.
Vague instruction causes the result to deviate. Technically successful, but unsatisfactory for the business. This is not an error but a hit-rate problem; go back to the prompt side to optimize, and split into multi-step editing if necessary.
Timeout. A common phenomenon with high-resolution images or during high-load periods. Reducing the input image size often has an immediate effect; use exponential backoff retries and do not resend immediately.
Result inconsistent with the input subject. The subject is over-rewritten. Check whether the instruction lacks "keep unchanged"-type constraints and whether the change strength parameter is set too high.
Abnormal cost spike. First look at the failure rate and the retry count distribution, then check whether any batch job is out of control. Treat "log every call" as a hard requirement, and such problems will almost never get out of control.
When to choose it and when to switch solutions
The conditions for choosing flux-3.1/edit-image are clear: you have an image, you need to edit the image, and the changes can be described in language. Typical examples include batch background replacement for e-commerce images, style unification for content teams' illustrations, local iteration of design drafts, and secondary processing of existing assets.
Several situations where the solution should be changed:
- Generation from scratch. When there is no input image at all, an editing model is meaningless, and a text-to-image model should be used instead.
- Need to understand first before acting. For example, "based on this product description, decide which image to change and how to change it"; this is a judgment task for a language model. Let the language model output the editing instruction, then hand it to this model for execution, forming a two-stage pipeline.
- Need precise pixel-level control. For requirements such as mask-based local inpainting and applying a fixed layout, the success rate of general editing instructions may not be sufficient; check whether there is a more specialized model or traditional image processing as a fallback.
- Text-type requirements. Classification, tagging, and description generation are all outside this model; switch directly to a language model.
A practical model-selection habit: use "whether the task requires an input image" as the first fork, and "whether the change can be clearly stated in one natural-language sentence" as the second fork. If both pass, this model is a reasonable starting point; if either fails, first look for the corresponding model category instead of trying to force the requirement in.
To confirm capability and parameter details, start from the model page: /models/flux-3.1-edit-image. First get a single image working, then talk about batching and budget.
Related articles
View all articles →-
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
-
Guide
flux-3.1/fast/text-to-image Getting Started Guide: Capability Boundaries, Billing, and Calling Practices
A hands-on route for developers to quickly integrate a text-to-image model, from capability boundaries to cost estimation
-
Guide
flux-3.1/text-to-image Getting Started Guide: Capabilities, Pricing, and Integration Practices
A decision checklist for developers integrating third-party image models