⌘K

FLUX.1 Kontext [max]

flux_kontext_max

Flux Kontext Max delivers maximum context understanding and image generation capabilities for complex creative tasks.

Authentication

authorization string required

All APIs require authentication via Bearer Token

Get API Key:

Visit API Key Management Page to get your API Key

Usage:

Add to request header:

Authorization: Bearer YOUR_API_KEY

Parameters

model string required

Model ID to use for the request

Value: flux_kontext_max


prompt string required

Text prompt describing the image content to generate or edit


input_image string

First input image, supports Base64 encoding or URL format


input_image_2 string

Second input image, supports Base64 encoding or URL format


input_image_3 string

Third input image, supports Base64 encoding or URL format


input_image_4 string

Fourth input image, supports Base64 encoding or URL format


seed integer

Random seed for reproducible generation results


aspect_ratio string

Image aspect ratio, format such as 16:9

Range: 21:9 - 9:21


steps integer

Inference steps

Range: 1 - 50


guidance_scale number

Guidance scale

Range: 1 - 10


negative_prompt string

Negative prompt describing content you do not want to appear


output_format string

Output format

Options: jpeg, png

Default: jpeg


prompt_upsampling boolean

Whether to enable prompt automatic enhancement. If activated, will automatically modify prompt to achieve more creative generation

Default: False


safety_tolerance integer

Input and output moderation tolerance level. 0 means strictest, 6 means least strict

Range: 0 - 6

Default: 2


Polling

Since video generation takes time, you need to poll the task status after creation

The initial response returns the task ID and initial status. The actual generation results must be obtained through polling the task status endpoint

Response Format

error object

Error information. Only present when status is failed

code string

Error code

message string

Detailed error message


output array

Generation results. Only present when status is completed

content array

List of generated content

type string

Resource type, e.g. video, image

url string

Generated content URL


usage object

Usage statistics. Only present when status is completed

cost string

Total cost in USD

discount number

Discount amount


metadata object

Metadata information


Error Codes

Error information is provided in the error field when status is failed.