Skip to content
Black Forest Labs logo

FLUX.2 [flex]

Text-to-ImageBlack Forest LabsProxied

FLUX.2 [flex] is Black Forest Labs' fine-grained control variant of FLUX.2 — exposes tunable inference steps, guidance, and prompt upsampling for typography-heavy and production workflows.

Model Info
Terms and Licenselink
More informationlink
PricingView pricing in the Cloudflare dashboard

Usage

TypeScript
const response = await env.AI.run(
'black-forest-labs/flux-2-flex',
{
prompt:
"Samsung Galaxy S25 Ultra product advertisement, 'Ultra-strong titanium' headline, close-up of phone edge showing titanium frame, dark gradient background, clean minimalist tech aesthetic",
},
)
console.log(response)
Typography & Design

Examples

High Detail Generation — Crank steps and guidance for maximum detail when latency is not the priority
TypeScript
const response = await env.AI.run(
'black-forest-labs/flux-2-flex',
{
prompt: 'A detailed oil painting portrait of a Renaissance nobleman with intricate lace collar',
guidance: 7.5,
steps: 50,
},
)
console.log(response)
High Detail Generation
Fast Draft — Fast draft with prompt upsampling disabled — preserves the literal prompt
TypeScript
const response = await env.AI.run(
'black-forest-labs/flux-2-flex',
{ prompt: 'A simple line sketch of a mountain landscape', prompt_upsampling: false, steps: 10 },
)
console.log(response)
Fast Draft

Parameters

guidance
numbermaximum: 10minimum: 1.5Classifier-free guidance scale (1.5–10). Higher values follow the prompt more strictly at the cost of realism.
height
integermaximum: 9007199254740991minimum: 64Height of the generated image in pixels (minimum 64). Omit to let BFL pick.
output_format
stringenum: jpeg, png, webpOutput image format. Defaults to jpeg.
prompt
stringrequiredText prompt for image generation or editing.
prompt_upsampling
booleanWhether BFL should expand short prompts before generation. Defaults to true on flex.
safety_tolerance
integermaximum: 5minimum: 0Tolerance for input/output moderation. 0 is the strictest, 5 the most permissive. Defaults to 2.
seed
integermaximum: 9007199254740991minimum: -9007199254740991Optional seed for reproducible generation.
steps
integermaximum: 50minimum: 1Number of denoising steps (1–50). Higher steps yield more detail at the cost of latency.
width
integermaximum: 9007199254740991minimum: 64Width of the generated image in pixels (minimum 64). Omit to let BFL pick.

API Schemas (Raw)

Input
Output