Image Generation
FLUX Series
Black Forest Labs FLUX image models: FLUX.2 prices output by megapixel tier, FLUX.1 Kontext does contextual editing at a fixed price per image
POST
FLUX Series
FLUX is the image model line from Black Forest Labs. This page covers the five models available today, in two generations: FLUX.2 lets you pick the output megapixel tier and takes up to eight reference images, priced by MP tier; FLUX.1 Kontext focuses on contextual editing, outputs a fixed 1 MP with up to four reference images, and charges a fixed price per image. Both generations use the same task endpoint and the same actions — switching models means changing
A successful submission returns a
See Submit a task for
Generated images come back in
model and nothing else. FLUX 3 Image has its own parameters and tiers; see FLUX 3 Image.
Quick start
task_id. Retrieve the result with GET /v1/tasks/{task_id}, wait inline with Prefer: wait, or configure a webhook.
Request parameters
string
required
One of
flux-2-pro, flux-2-max, flux-2-flex, flux-kontext-pro or flux-kontext-max.string
default:"generate"
generate: create an image from textedit: rewrite a reference image; requiresimage_urls
string
required
The image description or editing instruction.
string[]
Reference image URLs. Required for
edit; generate accepts none. Up to eight on FLUX.2 and four on FLUX.1 Kontext.string
default:"1:1"
Framing:
1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9, 9:21, auto. auto lets the model choose the ratio.string
default:"2mp"
The megapixel tier of the output image:
1mp, 2mp, 3mp, 4mp. Accepted by the three FLUX.2 models only; FLUX.1 Kontext always outputs 1 MP.integer
default:"1"
Number of images to generate. Value:
1. Each request returns one image.integer
Random seed. The same seed with the same parameters keeps results consistent.
string
Output image format:
jpeg, png or webp. FLUX.2 defaults to jpeg, FLUX.1 Kontext to png.boolean
default:"false"
Let the upstream expand the prompt before generating.
integer
default:"2"
Content safety tolerance; higher values are more permissive.
0–5 on FLUX.2, 0–6 on FLUX.1 Kontext.integer
default:"50"
Inference steps,
1–50. More steps add detail and take longer. Supported by flux-2-flex only.number
default:"5"
Prompt guidance strength,
1.5–10. Higher values follow the prompt more closely. Supported by flux-2-flex only.callback_url, callback_events, Prefer: wait, Idempotency-Key and the maximum-cost header.
This series does not accept quality, negative_prompt, watermark or mask_url. Any other parameter returns 400 and is not billed.
Limits
Pricing
Billed at a fixed price per successfully generated image, with different billing dimensions per generation. Rates are inprice_config on GET /v1/models and in the console’s Model Market. What a single call actually cost is the cost field on the task response — an integer quota at 500,000 quota = 1 USD, not dollars.
FLUX.2 (flux-2-pro / flux-2-max / flux-2-flex)
- The output image is billed at the megapixel tier given by
resolution—1mp,2mp,3mpand4mpeach have their own price, and higher tiers cost more. Omittingresolution, or sending a value outside those tiers, settles at the fallback price, which equals the2mptier. - Each reference image adds its own fee on top of the output image: with one reference image it is billed at the MP tier its actual pixel count rounds up to; with two or more, each is billed at the lowest tier.
- The three models have separate MP tier prices, and
stepsandguidanceonflux-2-flexdo not affect the price.
flux-kontext-pro / flux-kontext-max)
- One fixed price per image. Output is always 1 MP, reference images add no fee, and neither aspect ratio nor
output_formataffects the price.
Response
Completed task
result.images, and expires_at is when that link stops working. See Query Task Status for the full field list.
Available models
All five support
generate and edit, return one image per request, accept seed, and share the same aspect ratios: 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9, 9:21, auto.
- FLUX.2 picks the megapixel tier with
resolution:1mpthrough4mp, defaulting to2mp; higher tiers cost more - FLUX.1 Kontext does not accept
resolutionand always outputs 1 MP safety_toleranceranges differ:0–5on FLUX.2 and0–6on Kontext, with higher values more permissiveoutput_formatdefaults differ:jpegon FLUX.2,pngon Kontext