Skip to main content
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 model and nothing else. FLUX 3 Image has its own parameters and tiers; see FLUX 3 Image.

Quick start

A successful submission returns a 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 text
  • edit: rewrite a reference image; requires image_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.
See Submit a task for 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 in price_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, 3mp and 4mp each have their own price, and higher tiers cost more. Omitting resolution, or sending a value outside those tiers, settles at the fallback price, which equals the 2mp tier.
  • 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 steps and guidance on flux-2-flex do not affect the price.
FLUX.1 Kontext (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_format affects the price.
You are only billed for a successfully generated image. Failed and cancelled tasks, and tasks that return no usable image, are refunded in full.

Response

Completed task
Generated images come back in 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: 1mp through 4mp, defaulting to 2mp; higher tiers cost more
  • FLUX.1 Kontext does not accept resolution and always outputs 1 MP
  • safety_tolerance ranges differ: 0–5 on FLUX.2 and 0–6 on Kontext, with higher values more permissive
  • output_format defaults differ: jpeg on FLUX.2, png on Kontext