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

API Options

Platform-level options for task execution and delivery.

taskType

stringrequiredvalue: imageInference

Identifier for the type of task being performed.

taskUUID

stringrequiredUUID v4

UUID v4 identifier for tracking tasks and matching async responses. Must be unique per task.

outputType

stringdefault: URL

Image output type.

Allowed values3 values

outputFormat

stringdefault: JPG

Specifies 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. JPG does not support transparency.
Allowed values3 values

outputQuality

integermin: 20max: 99default: 95

Compression quality of the output. Higher values preserve quality but increase file size.

webhookURL

stringuri

Webhook 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

deliveryMethod

stringdefault: sync

Determines 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

Specifies 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.jpg

The content data will be sent as the request body to the specified URL when generation is complete.

safety

object

Content safety checking configuration for image generation.

Properties2 properties
safety » checkContent

Enable or disable content safety checking. Increases total generation time and adds a small charge on top of the generation cost.

safety » blockContent

Content 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: 60

Time-to-live (TTL) in seconds for generated content. Only applies when outputType is URL.

Include task cost in the response.

numberResults

integermin: 1max: 20default: 1

Number 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 » maskImage

maskImage

string

Image 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 width and height must be within 3% of it too.

inputs » referenceImages

referenceImages

array of stringsmin items: 1max items: 103 limits

List of reference images (UUID, URL, Data URI, or Base64).

Core Parameters

Primary parameters that define the task output.

model

stringrequiredvalue: bfl:flux@3.1-image

Send auto instead 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: 32768

Text 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, where N counts the non-ASCII characters and E the rest.

Learn more1 resource

width

integermin: 177max: 11600

Width of the generated media in pixels.

Learn more2 resources

height

integermin: 177max: 11600

Height of the generated media in pixels.

Learn more2 resources

resolution

stringdefault: 1K

Resolution 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 » boundingBoxes

boundingBoxes

array of objectsmin items: 1max items: 32

Regions that place, move, resize or remove elements.

Properties5 properties
settings » boundingBoxes » description

description

stringmin: 1max: 1000

What the region holds.

settings » boundingBoxes » id

id

stringrequiredmin: 1max: 64

Region identifier, unique within the request. Referenced from positivePrompt as <id>.

settings » boundingBoxes » referenceIndex

referenceIndex

integer | nullmin: 0max: 9

Index into inputs.referenceImages the element is taken from. Must be less than the number of reference images. Null for a new element.

settings » boundingBoxes » sourceBox

sourceBox

array | nullmin: 0max: 1000items: 4

Position of the element inside the reference as [top, left, bottom, right] on a 0 to 1000 scale. Matching sourceBox and targetBox keep the element in place, different values move or resize it. Null for a new element.

settings » boundingBoxes » targetBox

targetBox

array | nullmin: 0max: 1000items: 4

Position 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 » grounding

grounding

stringdefault: off

Web and image search before generating.

Allowed values3 values
The model decides per request whether to search.
Always searches.
Never searches.
settings » mode

mode

stringdefault: quality

Speed 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 » safetyTolerance

safetyTolerance

integermin: 0max: 4default: 2

Tolerance level for content moderation. Lower values are stricter, higher values more permissive.

Features

Standalone addons and post-processing features.

advancedFeatures » watermark

watermark

object

Configuration 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 text or image content 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 » text

text

stringmin: 2max: 32

Watermark text.

advancedFeatures » watermark » image

image

string

Watermark image (UUID, URL, Data URI, or Base64).

advancedFeatures » watermark » displayPosition

Watermark position.

Allowed values10 values
advancedFeatures » watermark » opacity

opacity

floatmin: 0.1max: 1step: 0.01

Watermark opacity.

advancedFeatures » watermark » fontColor

fontColor

string

Text color in hex format.

advancedFeatures » watermark » bgColor

bgColor

string

Background color in hex format.