---
title: Editing images — FLUX 3.1 Image | Runware Docs
url: https://runware.ai/docs/models/bfl-flux-3-1-image/guides/editing-images
description: "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](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/editing-images#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.

**Summer**:

![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](https://runware.ai/docs/assets/source-house.KJydscB8_BdWvz.jpg)

> **Prompt**: 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.

**Winter**:

![The same house under snow, with a bare maple, a shoveled path, an overcast sky and warm light in the windows](https://runware.ai/docs/assets/hero-after.qGBB0cYe_1dESc8.jpg)

> **Prompt**: 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.

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](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/editing-images#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.

**TypeScript**:

```typescript
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
})
```

**Python**:

```python
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**:

```bash
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
    }
  ]'
```

**CLI**:

```bash
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
```

**JSON**:

```json
{
  "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
}
```

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](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/editing-images#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 man in a cream knit polo, navy pleated trousers and brown loafers standing against a terracotta plaster wall](https://runware.ai/docs/assets/source-polo.DGWHq7yX_Z18mwMM.jpg)

*Source*

> **Prompt**: 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.

![The same man restyled in a lighter summer outfit](https://runware.ai/docs/assets/scope-broad.DGQjx1zU_1lsNrR.jpg)

*Five words*

> **Prompt**: Make the outfit more summery.

![The same man in a sage green knit polo, with the trousers, loafers, pose and wall matching the source](https://runware.ai/docs/assets/scope-precise.DGQUArpz_Z1a0AbA.jpg)

*Target, new state, survivors*

> **Prompt**: 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](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/editing-images#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.

**Original**:

![A wooden dock on a calm blue mountain lake with two white Adirondack chairs at the end and a black lantern post at each front corner, under midday light](https://runware.ai/docs/assets/source-dock.BVRNBzcn_IIHm7.jpg)

> **Prompt**: 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.

**Fog**:

![The same dock in pale morning fog, with mist on the water hiding the far shore and damp boards](https://runware.ai/docs/assets/light-fog.CVlBbpEU_ZbICYF.jpg)

> **Prompt**: 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.

**Night**:

![The same dock at night under a starry sky, with both lanterns lit and their reflections on the water](https://runware.ai/docs/assets/light-night.Dk4u9pNa_ZHbbFp.jpg)

> **Prompt**: 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.

**Golden hour**:

![The same dock at golden hour with the low sun on the left and long chair shadows falling to the right](https://runware.ai/docs/assets/light-golden.BbQPGwf6_Z2ndfKi.jpg)

> **Prompt**: 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.

**Rain**:

![The same dock in steady rain, with wet reflective boards, a gray sky and the hills fading into haze](https://runware.ai/docs/assets/light-rain.DC7pBC8s_1xVibF.jpg)

> **Prompt**: 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](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/editing-images#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.

**Off camera**:

![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](https://runware.ai/docs/assets/source-spokesperson.0asqWjfI_vbd26.jpg)

> **Prompt**: 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.

**To camera**:

![The same woman in the same office, now looking straight into the camera with the same slight smile](https://runware.ai/docs/assets/gaze-after.DCXhCuds_1cv52h.jpg)

> **Prompt**: She is now looking straight into the camera with the same slight smile. Keep her face, her glasses, her hair, her shirt, her folded hands, the table, the office behind her, the framing and the lighting unchanged.

"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](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/editing-images#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 walnut console table against a sage green wall with a white vase of pampas grass, a brass bowl of keys and a framed black and white architectural print](https://runware.ai/docs/assets/source-console.DhoPlQUG_Z21FJqM.jpg)

*Source*

> **Prompt**: 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.

![The same console with a framed green fern print leaning in the spot where the architectural print stood](https://runware.ai/docs/assets/edit-replace.9LYqm__q_1NeiTV.jpg)

*Replaced*

> **Prompt**: 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.

![The same console with the brass bowl and keys gone and bare walnut in the center](https://runware.ai/docs/assets/edit-remove.C8jVsPNs_1vbnmm.jpg)

*Removed*

> **Prompt**: 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.

![The same console with a small brass table lamp and a white linen shade standing between the vase and the bowl](https://runware.ai/docs/assets/edit-add.Y6U1N75y_Z20AycA.jpg)

*Added*

> **Prompt**: 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](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/editing-images#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.

**Original**:

![An off-white waxed canvas roll-top backpack with two black buckled straps on a light gray background](https://runware.ai/docs/assets/source-backpack.jHd5U9jc_xoQWC.jpg)

> **Prompt**: 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.

**1 · Color**:

![The same backpack in deep olive green waxed canvas on the gray background](https://runware.ai/docs/assets/chain-1.C-vKI-gf_i75cW.jpg)

> **Prompt**: 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.

**2 · Patch**:

![The olive green backpack with a small square tan leather patch stitched between the straps below the roll-top](https://runware.ai/docs/assets/chain-2.-w-aabra_1gDoaF.jpg)

> **Prompt**: 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.

**3 · Location**:

![The olive backpack with its leather patch standing on a gray granite boulder by a mountain trail, pines blurred behind it](https://runware.ai/docs/assets/chain-3.8Pyor_3t_4Cppo.jpg)

> **Prompt**: 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:

**TypeScript**:

```typescript
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'
})
```

**Python**:

```python
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**:

```bash
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"
    }
  ]'
```

**CLI**:

```bash
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
```

**JSON**:

```json
{
  "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"
}
```

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](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/editing-images#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](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/masked-edits.md) take a painted region, and [bounding boxes](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/bounding-boxes.md) take coordinates.

### [Tips for best results](https://runware.ai/docs/models/bfl-flux-3-1-image/guides/editing-images#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.