Flux 2.0 Image Generation
- Asynchronous processing mode, returns task ID for subsequent queries
- Supports text-to-image and image-to-image generation
- Generated image links are valid for 24 hours, please save promptly
POST
Supported Models
| Model | Description | Pricing |
|---|---|---|
flux-2-flex | Flux 2.0 Flex image generation model (faster, suitable for quick iterations) | By resolution (1K/2K) |
flux-2-pro | Flux 2.0 Pro image generation model (higher quality, better details) | By resolution (1K/2K) |
Authorizations
All endpoints require Bearer Token authenticationGet API Key:Visit API Key Management to get your API KeyAdd to request header:
Body
Model name
flux-2-flex- Flux 2.0 Flex model (faster, suitable for quick iterations)flux-2-pro- Flux 2.0 Pro model (higher quality, better details)
Text description for image generation
Image resolutionSupported resolutions:
1K- Default, 1080p level2K- HD, max 2048 pixels
Case insensitive:1k,1K,2k,2Kall work
Image aspect ratioSupported aspect ratios:
1:1- Square (default)4:3- Landscape3:4- Portrait16:9- Widescreen9:16- Vertical3:2- Classic landscape2:3- Classic portrait
Only these 7 ratios are supported, unsupported ratios will return an error
Reference image URL listLimitations:
- Maximum 8 images
- Must be publicly accessible URL
- Base64 format not supported
Resolution Reference Table
| Ratio | Name | 1K Size | 2K Size |
|---|---|---|---|
1:1 | Square | 1440×1440 | 1536×1536 |
4:3 | Landscape | 1664×1248 | 1824×1368 |
3:4 | Portrait | 1248×1664 | 1368×1824 |
16:9 | Widescreen | 1920×1080 | 2048×1152 |
9:16 | Vertical | 1080×1920 | 1152×2048 |
3:2 | Classic Landscape | 1728×1152 | 1872×1248 |
2:3 | Classic Portrait | 1152×1728 | 1248×1872 |
Usage Examples
Basic Text-to-ImageResponse
Response status code
Response data array
Notes
- Image URL Requirements: Input images must be publicly accessible URLs, base64 not supported
- Result Storage: Generated images are automatically stored, URLs valid for 24 hours
- Task Polling: Tasks are processed asynchronously, poll
/v1/tasks/{task_id}for results - Input Image Limits: Up to 8 reference images supported