Skip to content
Black Forest Labs logo

FLUX.2 [max]

Text-to-ImageBlack Forest LabsProxied

FLUX.2 [max] is Black Forest Labs' highest-quality image model — top editing consistency, strongest prompt following, and grounding search for visualizations of real-time information.

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-max',
{
prompt:
'A cat on its back legs running like a human is holding a big silver fish with its arms. The cat is running away from the shop owner and has a panicked look on his face. The scene is situated in a crowded market.',
height: 2048,
width: 1440,
},
)
console.log(response)
High Resolution Scene

Examples

Hex Color Control — Exact color control via hex codes — useful for brand-consistent imagery
TypeScript
const response = await env.AI.run(
'black-forest-labs/flux-2-max',
{
prompt:
'A vase on a table in living room, the color of the vase is a gradient of color, starting with color #02eb3c and finishing with color #edfa3c. The flowers inside the vase have the color #ff0088',
},
)
console.log(response)
Hex Color Control
Image Editing — Single-reference image editing — relight or restage a product photo
TypeScript
const response = await env.AI.run(
'black-forest-labs/flux-2-max',
{
prompt: 'Place this product onto a minimalist marble countertop with soft window light',
input_images: [
'https://replicate.delivery/xezq/jCypj4MeXYUiRyq7nfgm8z1OvFZF81wh4FznutDsZOuJz0YWA/tmp1iukn307.jpg',
],
},
)
console.log(response)
Image Editing

Parameters

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.
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.
width
integermaximum: 9007199254740991minimum: 64Width of the generated image in pixels (minimum 64). Omit to let BFL pick.

API Schemas (Raw)

Input
Output