FLUX 3.1 Image

FLUX 3.1 Image is Black Forest Labs' image generation and editing model, built for speed at every size from 1 MP up to native 4K. It keeps people and objects consistent across multiple references, edits locally through masks and bounding boxes while leaving the rest of the image untouched, and changes or translates text in its original lettering. It suits high-volume work such as product catalogs, virtual try-on, storyboards and key art.

Complete technical specification for integration
Ready-to-use code snippets for common workflows
Step-by-step tutorials for advanced use cases
← All GuidesEditing images
How to edit a photo with FLUX 3.1 Image from a single instruction: scoping the change, relighting, turning a gaze, swapping objects in and out, and chaining passes.
Introduction
FLUX 3.1 Image edits from a sentence. Attach the photo, describe the finished state you want, and the model returns the same scene with that change made: a new season, a different light, another object on the table, a face turned toward the lens.
A season change rewrites everything the weather touches, so the prompt describes the snow, the sky and the windows one by one and then lists what stays. For a listing, one summer shoot covers the winter photo as well.
This guide covers the request, how to scope an instruction, changes of light and weather, turning a gaze, swapping objects in and out, and chaining several edits.
The request
An edit is a generation with the source attached, in inputs.referenceImages. The instruction goes in positivePrompt like any other prompt, and one reference is all the edits on this page need.
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
const [result] = await client.run({
model: 'bfl:flux@3.1-image',
positivePrompt: 'Change the season to a snowy winter day. Snow covers the lawn, the roof and the porch steps, the flagstone path is shoveled clear, the maple tree is bare with snow along its branches, the sky is a soft overcast gray and warm light glows in the windows. Keep the house, its siding, its windows, the porch, the fence, the framing and the camera position unchanged.',
inputs: {
referenceImages: [
'https://assets.runware.ai/guides/bfl-flux-3-1-image/editing-images/source-house.jpg'
]
},
width: 1248,
height: 832
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "bfl:flux@3.1-image",
"positivePrompt": "Change the season to a snowy winter day. Snow covers the lawn, the roof and the porch steps, the flagstone path is shoveled clear, the maple tree is bare with snow along its branches, the sky is a soft overcast gray and warm light glows in the windows. Keep the house, its siding, its windows, the porch, the fence, the framing and the camera position unchanged.",
"inputs": {
"referenceImages": [
"https://assets.runware.ai/guides/bfl-flux-3-1-image/editing-images/source-house.jpg"
]
},
"width": 1248,
"height": 832
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "imageInference",
"taskUUID": "3b7e1c94-5d28-4f0a-a6b3-9e2d4c8f1a57",
"model": "bfl:flux@3.1-image",
"positivePrompt": "Change the season to a snowy winter day. Snow covers the lawn, the roof and the porch steps, the flagstone path is shoveled clear, the maple tree is bare with snow along its branches, the sky is a soft overcast gray and warm light glows in the windows. Keep the house, its siding, its windows, the porch, the fence, the framing and the camera position unchanged.",
"inputs": {
"referenceImages": [
"https://assets.runware.ai/guides/bfl-flux-3-1-image/editing-images/source-house.jpg"
]
},
"width": 1248,
"height": 832
}
]'runware run bfl:flux@3.1-image \
positivePrompt="Change the season to a snowy winter day. Snow covers the lawn, the roof and the porch steps, the flagstone path is shoveled clear, the maple tree is bare with snow along its branches, the sky is a soft overcast gray and warm light glows in the windows. Keep the house, its siding, its windows, the porch, the fence, the framing and the camera position unchanged." \
inputs.referenceImages.0=https://assets.runware.ai/guides/bfl-flux-3-1-image/editing-images/source-house.jpg \
width=1248 \
height=832{
"taskType": "imageInference",
"taskUUID": "3b7e1c94-5d28-4f0a-a6b3-9e2d4c8f1a57",
"model": "bfl:flux@3.1-image",
"positivePrompt": "Change the season to a snowy winter day. Snow covers the lawn, the roof and the porch steps, the flagstone path is shoveled clear, the maple tree is bare with snow along its branches, the sky is a soft overcast gray and warm light glows in the windows. Keep the house, its siding, its windows, the porch, the fence, the framing and the camera position unchanged.",
"inputs": {
"referenceImages": [
"https://assets.runware.ai/guides/bfl-flux-3-1-image/editing-images/source-house.jpg"
]
},
"width": 1248,
"height": 832
}Response
{
"data": [
{
"taskType": "imageInference",
"taskUUID": "3b7e1c94-5d28-4f0a-a6b3-9e2d4c8f1a57",
"imageUUID": "c81f4e2a-7b39-4d65-9a0e-5f3b8d1c6e24",
"imageURL": "https://im.runware.ai/image/os/a14d18/ws/2/ii/c81f4e2a-7b39-4d65-9a0e-5f3b8d1c6e24.jpg"
}
]
}The output size comes from the request, and there are two ways to set it:
- Exact size: the source's own
widthandheight, as above. The edit comes back at exactly the source's size, which is what a before and after pair needs. - Tier only:
resolutionon its own. The aspect ratio is taken from the reference and the tier sets the pixel count, so a 2K edit of a 1K photo keeps its shape at four times the pixels. The chain at the end of this guide works this way.
A request that sends both resolution and width or height is rejected.
Scoping the instruction
A broad instruction hands the model the decision about what to change. A scoped one names the target, the new state and the survivors, and the survivors are what keep the rest of the frame still.

A lookbook photograph of a man in his late twenties standing against a pale terracotta plaster wall, wearing a cream knit polo shirt with a three-button placket, navy pleated trousers and brown leather loafers, one hand in his pocket, looking straight to camera. Soft overcast daylight, no hard shadows. Full-length shot at chest height, 50mm lens, the subject centered with space above his head and below his feet. Photoreal editorial menswear photography, warm muted palette.

Make the outfit more summery.

Change only the cream knit polo shirt to a sage green one in the same knit. Preserve its collar, its three-button placket and the way it sits at the waist. Keep the man, his face, his trousers, his loafers, his pose, the terracotta wall, the framing and the lighting unchanged.
"More summery" leaves the model to decide which garments count and how far to take them. The scoped version changes one garment, which is what a colorway on a product page needs: the same model, pose and wall, with only the polo in a new color.
The scoped instruction has three working parts:
- The target, named by what sets it apart: "the cream knit polo shirt", not "the top"
- The new state, written as the result: "a sage green one in the same knit"
- The survivors, listed one by one: the face, the trousers, the loafers, the pose, the wall, the framing and the lighting
Light, weather and season
Light and weather are edits to the whole frame, because every shadow and reflection has to be rebuilt for them. Name the new light source and where it sits, and name anything that should light up, such as lamps or windows, as lit.

A wooden dock running out into a calm mountain lake, two white wooden Adirondack chairs at the end of it facing the water, a black lantern lamp on a post at each front corner of the dock, pine-covered hills on the far shore. Clear midday light from overhead, the water a flat deep blue. Wide shot from the shore end of the dock at standing height, 24mm lens, the dock running from the bottom center toward the chairs. Photoreal travel and hospitality photography, natural palette.

Make it an early foggy morning. Low mist sits on the water and hides the far shore, the light is soft and pale, and the dock boards are damp. Keep the dock, the two chairs, the lantern posts, the framing and the camera position unchanged.

Make it night. The sky is a deep blue-black with a scatter of stars, the two lanterns on the dock are lit and throw warm pools of light on the boards and the chairs, and their reflections ripple on the water. Keep the dock, the two chairs, the lantern posts, the far shore, the framing and the camera position unchanged.

Change the light to golden hour, the sun low on the left just above the hills, warm light raking across the dock boards and long shadows from the chairs stretching to the right. Keep the dock, the two chairs, the lantern posts, the far shore, the framing and the camera position unchanged.

Make it a rainy afternoon. Steady rain dimples the surface of the lake, the sky is low and gray, the dock boards are wet and reflective, and the far hills fade into the haze. Keep the dock, the two chairs, the lantern posts, the framing and the camera position unchanged.
Leave out of the keep list anything the weather should hide. The fog and rain prompts drop the far shore, since naming it would ask the model to hold a view the mist is there to cover. The night and golden hour prompts keep it, because it stays visible.
For a hotel or a rental listing, one shoot becomes a set of moods for the booking page, all from the same camera position.
Gaze and expression
A person in a source photo can turn toward the lens without a reshoot. State the new gaze as a fact about the person, then list the parts of the face that must survive, since a face is where a small drift reads as a different person.
"With the same slight smile" carries the expression across, so only the direction of her eyes changes. A testimonial shot for a landing page usually needs eye contact, and a candid frame from the same session can supply it.
Replacing, removing and adding
All three run off one source and differ in what the prompt has to say about the space the object occupies.

A narrow walnut console table against a pale sage green hallway wall, holding a tall white ceramic vase with dried pampas grass on the left, a small round brass bowl holding a set of keys in the center, and a framed black and white architectural print leaning against the wall on the right. A woven jute runner on the oak floor below. Soft daylight from a doorway on the left. Straight-on shot at table height, 35mm lens, the console centered. Photoreal interior styling photography, calm neutral palette.

Replace the framed black and white architectural print with a framed botanical print of a single fern leaf in green on cream paper, the same size, leaning against the wall in the same spot. Keep the console table, the vase, the brass bowl and the keys, the wall, the runner, the framing and the lighting unchanged.

Remove the brass bowl and the keys and leave the walnut top clean and empty where they stood, the grain continuing across. Keep the vase, the framed print, the wall, the runner, the framing and the lighting unchanged.

Add a small brass table lamp with a white linen shade, switched off, standing on the console between the vase and the brass bowl, its base sitting flat on the walnut with a soft shadow beneath it. Keep the vase, the brass bowl and the keys, the framed print, the wall, the runner, the framing and the lighting unchanged.
- A replacement pins the size and the spot: "the same size, leaning against the wall in the same spot". Without that, the shot can recompose around the new object.
- A removal describes the surface left behind: "the walnut top clean and empty, the grain continuing across". Otherwise the model has to guess what the bowl was hiding.
- An addition gets a position, a contact point and a shadow. The lamp is also "switched off", so the prompt adds an object without adding a light source the rest of the console would have to answer to.
Chaining edits
There is no seed, so rerunning a prompt returns a new picture. To build up a change, edit the output, then edit that output, one change per pass.

A packshot of a roll-top backpack in natural off-white waxed canvas with two black buckled straps down the front and black webbing shoulder straps, standing upright and squared up to the camera on a seamless light gray background. Even soft studio light, a faint contact shadow below. Straight-on shot at bag height, 50mm lens, the backpack centered with clear space around it. Photoreal bags e-commerce packshot, clean neutral palette.

Change only the off-white waxed canvas to a deep olive green waxed canvas. Preserve the roll-top, the two black buckled straps, the shoulder straps and the shape of the bag. Keep the gray background, the framing and the lighting unchanged.

Add a small plain square patch of tan leather stitched to the front of the backpack, centered between the two buckled straps just below the roll-top. Keep the olive green canvas, the roll-top, the buckled straps, the shoulder straps, the gray background, the framing and the lighting unchanged.

Place the backpack on a weathered gray granite boulder beside a mountain trail, pine trees softly out of focus behind it and soft overcast daylight from the left, with a contact shadow where the bag meets the rock. Keep the backpack exactly as it is, including the olive green canvas, the tan leather patch, the roll-top, the buckled straps and the shoulder straps, and keep the camera height and the framing of the bag unchanged.
Each pass names the previous pass's result among the survivors: the patch pass keeps the olive canvas, and the location pass keeps the canvas and the patch. Two changes in one sentence give the model two things to reinterpret at once, and when the result is off you cannot tell which half caused it.
The passes send resolution instead of width and height, so each output takes its square shape from the image before it. The second pass:
import { createClient } from '@runware/sdk'
const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
const [result] = await client.run({
model: 'bfl:flux@3.1-image',
positivePrompt: 'Add a small plain square patch of tan leather stitched to the front of the backpack, centered between the two buckled straps just below the roll-top. Keep the olive green canvas, the roll-top, the buckled straps, the shoulder straps, the gray background, the framing and the lighting unchanged.',
inputs: {
referenceImages: [
'https://assets.runware.ai/guides/bfl-flux-3-1-image/editing-images/chain-1.jpg'
]
},
resolution: '1K'
})import asyncio
import os
from runware import Runware
async def main():
async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
results = await client.run({
"model": "bfl:flux@3.1-image",
"positivePrompt": "Add a small plain square patch of tan leather stitched to the front of the backpack, centered between the two buckled straps just below the roll-top. Keep the olive green canvas, the roll-top, the buckled straps, the shoulder straps, the gray background, the framing and the lighting unchanged.",
"inputs": {
"referenceImages": [
"https://assets.runware.ai/guides/bfl-flux-3-1-image/editing-images/chain-1.jpg"
]
},
"resolution": "1K"
})
asyncio.run(main())curl https://api.runware.ai/v1 \
-H "Authorization: Bearer $RUNWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"taskType": "imageInference",
"taskUUID": "9d4a2f71-6c3e-4b58-8e17-2a5f9c0d3b64",
"model": "bfl:flux@3.1-image",
"positivePrompt": "Add a small plain square patch of tan leather stitched to the front of the backpack, centered between the two buckled straps just below the roll-top. Keep the olive green canvas, the roll-top, the buckled straps, the shoulder straps, the gray background, the framing and the lighting unchanged.",
"inputs": {
"referenceImages": [
"https://assets.runware.ai/guides/bfl-flux-3-1-image/editing-images/chain-1.jpg"
]
},
"resolution": "1K"
}
]'runware run bfl:flux@3.1-image \
positivePrompt="Add a small plain square patch of tan leather stitched to the front of the backpack, centered between the two buckled straps just below the roll-top. Keep the olive green canvas, the roll-top, the buckled straps, the shoulder straps, the gray background, the framing and the lighting unchanged." \
inputs.referenceImages.0=https://assets.runware.ai/guides/bfl-flux-3-1-image/editing-images/chain-1.jpg \
resolution=1K{
"taskType": "imageInference",
"taskUUID": "9d4a2f71-6c3e-4b58-8e17-2a5f9c0d3b64",
"model": "bfl:flux@3.1-image",
"positivePrompt": "Add a small plain square patch of tan leather stitched to the front of the backpack, centered between the two buckled straps just below the roll-top. Keep the olive green canvas, the roll-top, the buckled straps, the shoulder straps, the gray background, the framing and the lighting unchanged.",
"inputs": {
"referenceImages": [
"https://assets.runware.ai/guides/bfl-flux-3-1-image/editing-images/chain-1.jpg"
]
},
"resolution": "1K"
}Response
{
"data": [
{
"taskType": "imageInference",
"taskUUID": "9d4a2f71-6c3e-4b58-8e17-2a5f9c0d3b64",
"imageUUID": "5e8b3d16-2f4a-4c97-b0d1-7a6e9f2c4b83",
"imageURL": "https://im.runware.ai/image/os/a14d18/ws/2/ii/5e8b3d16-2f4a-4c97-b0d1-7a6e9f2c4b83.jpg"
}
]
}Every pass is a fresh generation of the whole frame, so what survives does so because the prompt named it. When a chain runs long, start again from the source with the settled changes folded into one instruction.
Targeting a region
Every edit on this page finds its target through the words of the prompt. When the frame holds two of the same thing, or the area has no name, point at it instead: masked edits take a painted region, and bounding boxes take coordinates.
Tips for best results
-
Describe the result, not the direction. "A sage green one in the same knit" is a finished state. "Make it greener" leaves the model to pick how far to go.
-
List the survivors by name. The face, each garment, the wall, the framing and the lighting. The keep list is the only thing holding them in place.
-
Name the light source in a relight. Where it sits and what it lights, including lamps and windows that should switch on.
-
Drop from the keep list what the weather hides. Fog and rain cover the background, and naming it asks the model to keep it visible.
-
Pin the size and spot on a replacement. Otherwise the frame recomposes around the new object.
-
Describe the surface under a removal. What the object was covering is otherwise a guess.
-
One change per pass. Chain the passes and carry each result into the next keep list.



