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

Multi-reference composition

How to combine reference images with FLUX 3.1 Image: assigning roles, dressing a model from packshots, keeping faces across shots and transferring a style.

Introduction

inputs.referenceImages takes up to ten images in one request, and nothing in the array says what each one is for. A casting photo, a coat packshot and a sneaker packshot arrive as three pictures. The prompt gives each one its job, by its position in the array, and the model builds a single frame out of all three.

Built from 3 references
  • The woman
  • The coat
  • The sneakers

The woman was shot barefoot on white and the products were shot with no body in them, so the street, the stride and the overcast light come from the sentence. The references supply what has to match: her face and the details a shopper checks on each product.

This guide covers how to write the role assignment, how to put several people in one frame, how to hold one character across a sequence of shots, how to borrow a look from a reference, and what makes a reference worth sending.

Assigning roles by index

References are numbered in the order you send them, and the prompt calls them image 1, image 2 and so on. The hero prompt is built from a handful of clauses, and each does one job:

Use the woman from image 1., Dress her in the trench coat from image 2, worn open over her white t-shirt and jeans with the belt hanging loose, and put the sneakers from image 3 on her feet., Keep her face, her hair and her build exact. Keep the coat exact including its camel gabardine, its tortoiseshell buttons and its epaulettes, and the sneakers exact including the tan heel tab and the gum sole., She walks toward the camera on a city sidewalk lined with plane trees and stone apartment buildings, mid-stride, one hand in a coat pocket., Soft overcast daylight, a gentle contact shadow under her feet., Full-length shot at waist height, 50mm lens. Photoreal street style fashion photography, muted autumn palette.
PersonProductsPreserveSceneLightingCamera

The preserve clauses carry the most weight in try-on work. "Keep the coat exact" on its own leaves the model to decide which features count, while naming the gabardine, the buttons and the epaulettes lists the ones a return would be filed over. Name the features a buyer would notice if they moved, and name them per reference.

The lighting clause is what keeps a packshot from looking pasted in. Products shot under even studio light carry that light with them, and "soft overcast daylight" hands the scene's light to every garment along with the contact shadow that grounds her on the pavement.

The first reference also decides the shape of the output. The hero request sends resolution instead of width and height, and with references attached, resolution takes its aspect ratio from image 1, so the portrait casting photo gives a portrait result. Put first the image whose framing you want, or send width and height when none of the references has the shape you 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: 'Use the woman from image 1. Dress her in the trench coat from image 2, worn open over her white t-shirt and jeans with the belt hanging loose, and put the sneakers from image 3 on her feet. Keep her face, her hair and her build exact. Keep the coat exact including its camel gabardine, its tortoiseshell buttons and its epaulettes, and the sneakers exact including the tan heel tab and the gum sole. She walks toward the camera on a city sidewalk lined with plane trees and stone apartment buildings, mid-stride, one hand in a coat pocket. Soft overcast daylight, a gentle contact shadow under her feet. Full-length shot at waist height, 50mm lens. Photoreal street style fashion photography, muted autumn palette.',
  inputs: {
    referenceImages: [
      'https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-model.jpg',
      'https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-coat.jpg',
      'https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-sneakers.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": "Use the woman from image 1. Dress her in the trench coat from image 2, worn open over her white t-shirt and jeans with the belt hanging loose, and put the sneakers from image 3 on her feet. Keep her face, her hair and her build exact. Keep the coat exact including its camel gabardine, its tortoiseshell buttons and its epaulettes, and the sneakers exact including the tan heel tab and the gum sole. She walks toward the camera on a city sidewalk lined with plane trees and stone apartment buildings, mid-stride, one hand in a coat pocket. Soft overcast daylight, a gentle contact shadow under her feet. Full-length shot at waist height, 50mm lens. Photoreal street style fashion photography, muted autumn palette.",
            "inputs": {
                "referenceImages": [
                    "https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-model.jpg",
                    "https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-coat.jpg",
                    "https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-sneakers.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": "9e4b2c71-6d8a-4f13-b0c5-3a7e1d9f2b84",
      "model": "bfl:flux@3.1-image",
      "positivePrompt": "Use the woman from image 1. Dress her in the trench coat from image 2, worn open over her white t-shirt and jeans with the belt hanging loose, and put the sneakers from image 3 on her feet. Keep her face, her hair and her build exact. Keep the coat exact including its camel gabardine, its tortoiseshell buttons and its epaulettes, and the sneakers exact including the tan heel tab and the gum sole. She walks toward the camera on a city sidewalk lined with plane trees and stone apartment buildings, mid-stride, one hand in a coat pocket. Soft overcast daylight, a gentle contact shadow under her feet. Full-length shot at waist height, 50mm lens. Photoreal street style fashion photography, muted autumn palette.",
      "inputs": {
        "referenceImages": [
          "https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-model.jpg",
          "https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-coat.jpg",
          "https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-sneakers.jpg"
        ]
      },
      "resolution": "1K"
    }
  ]'
runware run bfl:flux@3.1-image \
  positivePrompt="Use the woman from image 1. Dress her in the trench coat from image 2, worn open over her white t-shirt and jeans with the belt hanging loose, and put the sneakers from image 3 on her feet. Keep her face, her hair and her build exact. Keep the coat exact including its camel gabardine, its tortoiseshell buttons and its epaulettes, and the sneakers exact including the tan heel tab and the gum sole. She walks toward the camera on a city sidewalk lined with plane trees and stone apartment buildings, mid-stride, one hand in a coat pocket. Soft overcast daylight, a gentle contact shadow under her feet. Full-length shot at waist height, 50mm lens. Photoreal street style fashion photography, muted autumn palette." \
  inputs.referenceImages.0=https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-model.jpg \
  inputs.referenceImages.1=https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-coat.jpg \
  inputs.referenceImages.2=https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-sneakers.jpg \
  resolution=1K
{
  "taskType": "imageInference",
  "taskUUID": "9e4b2c71-6d8a-4f13-b0c5-3a7e1d9f2b84",
  "model": "bfl:flux@3.1-image",
  "positivePrompt": "Use the woman from image 1. Dress her in the trench coat from image 2, worn open over her white t-shirt and jeans with the belt hanging loose, and put the sneakers from image 3 on her feet. Keep her face, her hair and her build exact. Keep the coat exact including its camel gabardine, its tortoiseshell buttons and its epaulettes, and the sneakers exact including the tan heel tab and the gum sole. She walks toward the camera on a city sidewalk lined with plane trees and stone apartment buildings, mid-stride, one hand in a coat pocket. Soft overcast daylight, a gentle contact shadow under her feet. Full-length shot at waist height, 50mm lens. Photoreal street style fashion photography, muted autumn palette.",
  "inputs": {
    "referenceImages": [
      "https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-model.jpg",
      "https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-coat.jpg",
      "https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-sneakers.jpg"
    ]
  },
  "resolution": "1K"
}
Response
{
  "data": [
    {
      "taskType": "imageInference",
      "taskUUID": "9e4b2c71-6d8a-4f13-b0c5-3a7e1d9f2b84",
      "imageUUID": "2c8f5a13-7b9e-4d06-a1f4-6e3b8d2c9a57",
      "imageURL": "https://im.runware.ai/image/os/a14d18/ws/2/ii/2c8f5a13-7b9e-4d06-a1f4-6e3b8d2c9a57.jpg"
    }
  ]
}

Several people in one frame

Each person comes from their own reference, and the prompt places them. Say which image each person comes from, where they sit and what they are doing, or the model is left to decide who goes on which side.

Built from 2 references
  • Image 1
  • Image 2

The preserve clause gives one identifying detail per face: his glasses and beard, her freckles and hoops. Those are the features a viewer checks first on a channel they already watch, and naming them per person keeps the model from blending the two faces toward each other.

Both headshots are square and an episode thumbnail is 16:9, so this request sends width and height. With resolution instead, the result would follow image 1 and come back square.

Holding a character across shots

A storyboard needs one character to survive a change of location, time of day and camera. Send the same reference with every request, repeat the same preserve clause word for word, and change only the shot.

The first two sentences of each prompt are identical, and only the shot after them changes. Keeping that clause fixed holds every item to the same standard in every shot, and a clause rewritten per shot is a clause that can drop the backpack or the helmet from one of them.

The reference was shot on a plain backdrop under even light, the cleanest version of the character to carry. Each shot then relights him for its own scene, from the blue dawn to the golden bridge.

Borrowing a style

Style is a role like any other. With one content image and one style image, the short form does the job: "Render image 1 in the style of image 2." Those eight words assign both roles, and with only two references in the request there is nothing else to explain.

Both requests send the same image 1 and the same sentence, so image 2 is the only variable. The picnic keeps its layout, and the fox, the rabbit and the lighthouse stay in their own pictures, because the prompt gave those references a look to lend and no content to contribute.

This is how a children's book publisher or a greeting card shop reaches a house style from photographs. Text-to-image covers a narrower range of styles than the model's reference work, so when a look is hard to name in a prompt, show it as image 2 instead.

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: 'Render image 1 in the style of image 2.',
  inputs: {
    referenceImages: [
      'https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-content.jpg',
      'https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-style-watercolor.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": "Render image 1 in the style of image 2.",
            "inputs": {
                "referenceImages": [
                    "https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-content.jpg",
                    "https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-style-watercolor.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": "5d1a8e36-2c4f-4b97-8e05-7f3b9c1a6d28",
      "model": "bfl:flux@3.1-image",
      "positivePrompt": "Render image 1 in the style of image 2.",
      "inputs": {
        "referenceImages": [
          "https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-content.jpg",
          "https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-style-watercolor.jpg"
        ]
      },
      "resolution": "1K"
    }
  ]'
runware run bfl:flux@3.1-image \
  positivePrompt="Render image 1 in the style of image 2." \
  inputs.referenceImages.0=https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-content.jpg \
  inputs.referenceImages.1=https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-style-watercolor.jpg \
  resolution=1K
{
  "taskType": "imageInference",
  "taskUUID": "5d1a8e36-2c4f-4b97-8e05-7f3b9c1a6d28",
  "model": "bfl:flux@3.1-image",
  "positivePrompt": "Render image 1 in the style of image 2.",
  "inputs": {
    "referenceImages": [
      "https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-content.jpg",
      "https://assets.runware.ai/guides/bfl-flux-3-1-image/multi-reference-composition/ref-style-watercolor.jpg"
    ]
  },
  "resolution": "1K"
}
Response
{
  "data": [
    {
      "taskType": "imageInference",
      "taskUUID": "5d1a8e36-2c4f-4b97-8e05-7f3b9c1a6d28",
      "imageUUID": "e7c3a9f2-1b5d-4e80-9c26-4a8f2d6b1e93",
      "imageURL": "https://im.runware.ai/image/os/a14d18/ws/2/ii/e7c3a9f2-1b5d-4e80-9c26-4a8f2d6b1e93.jpg"
    }
  ]
}

What makes a good reference

A request takes up to ten references, or nine when inputs.maskImage is set, since the mask takes the tenth slot (see masked edits). Each reference has to be at least 128 × 128 pixels, at most 20 megapixels and at most 20 MB, and those are the only limits that reject a request.

What pays off is a reference with less to untangle. A product on a plain background transfers further than the same product in a busy room, because the model has nothing to separate before it carries the object across. The same goes for people: an evenly lit, frontal photograph carries a face further than a three-quarter view in mixed light. The headshots and the courier above were shot on plain backdrops for that reason.

Tips for best results

  1. Refer to images by number. "Image 1", "image 2", in the order of inputs.referenceImages. A prompt that says "the coat" leaves the model matching by description.

  2. Give every reference a job. A reference the sentence never mentions leaves the model to guess what it is there for.

  3. Name what has to survive, per reference. The buttons on a coat, the freckles on a face. Concrete features hold where a general request to stay faithful does not.

  4. Say which light wins. Packshots and headshots carry studio light, and the prompt has to hand the scene's light to them, with a contact shadow where they meet the ground.

  5. Put the framing you want first. With resolution, image 1 sets the aspect ratio. Send width and height when no reference has the right shape.

  6. Repeat the preserve clause word for word across a sequence. Change the shot and leave the character's clause alone.

  7. Show a style instead of naming it. "Render image 1 in the style of image 2" reaches looks that a style keyword in a text-to-image prompt does not.

  8. Shoot references clean. A plain background and even light carry further than extra pixels, and anything under 128 × 128 or over 20 megapixels is rejected.