> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qingbo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 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

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](/en/api-reference/image/flux/flux-3-image).

## Quick start

<CodeGroup>
  ```bash Text to image theme={"system"}
  curl -X POST https://api.qingbo.ai/v1/tasks \
    -H "Authorization: Bearer $WAVE_API_KEY" \
    -H "Content-Type: application/json" \
    -H "Idempotency-Key: flux-demo-001" \
    -d '{
      "model": "flux-2-pro",
      "action": "generate",
      "prompt": "A city corner after rain, neon reflected in puddles, cinematic composition",
      "aspect_ratio": "16:9",
      "resolution": "2mp",
      "output_format": "png"
    }'
  ```

  ```bash Contextual edit theme={"system"}
  curl -X POST https://api.qingbo.ai/v1/tasks \
    -H "Authorization: Bearer $WAVE_API_KEY" \
    -H "Content-Type: application/json" \
    -H "Idempotency-Key: flux-edit-001" \
    -d '{
      "model": "flux-kontext-pro",
      "action": "edit",
      "prompt": "Keep the subject and composition, change the season to first snow",
      "image_urls": ["https://cdn.example.com/source.png"],
      "aspect_ratio": "1:1"
    }'
  ```

  ```bash Tune steps and guidance theme={"system"}
  curl -X POST https://api.qingbo.ai/v1/tasks \
    -H "Authorization: Bearer $WAVE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "flux-2-flex",
      "action": "generate",
      "prompt": "A hand-painted watercolour botanical plate on a white background",
      "aspect_ratio": "3:4",
      "resolution": "1mp",
      "steps": 28,
      "guidance": 3.5,
      "seed": 12345
    }'
  ```
</CodeGroup>

A successful submission returns a `task_id`. Retrieve the result with [`GET /v1/tasks/{task_id}`](/en/api-reference/task/status), wait inline with [`Prefer: wait`](/en/api-reference/task/submit#in-request-waiting-prefer-wait), or configure a webhook.

## Request parameters

<ParamField body="model" type="string" required>
  One of `flux-2-pro`, `flux-2-max`, `flux-2-flex`, `flux-kontext-pro` or `flux-kontext-max`.
</ParamField>

<ParamField body="action" type="string" default="generate">
  * `generate`: create an image from text
  * `edit`: rewrite a reference image; requires `image_urls`
</ParamField>

<ParamField body="prompt" type="string" required>
  The image description or editing instruction.
</ParamField>

<ParamField body="image_urls" type="string[]">
  Reference image URLs. Required for `edit`; `generate` accepts none. Up to eight on FLUX.2 and four on FLUX.1 Kontext.
</ParamField>

<ParamField body="aspect_ratio" type="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.
</ParamField>

<ParamField body="resolution" type="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.
</ParamField>

<ParamField body="n" type="integer" default="1">
  Number of images to generate. Value: `1`. Each request returns one image.
</ParamField>

<ParamField body="seed" type="integer">
  Random seed. The same seed with the same parameters keeps results consistent.
</ParamField>

<ParamField body="output_format" type="string">
  Output image format: `jpeg`, `png` or `webp`. FLUX.2 defaults to `jpeg`, FLUX.1 Kontext to `png`.
</ParamField>

<ParamField body="prompt_upsampling" type="boolean" default="false">
  Let the upstream expand the prompt before generating.
</ParamField>

<ParamField body="safety_tolerance" type="integer" default="2">
  Content safety tolerance; higher values are more permissive. `0`–`5` on FLUX.2, `0`–`6` on FLUX.1 Kontext.
</ParamField>

<ParamField body="steps" type="integer" default="50">
  Inference steps, `1`–`50`. More steps add detail and take longer. Supported by `flux-2-flex` only.
</ParamField>

<ParamField body="guidance" type="number" default="5">
  Prompt guidance strength, `1.5`–`10`. Higher values follow the prompt more closely. Supported by `flux-2-flex` only.
</ParamField>

See [Submit a task](/en/api-reference/task/submit) 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

| Condition | Limit |
| - | - |
| Per request | One image returned; `prompt` is required |
| `action: "generate"` | Takes no reference images |
| `action: "edit"` | At least one reference image is required |
| Reference images | Up to 8 on FLUX.2; up to 4 on FLUX.1 Kontext |
| Total pixels | The output image plus all reference images must stay within 9 MP (1 MP = 1024 × 1024 pixels) |
| Reference image formats | Directly downloadable PNG, JPEG, WebP, GIF or BMP; an image whose dimensions cannot be read returns `400` and is not billed |
| `resolution` | Accepted by FLUX.2 only; `steps` and `guidance` by `flux-2-flex` only |

## 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

```json Completed task theme={"system"}
{
  "task_id": "task-wave1789004688b950049238",
  "model": "flux-2-pro",
  "action": "generate",
  "status": "completed",
  "progress": "100%",
  "created_at": 1788754231,
  "completed_at": 1788754252,
  "result": {
    "images": [
      {
        "expires_at": 1789089508,
        "url": ["https://cdn.example.com/result.png"]
      }
    ]
  },
  "urls": {
    "get": "https://api.qingbo.ai/v1/tasks/task-wave1789004688b950049238",
    "cancel": "https://api.qingbo.ai/v1/tasks/task-wave1789004688b950049238/cancel"
  },
  "billing_status": "settled",
  "cost": 20250
}
```

Generated images come back in `result.images`, and `expires_at` is when that link stops working. See [Query Task Status](/en/api-reference/task/status) for the full field list.

## Available models

| Model ID | Output resolution | Reference images | Line-specific parameters |
| - | - | - | - |
| `flux-2-pro` | `1mp` `2mp` `3mp` `4mp` | Up to 8, each billed | `output_format` `prompt_upsampling` `safety_tolerance` |
| `flux-2-max` | `1mp` `2mp` `3mp` `4mp` | Up to 8, each billed | `output_format` `prompt_upsampling` `safety_tolerance` |
| `flux-2-flex` | `1mp` `2mp` `3mp` `4mp` | Up to 8, each billed | Those three plus `steps` and `guidance` |
| `flux-kontext-pro` | Fixed 1 MP | Up to 4, no extra fee | `output_format` `prompt_upsampling` `safety_tolerance` |
| `flux-kontext-max` | Fixed 1 MP | Up to 4, no extra fee | `output_format` `prompt_upsampling` `safety_tolerance` |

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

## Related

* [FLUX 3 Image](/en/api-reference/image/flux/flux-3-image)
* [Image Generation Overview](/en/api-reference/image/overview)
* [Submit Task](/en/api-reference/task/submit)
* [Query Task Status](/en/api-reference/task/status)
* [Task System](/en/docs/task-system)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.