Skip to main content

Generate or Edit Image

POST 

/api/v1/flux/kontext/generate

Create a new image generation or editing task using the Flux Kontext AI model.

Usage Modes

  1. Text-to-Image Generation

    • Provide prompt and aspectRatio
    • Model will generate a new image based on the text description
  2. Image Editing

    • Provide prompt and inputImage
    • Model will edit the input image according to the prompt

Important Notes

  • Generated images will expire after 14 days
  • Prompts only support English
  • Choose the appropriate model based on your needs:
    • flux-kontext-pro: Standard model for most use cases
    • flux-kontext-max: Enhanced model for complex scenes

Request

Responses

Request successful

Callbacks

POST 

{$request.body#/callBackUrl}

When the image generation task is completed, the system will send the result to your provided callback URL via POST request

Callbacks Responses

Callback received successfully