Key capabilities
- Text-to-image — Generate images from text descriptions
- Inference steps control — Adjust sampling steps (1–50) for speed vs. fidelity tradeoff
- 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 | Must be flux-2-flex |
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 |
inference_steps | integer | No | Sampling steps (1–50). Low (6–20) for fast prototyping, high (40–50) for max fidelity |
guidance_scale | number | No | Guidance scale (1.5–10). Higher = more prompt-faithful |
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 |
API Reference
View the interactive API playground for FLUX.2 [flex].