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

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.
- The woman

A full-length studio photograph of a woman in her late twenties with short curly black hair and warm brown skin, wearing a plain white crew-neck t-shirt and straight light-wash jeans, barefoot, standing straight with her arms relaxed, looking at the camera with a neutral expression. Plain white seamless backdrop. Even soft frontal light. Full-length shot at waist height, 50mm lens. Photoreal fashion casting photograph, clean white palette.
- The coat

A packshot of a double-breasted trench coat in camel cotton gabardine with a belted waist, epaulettes, a storm flap and tortoiseshell buttons, shown on an invisible mannequin facing the camera, on a seamless white background. Even shadowless studio light, 50mm lens. Photoreal apparel e-commerce packshot, clean white palette.
- The sneakers

A packshot of a pair of minimal low-top sneakers in smooth white leather with white laces, a tan suede heel tab and a thin gum rubber sole, one shoe in profile and one at three-quarters, on a seamless white background. Even shadowless studio light, 50mm lens. Photoreal footwear e-commerce packshot, clean white palette.
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:
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.
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.

Place the man from image 1 on the left and the woman from image 2 on the right at a round wooden desk in a small podcast studio, each with a black broadcast microphone on a boom arm in front of them. He is laughing and turned toward her, she is mid-sentence and looking at him. Keep both faces exact, his glasses and beard, her freckles and gold hoops, and the clothes they wear in their photographs. Warm gray acoustic panels on the wall behind them and a shelf with a warm lamp. Soft key light from the front left. Medium wide shot at desk height, 35mm lens. Photoreal creator studio photography, warm palette.
- Image 1

A studio headshot of a man in his thirties with dark brown skin, a close-cropped beard and round tortoiseshell glasses, wearing a plain olive crew-neck sweatshirt, looking straight to camera with a relaxed half smile. Plain light gray seamless backdrop. Even soft frontal light. Head and shoulders, 85mm lens. Photoreal casting portrait, neutral palette.
- Image 2

A studio headshot of a woman in her late twenties with straight auburn hair in a low ponytail, freckles across her nose and small gold hoop earrings, wearing a plain navy t-shirt, looking straight to camera with a neutral expression. Plain light gray seamless backdrop. Even soft frontal light. Head and shoulders, 85mm lens. Photoreal casting portrait, neutral palette.
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.

A full-length studio photograph of a delivery courier in his twenties with a shaved head and a short dark beard, wearing a bright orange windbreaker, black cycling shorts over black leggings, a black helmet and a large black insulated delivery backpack, standing beside a matte black city bike with one hand on the handlebar, looking at the camera. Plain light gray seamless backdrop. Even soft studio light. Full-length shot at waist height, 50mm lens. Photoreal character reference photograph, neutral palette.

Use the courier and the bike from image 1. Keep his face, his beard, his orange windbreaker, his black helmet, the black insulated delivery backpack and the matte black bike exact. Shot 1: he pushes off from the curb on a quiet city street at dawn, one foot on the pedal, looking down the road ahead. Wet asphalt reflecting the streetlights, a cool blue morning. Wide shot at street level, 35mm lens. Cinematic photoreal film still.

Use the courier and the bike from image 1. Keep his face, his beard, his orange windbreaker, his black helmet, the black insulated delivery backpack and the matte black bike exact. Shot 2: he rides across a steel river bridge, standing on the pedals, the city skyline behind him in low golden sunlight. Side-on tracking shot at bike height, 50mm lens, the bridge railings streaked with motion blur. Cinematic photoreal film still.

Use the courier and the bike from image 1. Keep his face, his beard, his orange windbreaker, his black helmet, the black insulated delivery backpack and the matte black bike exact. Shot 3: he hands a brown paper delivery bag to a smiling woman at the open door of an apartment building, his helmet still on, the bike leaning against the railing behind him. Warm late morning light. Medium shot over his shoulder, 50mm lens. Cinematic photoreal film still.
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.

A family of four having a picnic on a red and white checked blanket in a city park, two parents and two young children sharing sandwiches and strawberries, a wicker basket beside them, a large oak tree and a pond behind them. Bright summer afternoon light. Wide shot at standing height, 35mm lens. Photoreal lifestyle photography, fresh green palette.

A watercolor illustration from a children's picture book of a fox and a rabbit reading a book together under a willow tree beside a stream, loose wet-on-wet washes, soft bleeding edges, fine pencil linework, visible cold-press paper texture, a pale pastel palette with plenty of white paper showing.

A flat vector travel poster illustration of a lighthouse on a rocky coast with sailboats on the sea, bold geometric shapes, flat color with no gradients, a limited palette of navy, coral, sand and teal, crisp clean edges, a large flat sun low in the sky, mid-century poster design, no text.

Render image 1 in the style of image 2.

Render image 1 in the style of image 2.
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.
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
-
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. -
Give every reference a job. A reference the sentence never mentions leaves the model to guess what it is there for.
-
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.
-
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.
-
Put the framing you want first. With
resolution, image 1 sets the aspect ratio. Sendwidthandheightwhen no reference has the right shape. -
Repeat the preserve clause word for word across a sequence. Change the shot and leave the character's clause alone.
-
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.
-
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.