Tutorial
FLUX 3.1 Reference Image Editing: How to Divide Roles Between the Main Image, Color Card, and Background Image
On this page
Choose the right route first: text-to-image or editing
When creating images with FLUX 3.1, the first thing to do is not to write a prompt but to choose a route. The platform offers four paths: Quality text-to-image, Quality editing, Fast text-to-image, and Fast editing. The dividing line is very clear — text-to-image accepts only text, while editing accepts text plus reference images.
This rule determines which path many requirements should take from the very start. If all you have is a description and you want the model to compose from scratch, use text-to-image. If you already have a photo of a pottery object, a color card, and an interior set image and want to organize them into a new image, you must use editing. The editing route has hard prerequisites: attach 1–10 HTTPS reference images and provide an editing instruction. Without reference images, the editing request is invalid; stuffing images into a text-to-image request is equally invalid.
So the criterion can be compressed into one sentence: is there visual material that must be carried over? If yes, choose editing; if no, use text-to-image. Once the wrong route is chosen, no amount of prompt tuning will help, because the model never received your images.
All subsequent discussion in this article concerns the editing route. The example places the same pottery object into two different sets and uses it to demonstrate the division of roles among reference images and the inspection workflow. You can learn about the capabilities and parameters of Quality editing at /models/flux-3.1-edit-image; if turnaround speed matters more to you, /models/flux-3.1-fast-edit-image is the Fast editing entry point.
Each of the three reference image types handles one job
The editing route allows 1–10 reference images, and this range is easy to misuse: many people pile all relevant information in at once and expect the model to judge which image matters. A more reliable practice is to assign each image a single role.
- Main image: defines the subject itself. Shape, proportions, structure, and material characteristics all come from here. In the pottery case, the main image is the photo of the vessel.
- Color card: defines the color reference. It is neither the subject nor the background, just a set of color samples used to constrain the overall tonal tendency.
- Background image: defines the environment. The spatial structure of the set, furniture, wall texture, and the implied shooting angle are all provided by it.
The reason one image should have one role is practical: when the result is wrong, you need to know which type of information caused the problem. If a single image carries both subject and background and the outline is altered, you cannot tell whether subject information was overridden by environmental information or whether the reference image itself is ambiguous. Once roles are separated, troubleshooting becomes a single-variable comparison: "replace one role, leave the rest unchanged."
Conversely, role conflict is a common source of editing results going off track. Use a full-body photo with a complex background as the main image, and background information enters along with the subject; use the color card as the subject image, and the model may try to generate a color swatch. The number of reference images does not equal information quality; three images with clear roles are usually better than ten that interfere with each other.
Preparing an edit of one pottery object in two sets
Now apply this division of roles to a concrete task: have the same pottery object appear in two different sets.
Step one: determine the main image and fix it. Choose a pottery photo with clean lighting, a fully visible vessel, and a clear angle, and use it as the main image shared by both edits. This image stays exactly the same across both requests and is the baseline for the whole controlled comparison.
Step two: prepare two background images. Set A can be an indoor countertop scene, and set B can be a different environment. The two images are independent, with no overlap or stitching.
Step three: prepare a color card. If you want both results to share a consistent tonal tendency, reuse the same color card; if you want each set to carry its own color atmosphere, you can omit the color card and let the background image lead the color. The key here is deciding explicitly whether the color card participates, not tossing one in casually.
Step four: write the editing instruction. The instruction should state "what to do," not restate "what is in the image." For example, specify that the subject remains unchanged, place it into the environmental relationship of the reference background, and adjust lighting according to the environment. The prompt limit is 4000 characters, which is more than enough; the real constraint is not length but whether the instruction makes the roles clear.
The difference between the two requests should be only the background image (and the accompanying instruction wording). The main image stays the same, the color-card strategy stays the same, and the tier stays the same, so that the inspections in the next two steps are meaningful.
Check the silhouette: was the subject altered?
Once the two results are out, the first inspection item is the silhouette.
View the two results side by side with the main image and focus on the outer edges of the vessel: the curvature of the rim, the turn of the belly, the width of the foot, and the relative positions of handles or decoration. These are the structural features of the subject and the part most easily eroded by background information.
The judgment can proceed in order:
- First look at the overall silhouette. Shrink the result very small — does the outline still match the main image?
- Then look at key turning points. Are the vessel's neck, widest diameter, and bottom contact surface still in the same positions?
- Finally look at detailed structure. Are the components attached to the subject still in place, and have their proportions been stretched or compressed?
If only one set shows a silhouette shift while the other is normal, the problem most likely comes from a spatial conflict between the background image and the subject — for example, the background image contains a similarly shaped object, and the model merged it with the subject. The fix here is not to lengthen the prompt but to switch to a cleaner background image or to adjust the wording about positional relationships in the instruction.
Set expectations in advance: the platform does not promise pixel-level restoration and does not provide masking or transparent cutout capabilities. Acceptance criteria should be based on "are the silhouette and structural features consistently preserved in an explainable way," not on "is it identical pixel for pixel."
Check lighting: is the environment self-consistent?
Once the silhouette passes, the second inspection item is lighting. This step determines whether the result looks like it is "really in the scene" or "pasted on."
Observe at three levels:
- Light and dark direction: does the lit side of the subject match the light source direction in the background image? If the window in the background image is on the left but the subject is lit from the right, it will give the game away.
- Reflections and highlights: for glazed materials like pottery, highlight positions reveal the light source direction. Check whether highlights change with the set, rather than both results retaining the original highlights from the main image.
- Contact shadows: is there a reasonable shadow where the bottom of the vessel meets the countertop? A floating feeling, misaligned shadow direction, or shadow density that does not match the ambient light are all common problems.
The lighting in the two results should each be self-consistent with its own set, not identical to each other. If the result for set B still carries the shadow direction of set A, the background information was not truly adopted; this may be because the reference image order or instruction wording caused the model to ignore the background role.
Lighting problems are usually easier to fix through instructions than silhouette problems: explicitly stating the ambient light source direction and requiring a contact relationship between shadow and countertop is often more effective than repeated retries. If it still is not self-consistent after several adjustments, go back to the reference images themselves — is the lighting information in the background image clear enough?
How to choose parameters and tier
At the parameter level, there are a few things worth settling before you start.
Prompt length is capped at 4000 characters. For editing tasks, clearly stating role division, preserved items, and changed items is enough; there is no need to pile up adjectives.
Resolution tiers come in 1K, 2K, and 4K, with API values 1k, 2k, and 4k, defaulting to 1k. The choice logic follows the use case: for comparative checks of silhouette and lighting, 1K is enough to see the structure clearly; move up to 2K or 4K only when delivering or doing further layout. Note that the tier affects more than sharpness: the aspect ratio relationship of 2K and 4K differs from that of 1K, so the frame changes when comparing across tiers — take this into account when evaluating silhouettes.
Aspect ratio is optional; choose it according to the final use, and do not pick a ratio that does not match the background image composition just to "look more complete," as that forces the model to reorganize spatial relationships.
Output format supports JPEG and PNG, defaulting to JPEG. Choose PNG when further processing is needed and repeated compression loss should be avoided.
The price relationship between Fast and Quality varies by tier: at the 1K tier, Fast costs about half of Quality for the same use case at the same tier; the 2K and 4K ratios differ and do not follow this relationship. Refer to the site's pricing panel for specific numbers. The practical recommendation is to tier by use case — use Fast for batch composition trials and controlled experiments; use Quality for final images after the plan is settled. Note that this discussion is only about billing, not a speed promise.
Common issues and troubleshooting order
Finally, here is a reusable troubleshooting path, ordered from lowest to highest cost.
Check one: are the reference images complete and accessible? The editing route requires 1–10 HTTPS reference images. A count of 0, a non-HTTPS link, or an image that cannot be fetched will invalidate the request outright. Do not try to solve these problems by changing the prompt.
Check two: are roles in conflict? Ask yourself about each image: what is this image responsible for? If two images both define the subject, or one image serves as both background and color card, split them first. Role conflict shows up as a result that "looks a bit like everything and is accurate at nothing."
Check three: does the instruction describe changes rather than restate content? Filling the instruction with "a pottery vessel with a glazed surface" will not help the model, because it has already seen the main image. The instruction should focus on preserved items and changed items.
Check four: single-variable replacement. When the result goes off track, replace only one role at a time — first replace the background image while leaving the main image and color card unchanged; then look at changes in silhouette and lighting. This lets you localize the problem to a specific input.
Check five: tier and aspect ratio. When comparing across tiers, a change in aspect ratio will interfere with judgment; confirm that you are comparing results at the same tier and same aspect ratio.
At the same time, be clear-eyed about capability boundaries: the platform does not promise transparent cutout, masking, or pixel-level locking, nor does it make pixel-level restoration promises. Build acceptance criteria on explainable differences in silhouette and lighting, and troubleshooting will have an endpoint. Once these checks are codified into a workflow, the division of roles among the main image, color card, and background image is no longer a trick but the default practice.
Related articles
View all articles →-
Tutorial
flux-3.1/text-to-image in Practice: 5 High-Value Business Scenarios and Integration Essentials
From per-image billing to production readiness: integrating an image generation model into real business
-
Tutorial
Hands-on with flux-3.1/edit-image: 5 high-value image editing application scenarios
From integration to cost accounting, bringing image editing models into real business
-
Tutorial
flux-3.1/fast/text-to-image in practice: 5 high-value application scenarios and key implementation points
From e-commerce assets to content production pipelines: model selection and integration approaches for image generation models in real business