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

# FLUX.2 [pro]

> FLUX.2 [pro] text-to-image model by Black Forest Labs via Anyfast API.

FLUX.2 \[pro] is an advanced text-to-image generation model from Black Forest Labs, available through Anyfast. It supports up to 4MP resolution and multi-reference image consistency. The API is **synchronous** — it returns the generated image directly as base64-encoded data.

## Key capabilities

* **Text-to-image** — Generate images from text descriptions
* **High resolution** — Supports up to 4MP output resolution
* **Reproducible** — Use `seed` for deterministic generation
* **Format control** — Choose `jpeg` or `png` output

## Quick example

<CodeGroup>
  ```bash cURL theme={null}
  curl https://www.anyfast.ai/v1/images/generations \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "flux-2-pro",
      "prompt": "A cute baby polar bear",
      "size": "1024x1024"
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://www.anyfast.ai/v1/images/generations",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      json={
          "model": "flux-2-pro",
          "prompt": "A cute baby polar bear",
          "size": "1024x1024"
      }
  )

  result = response.json()
  # result["data"][0]["b64_json"] contains the base64-encoded image
  ```
</CodeGroup>

## Parameters

| Parameter       | Type    | Required | Description                                       |
| --------------- | ------- | -------- | ------------------------------------------------- |
| `model`         | string  | Yes      | Must be `flux-2-pro`                              |
| `prompt`        | string  | Yes      | Text description of the image                     |
| `n`             | integer | No       | Number of images (1–4). Default: `1`              |
| `size`          | string  | No       | Output size, e.g. `1024x1024`. Supports up to 4MP |
| `output_format` | string  | No       | `jpeg` or `png`                                   |
| `seed`          | integer | No       | Random seed for reproducibility                   |

## Response

| Field             | Description               |
| ----------------- | ------------------------- |
| `data[].b64_json` | Base64-encoded image data |
| `created`         | Unix timestamp            |

<Card title="API Reference" icon="code" href="/api-reference/model-api/blackforestlabs/flux-2-pro">
  View the interactive API playground for FLUX.2 \[pro].
</Card>

<script src="/feedback.js" />
