live
MODEL IDbfl:flux@3.1-image

FLUX 3.1 Image

Black Forest Labs
by
Available with Zero Data Retention

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.

FLUX 3.1 Image

Editing 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 white clapboard family house with a covered porch, a green lawn, a maple tree in full leaf and a picket fence under a clear summer sky

A two-story family house with white painted clapboard siding, a dark gray shingle roof, black window frames and a covered front porch with two steps, a green lawn in front cut by a flagstone path, a maple tree in full green leaf on the left and a white picket fence along the sidewalk. Bright summer afternoon sun from the right, crisp shadows on the lawn, clear blue sky. Straight-on shot from the sidewalk at standing height, 35mm lens, the house centered with the lawn below it. Photoreal real estate listing photography, warm palette.

SummerWinter

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.

Try in Playground
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 width and height, as above. The edit comes back at exactly the source's size, which is what a before and after pair needs.
  • Tier only: resolution on 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.

"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.

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.

A woman with short gray hair and tortoiseshell glasses at an oak table in a small office, looking off to the left with a slight smile

A woman in her forties with short gray hair and round tortoiseshell glasses sitting at a light oak table in a bright small office, wearing a navy linen shirt, her hands folded on the table, looking off to the left of the camera mid-sentence with a slight smile. A shelf of binders and a potted rubber plant out of focus behind her. Soft daylight from a window on the left. Medium shot at seated eye height, 50mm lens, the woman on the right third of the frame. Photoreal corporate testimonial photography, warm neutral palette.

Off cameraTo camera

"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 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.

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:

Try in Playground
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

  1. 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.

  2. 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.

  3. Name the light source in a relight. Where it sits and what it lights, including lamps and windows that should switch on.

  4. 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.

  5. Pin the size and spot on a replacement. Otherwise the frame recomposes around the new object.

  6. Describe the surface under a removal. What the object was covering is otherwise a guess.

  7. One change per pass. Chain the passes and carry each result into the next keep list.