Key Capabilities
- Text-to-image — Generate images from text descriptions
- Step control — Adjust sampling steps (1–50) to flexibly balance speed and quality
- Guidance scale — Fine-tune prompt adherence (1.5–10)
- High resolution — supports up to 4MP output resolution
- Reproducible — Use
seedfor deterministic generation
Quick Example
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Fixed value: flux-2-flex |
prompt | string | Yes | Text description for the image |
n | integer | No | Number of images to generate (1–4), default 1 |
size | string | No | Output resolution, e.g. 1024x1024, supports up to 4MP |
inference_steps | integer | No | Sampling steps (1–50). Low steps (6–20) for rapid prototyping, high (40–50) for max fidelity |
guidance_scale | number | No | Guidance scale (1.5–10). Higher values produce closer adherence to the prompt |
output_format | string | No | jpeg or png |
seed | integer | No | Random seed for reproducibility |
Response Fields
| Field | Description |
|---|---|
data[].b64_json | Base64-encoded image data |
created | Creation timestamp |
API Reference
View the interactive API Playground for FLUX.2 [flex].

