# FLUX.2 [flex]

FLUX.2 [flex] is the developer-configurable variant in the FLUX.2 family. It exposes `steps` and guidance scale as first-class parameters so you can tune the quality-speed tradeoff per use case.

- **Model ID:** `bfl/flux-2-flex`
- **Type:** image
- **Providers:** bfl
- **Context window:** Not applicable
- **Maximum output tokens:** 0
- **Pricing:** See the provider details below
- **Canonical page:** https://vercel.com/ai-gateway/models/flux-2-flex

## Supported parameters

- **Parameters:** `seed`
- **Operations:** `text-to-image`, `image-to-image`
- **Input modalities:** `text`, `image`
- **Output modalities:** `image`
- **Aspect ratios:** Not reported
- **Resolutions:** Not reported
- **Durations:** Not reported
- **Frame rates:** Not reported
- **Maximum outputs per request:** Not reported
- **Maximum input images:** 8
- **Input image formats:** Not reported
- **Maximum input image size:** Not reported

## Example

```ts
import { experimental_generateImage as generateImage } from 'ai';

const result = await generateImage({
  model: 'bfl/flux-2-flex',
  prompt: 'A red balloon on a wooden table.'
});
```

## About

FLUX.2 [flex] belongs to the FLUX.2 family from Black Forest Labs. Other FLUX.2 variants optimize for a fixed quality level. Flex gives you direct control over the number of inference steps and the guidance scale.

The FLUX.2 architecture pairs a Mistral-3 24B vision-language model (VLM) with a rectified flow transformer retrained on a new variational autoencoder (VAE). The VLM contributes real-world knowledge and contextual understanding, producing more coherent scenes, correct spatial logic, and reliable typography. FLUX.2 supports multi-reference input with up to 10 reference images and image editing at resolutions up to 4 megapixels.

Flex's role in the lineup is explicit parameter control. If you build workflows that span multiple quality tiers (a quick draft view and a high-fidelity export, for example), you can use one Flex endpoint and change the `steps` value instead of switching models. That makes Flex a natural fit for tools, pipelines, and interfaces that expose a quality dial to end users.

## What to consider

Because FLUX.2 [flex] exposes the `steps` parameter, you can run a quick low-step pass to validate a composition before you commit to a full-quality render. That cuts iteration cost during prompt development. Compare N/A against other FLUX.2 tiers.

## When to use

### Best For

- Workflows that need a configurable quality-speed tradeoff in a single model (draft previews at six steps, final renders at 50 steps)
- Applications where typography accuracy and fine text legibility matter, such as UI mockup generation or infographic creation
- Iterative prompt development where rapid low-step passes validate composition before full-quality generation
- Developer tools and interfaces that expose a quality slider and need to map it to inference step count

### Consider Alternatives When

- You want maximum automatic quality without managing inference parameters. FLUX.2 Pro handles this with tuned default parameters
- The task is image inpainting or masked region fill. FLUX.1 Fill Pro is purpose-built for that
- Sub-second real-time generation is required. FLUX.2 Klein is optimized for interactive speed

## Best for

- **Configurable quality-speed tradeoff:** Single model that supports draft previews at six steps and final renders at 50 steps
- **Typography accuracy:** Applications like UI mockup generation or infographic creation where fine text legibility matters
- **Iterative prompt development:** Rapid low-step passes validate composition before committing to full-quality generation
- **Quality slider interfaces:** Developer tools that expose a quality control mapped to inference step count

## Consider alternatives

- **Maximum automatic quality:** FLUX.2 Pro handles this with tuned default parameters when you don't want to manage inference parameters
- **Image inpainting:** FLUX.1 Fill Pro is purpose-built for masked region fill tasks
- **Real-time generation:** FLUX.2 Klein is optimized for sub-second interactive speed

## Frequently asked questions

### What parameter makes FLUX.2 [flex] different from other FLUX.2 models?

Flex exposes the `steps` parameter, which controls the number of diffusion inference steps. Fewer steps produce faster outputs with softer details. More steps yield sharper typography and finer image detail. This runtime tuning is Flex's core differentiator within the FLUX.2 family.

### Does FLUX.2 [flex] support image editing as well as text-to-image generation?

Yes. All FLUX.2 variants, including Flex, support image editing from text and multiple references in a single model.

### How many reference images can FLUX.2 [flex] accept?

Up to 10 simultaneous reference images. Use them to keep character, product, and style aligned across generations.

### What resolution does FLUX.2 [flex] support?

Up to 4 megapixels. All FLUX.2 models share this resolution ceiling for both generation and editing.

### When should I use Flex instead of FLUX.2 Pro?

Use Flex when you need explicit control over the `steps` parameter to tune quality vs. speed at request time. Use FLUX.2 Pro when you want maximum automatic image quality without managing inference parameters.

### Is FLUX.2 [flex] a pure image generation model?

Yes. FLUX.2 [flex] is a dedicated image generation model (a rectified-flow transformer), not a multimodal large language model (LLM). It doesn't process conversation history and has no context window for chat. Use `generateImage` from the AI SDK to send requests.

### What does FLUX.2 [flex] cost per image?

Pricing appears on this page and updates as providers adjust their rates. AI Gateway routes traffic through the configured provider.

## Links

- [Model page](https://vercel.com/ai-gateway/models/flux-2-flex)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://bfl.ai/blog/flux-2)
- [Provider pricing](https://bfl.ai/pricing)
