Flux 2.0
Flux 2.0 Image Generation
Generate high-quality images using Flux 2.0 model, supporting text-to-image and image-to-image
POST
Documentation Index
Fetch the complete documentation index at: https://docs.toapis.com/llms.txt
Use this file to discover all available pages before exploring further.
- Flux 2.0 image generation model
- Choose
flux-2-flex(faster, for quick iteration) orflux-2-pro(higher quality, better details) via the model parameter - Supports text-to-image and image-to-image, up to 8 reference images
- Billed by resolution (1K/2K)
- Async task mode, returns
task_idfor querying results
Authorization
All endpoints require Bearer Token authenticationGet your API Key: Visit the API Key Management Page to get your API KeyAdd to request header:
Request Parameters
Image generation model nameOptions:
flux-2-flex- Faster, suitable for quick iterationflux-2-pro- Higher quality, better details
Text description for image generation
Image aspect ratioSupported aspect ratios:
1:1- Square (default)4:3/3:4- Traditional display ratio16:9/9:16- Widescreen/portrait3:2/2:3- Standard photo
Reference image URL array for image-to-image⚠️ URL format only (base64 not supported)
- Publicly accessible image URL (http:// or https://)
- Use the Upload Image API to upload local images and get URLs
- Maximum 8 reference images
Metadata parameters for additional configuration options
Response
Unique task identifier for querying task status
Object type, fixed as
generation.taskModel name used for generation
Task status
queued- Waiting to be processedin_progress- Processingcompleted- Successfully completedfailed- Failed
Task progress percentage (0-100)
Task creation timestamp (Unix timestamp)
Task metadata
Use Cases
Case 1: Text-to-Image (Quick Iteration)
Case 2: Text-to-Image (High Quality Output)
Case 3: Image-to-Image (Multiple Reference Images)
Case 4: Portrait Poster
Query Task ResultsImage generation is an async task. After submission, a task ID is returned. Use the Get Task Status endpoint to query generation progress and results.