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
text-to-image
Organ Voicer Press Headshot$0.03~7s
Create a finished editorial headshot of a 62-year-old pipe-organ voicer for a concert hall's restoration announcement. Frame her from the upper chest in a 1216x832 landscape image. Place her just left of center with her shoulders angled slightly right and her eyes meeting the camera. She has short silver curls, deep brown skin, and an easy, closed-mouth smile. She wears a rust corduroy work jacket over a charcoal crewneck. On the right, a row of dull pewter organ pipes resolves into broad, soft verticals: enough context to place her in the workshop without competing with her face. Use a large soft key from camera left and gentle bounce from the right. Keep the light soft but directional so the cheekbones and jacket ribs retain their shape. Give the portrait a light editorial retouch: soften the shine on her forehead, lift the deepest under-eye shadows slightly, and remove a few lint specks from the jacket. Keep her smile lines, natural pores, and the small mole below her left cheekbone. The palette is warm rust, charcoal, and cool pewter. Make it quietly assured and ready to publish as a standalone photograph, with no text, graphics, or border.
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: 'Create a finished editorial headshot of a 62-year-old pipe-organ voicer for a concert hall\'s restoration announcement. Frame her from the upper chest in a 1216x832 landscape image. Place her just left of center with her shoulders angled slightly right and her eyes meeting the camera. She has short silver curls, deep brown skin, and an easy, closed-mouth smile. She wears a rust corduroy work jacket over a charcoal crewneck. On the right, a row of dull pewter organ pipes resolves into broad, soft verticals: enough context to place her in the workshop without competing with her face. Use a large soft key from camera left and gentle bounce from the right. Keep the light soft but directional so the cheekbones and jacket ribs retain their shape. Give the portrait a light editorial retouch: soften the shine on her forehead, lift the deepest under-eye shadows slightly, and remove a few lint specks from the jacket. Keep her smile lines, natural pores, and the small mole below her left cheekbone. The palette is warm rust, charcoal, and cool pewter. Make it quietly assured and ready to publish as a standalone photograph, with no text, graphics, or border.',
width: 1216,
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": "Create a finished editorial headshot of a 62-year-old pipe-organ voicer for a concert hall's restoration announcement. Frame her from the upper chest in a 1216x832 landscape image. Place her just left of center with her shoulders angled slightly right and her eyes meeting the camera. She has short silver curls, deep brown skin, and an easy, closed-mouth smile. She wears a rust corduroy work jacket over a charcoal crewneck. On the right, a row of dull pewter organ pipes resolves into broad, soft verticals: enough context to place her in the workshop without competing with her face. Use a large soft key from camera left and gentle bounce from the right. Keep the light soft but directional so the cheekbones and jacket ribs retain their shape. Give the portrait a light editorial retouch: soften the shine on her forehead, lift the deepest under-eye shadows slightly, and remove a few lint specks from the jacket. Keep her smile lines, natural pores, and the small mole below her left cheekbone. The palette is warm rust, charcoal, and cool pewter. Make it quietly assured and ready to publish as a standalone photograph, with no text, graphics, or border.",
"width": 1216,
"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": "6e31a7aa-57cf-4c3b-a08a-8a5cbebd54cf",
"model": "bfl:flux@3.1-image",
"positivePrompt": "Create a finished editorial headshot of a 62-year-old pipe-organ voicer for a concert hall'\''s restoration announcement. Frame her from the upper chest in a 1216x832 landscape image. Place her just left of center with her shoulders angled slightly right and her eyes meeting the camera. She has short silver curls, deep brown skin, and an easy, closed-mouth smile. She wears a rust corduroy work jacket over a charcoal crewneck. On the right, a row of dull pewter organ pipes resolves into broad, soft verticals: enough context to place her in the workshop without competing with her face. Use a large soft key from camera left and gentle bounce from the right. Keep the light soft but directional so the cheekbones and jacket ribs retain their shape. Give the portrait a light editorial retouch: soften the shine on her forehead, lift the deepest under-eye shadows slightly, and remove a few lint specks from the jacket. Keep her smile lines, natural pores, and the small mole below her left cheekbone. The palette is warm rust, charcoal, and cool pewter. Make it quietly assured and ready to publish as a standalone photograph, with no text, graphics, or border.",
"width": 1216,
"height": 832
}
]'runware run bfl:flux@3.1-image \
positivePrompt="Create a finished editorial headshot of a 62-year-old pipe-organ voicer for a concert hall's restoration announcement. Frame her from the upper chest in a 1216x832 landscape image. Place her just left of center with her shoulders angled slightly right and her eyes meeting the camera. She has short silver curls, deep brown skin, and an easy, closed-mouth smile. She wears a rust corduroy work jacket over a charcoal crewneck. On the right, a row of dull pewter organ pipes resolves into broad, soft verticals: enough context to place her in the workshop without competing with her face. Use a large soft key from camera left and gentle bounce from the right. Keep the light soft but directional so the cheekbones and jacket ribs retain their shape. Give the portrait a light editorial retouch: soften the shine on her forehead, lift the deepest under-eye shadows slightly, and remove a few lint specks from the jacket. Keep her smile lines, natural pores, and the small mole below her left cheekbone. The palette is warm rust, charcoal, and cool pewter. Make it quietly assured and ready to publish as a standalone photograph, with no text, graphics, or border." \
width=1216 \
height=832{
"taskType": "imageInference",
"taskUUID": "6e31a7aa-57cf-4c3b-a08a-8a5cbebd54cf",
"model": "bfl:flux@3.1-image",
"positivePrompt": "Create a finished editorial headshot of a 62-year-old pipe-organ voicer for a concert hall's restoration announcement. Frame her from the upper chest in a 1216x832 landscape image. Place her just left of center with her shoulders angled slightly right and her eyes meeting the camera. She has short silver curls, deep brown skin, and an easy, closed-mouth smile. She wears a rust corduroy work jacket over a charcoal crewneck. On the right, a row of dull pewter organ pipes resolves into broad, soft verticals: enough context to place her in the workshop without competing with her face. Use a large soft key from camera left and gentle bounce from the right. Keep the light soft but directional so the cheekbones and jacket ribs retain their shape. Give the portrait a light editorial retouch: soften the shine on her forehead, lift the deepest under-eye shadows slightly, and remove a few lint specks from the jacket. Keep her smile lines, natural pores, and the small mole below her left cheekbone. The palette is warm rust, charcoal, and cool pewter. Make it quietly assured and ready to publish as a standalone photograph, with no text, graphics, or border.",
"width": 1216,
"height": 832
}Response
{
"taskType": "imageInference",
"taskUUID": "6e31a7aa-57cf-4c3b-a08a-8a5cbebd54cf",
"imageUUID": "9bab75e6-78a0-4b9a-931c-e745a3226001",
"imageURL": "https://im.runware.ai/image/os/a05d22/ws/3/ii/9bab75e6-78a0-4b9a-931c-e745a3226001.jpg",
"cost": 0.03
}API Options
Platform-level options for task execution and delivery.
taskType
stringrequiredvalue: imageInferenceIdentifier for the type of task being performed.
taskUUID
stringrequiredUUID v4UUID v4 identifier for tracking tasks and matching async responses. Must be unique per task.
outputType
stringdefault: URLImage output type.
Allowed values3 values
outputFormat
stringdefault: JPGSpecifies the file format of the generated output. The available values depend on the task type and the specific model's capabilities.
JPG: Best for photorealistic images with smaller file sizes (no transparency).PNG: Lossless compression, supports high quality and transparency (alpha channel).WEBP: Modern format providing superior compression and transparency support.
Transparency: Output that needs transparency must use a format with an alpha channel:PNG,WEBP.JPGdoes not support transparency.Allowed values3 values
outputQuality
integermin: 20max: 99default: 95Compression quality of the output. Higher values preserve quality but increase file size.
webhookURL
stringuriWebhook URL that receives JSON responses via HTTP POST when generation tasks complete. For batch requests with multiple results, each completed item triggers a separate webhook call as it becomes available.
Learn more1 resource
- WebhooksPLATFORM
- Webhooks
deliveryMethod
stringdefault: syncDetermines how the API delivers task results.
Allowed values2 values
- Returns results directly in the API response. Over HTTP, a task still running after 120 seconds continues as an async task and comes back with status 'processing'. Poll for its results using getResponse.
- Returns an immediate acknowledgment with the task UUID. Poll for results using getResponse.
Learn more1 resource
- Task PollingPLATFORM
uploadEndpoint
stringuriSpecifies a URL where the generated content will be automatically uploaded using the HTTP PUT method. The raw binary data of the media file is sent directly as the request body. For secure uploads to cloud storage, use presigned URLs that include temporary authentication credentials.
Common use cases:
- Cloud storage: Upload directly to S3 buckets, Google Cloud Storage, or Azure Blob Storage using presigned URLs.
- CDN integration: Upload to content delivery networks for immediate distribution.
// S3 presigned URL for secure upload https://your-bucket.s3.amazonaws.com/generated/content.mp4?X-Amz-Signature=abc123&X-Amz-Expires=3600 // Google Cloud Storage presigned URL https://storage.googleapis.com/your-bucket/content.jpg?X-Goog-Signature=xyz789 // Custom storage endpoint https://storage.example.com/uploads/generated-image.jpgThe content data will be sent as the request body to the specified URL when generation is complete.
safety
objectContent safety checking configuration for image generation.
Properties2 properties
safety»checkContentcheckContent
booleanEnable or disable content safety checking. Increases total generation time and adds a small charge on top of the generation cost.
safety»blockContentblockContent
booleanContent blocking before generation. Moderates the request's text and input images, and rejects the request when they are flagged, so nothing is generated or charged. Input videos, audio and documents are not moderated. Adds a short delay before generation starts.
ttl
integermin: 60Time-to-live (TTL) in seconds for generated content. Only applies when
outputTypeisURL.
includeCost
booleanInclude task cost in the response.
numberResults
integermin: 1max: 20default: 1Number of results to generate. Each result uses a different seed, producing variations of the same parameters.
Inputs
Input resources for the task (images, audio, etc). These must be nested inside the inputs object.
inputs object.inputs»maskImagemaskImage
stringImage used to specify which areas of the input image should be edited (UUID, URL, Data URI, or Base64). White marks the area to edit, black is preserved. Applies to the first reference image and must be within 3% of its aspect ratio. The output keeps that image's aspect ratio, so
widthandheightmust be within 3% of it too.
inputs»referenceImagesreferenceImages
array of stringsmin items: 1max items: 103 limitsList of reference images (UUID, URL, Data URI, or Base64).
Core Parameters
Primary parameters that define the task output.
model
stringrequiredvalue: bfl:flux@3.1-imageSend
autoinstead of an AIR identifier to have the model router choose the model for this task. The rest of the request is unchanged, every value you send is kept, and only the parameters you leave out are filled in. See Model Router.
positivePrompt
stringrequiredmin: 1max: 32768Text prompt describing elements to include in the generated output. At most 32,768 bytes in UTF-8, and must satisfy
E / 32768 + N / 10922 <= 1, whereNcounts the non-ASCII characters andEthe rest.Learn more1 resource
- PromptsLEARN
- Prompts
width
integermin: 177max: 11600Width of the generated media in pixels.
Learn more2 resources
height
integermin: 177max: 11600Height of the generated media in pixels.
Learn more2 resources
resolution
stringdefault: 1KResolution preset for the output. When used with input media, automatically matches the aspect ratio from the input. With reference images, the first one sets it and must have an aspect ratio within 8:1. Without reference images, the model picks the aspect ratio from the prompt.
Allowed values7 values
- About 1 megapixel.
- About 2 megapixels.
- About 4 megapixels.
- About 8 megapixels.
- About 12 megapixels.
- About 16 megapixels.
- Size picked by the model from the prompt.
Settings
Technical parameters to fine-tune the inference process. These must be nested inside the settings object.
settings object.settings»boundingBoxesboundingBoxes
array of objectsmin items: 1max items: 32Regions that place, move, resize or remove elements.
Properties5 properties
settings»boundingBoxes»descriptiondescription
stringmin: 1max: 1000What the region holds.
settings»boundingBoxes»idid
stringrequiredmin: 1max: 64Region identifier, unique within the request. Referenced from
positivePromptas<id>.
settings»boundingBoxes»referenceIndexreferenceIndex
integer | nullmin: 0max: 9Index into
inputs.referenceImagesthe element is taken from. Must be less than the number of reference images. Null for a new element.
settings»boundingBoxes»sourceBoxsourceBox
array | nullmin: 0max: 1000items: 4Position of the element inside the reference as [top, left, bottom, right] on a 0 to 1000 scale. Matching
sourceBoxandtargetBoxkeep the element in place, different values move or resize it. Null for a new element.
settings»boundingBoxes»targetBoxtargetBox
array | nullmin: 0max: 1000items: 4Position in the output as [top, left, bottom, right] on a 0 to 1000 scale, whatever the output size. Top must be lower than bottom and left lower than right. Null removes the element, which requires reference images.
settings»groundinggrounding
stringdefault: offWeb and image search before generating.
Allowed values3 values
- The model decides per request whether to search.
- Always searches.
- Never searches.
settings»modemode
stringdefault: qualitySpeed and quality trade-off.
Allowed values2 values
- Better typography, consistency across many references and fine detail.
- Lower cost per image, built for high volume.
settings»safetyTolerancesafetyTolerance
integermin: 0max: 4default: 2Tolerance level for content moderation. Lower values are stricter, higher values more permissive.
Features
Standalone addons and post-processing features.
advancedFeatures»watermarkwatermark
objectConfiguration object for adding watermarks to generated images. Watermarks can be applied using either text or image content with customizable positioning and appearance. You must provide either
textorimagecontent for the watermark, but not both."advancedFeatures": { "watermark": { "text": "© 2025 Company", "displayPosition": "bottom-right", "opacity": 0.6, "fontColor": "#ffffff", "bgColor": "#000000" } }"advancedFeatures": { "watermark": { "image": "c64351d5-4c59-42f7-95e1-eace013eddab", "displayPosition": "top-left", "opacity": 0.6 } }"advancedFeatures": { "watermark": { "text": "PREVIEW", "tiled": true, "opacity": 0.4, "fontColor": "#cccccc" } }Properties6 properties
advancedFeatures»watermark»texttext
stringmin: 2max: 32Watermark text.
advancedFeatures»watermark»imageimage
stringWatermark image (UUID, URL, Data URI, or Base64).
advancedFeatures»watermark»displayPositiondisplayPosition
stringWatermark position.
Allowed values10 values
advancedFeatures»watermark»opacityopacity
floatmin: 0.1max: 1step: 0.01Watermark opacity.
advancedFeatures»watermark»fontColorfontColor
stringText color in hex format.
advancedFeatures»watermark»bgColorbgColor
stringBackground color in hex format.