text-to-image

Flux Kontext Max - Edit image from text

Generate and edit images using FLUX Kontext Max, the highest-quality tier of Black Forest Labs' Kontext family.

Kontext Max delivers maximum prompt adherence and detail for context-aware image editing. Provide an input image to guide the transformation, or generate from text alone. Ideal for high-fidelity edits, style changes, and professional image manipulation where output quality is the priority.

post/v1/ai/text-to-image/flux-kontext-max

Request

  • Base URL: https://api.magnific.com
  • URL: https://api.magnific.com/v1/ai/text-to-image/flux-kontext-max
  • Auth: API key in header x-magnific-api-key

Request body

promptstring required

Text description of the image or edit you want to generate.

FLUX Kontext Max is the highest-quality tier of the Kontext family, delivering maximum prompt adherence and detail for context-aware image editing and generation.

Tips for better results:

  • Be specific about subjects, scenes, and visual details
  • Describe the exact edit or transformation you want
  • Mention lighting, atmosphere, and art style if desired
input_imagestring uri required

URL to the input image that guides the generation process. The model uses this image as a reference while producing the output.

input_image_2string uri nullable

Optional URL to a second reference image. Flux Kontext Max supports up to 4 input images.

input_image_3string uri nullable

Optional URL to a third reference image. Flux Kontext Max supports up to 4 input images.

input_image_4string uri nullable

Optional URL to a fourth reference image. Flux Kontext Max supports up to 4 input images.

prompt_upsamplingboolean

Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.

seedinteger nullable

Optional seed for reproducibility. If not provided, a random seed will be used.

guidancenumber nullable

Guidance scale for the generation. Higher values make the model follow the prompt more closely.

stepsinteger nullable

Number of inference steps. More steps generally produce higher quality but take longer.

aspect_ratio'square_1_1' | 'classic_4_3' | 'traditional_3_4' | 'widescreen_16_9' | 'social_story_9_16' | 'standard_3_2' | 'portrait_2_3' | 'horizontal_2_1' | 'vertical_1_2' | 'social_post_4_5'

Image size with the aspect ratio. The aspect ratio is the proportional relationship between an image's width and height, expressed as *_width_height (e.g., square_1_1, widescreen_16_9). It is calculated by dividing the width by the height.
If not present, the default is square_1_1.

safety_toleranceinteger

Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict.

output_format'jpeg' | 'png' nullable

Format of the output image

webhook_urlstring uri

Optional callback URL that will receive asynchronous notifications whenever the task changes status. The payload sent to this URL is the same as the corresponding GET endpoint response, but without the data field.

Example request

{
  "prompt": "a beautiful sunset over the ocean with dramatic clouds",
  "input_image": "https://example.com/reference-image.jpg",
  "input_image_2": "https://example.com/reference-image-2.jpg",
  "input_image_3": "https://example.com/reference-image-3.jpg",
  "input_image_4": "https://example.com/reference-image-4.jpg",
  "aspect_ratio": "square_1_1",
  "webhook_url": "https://www.example.com/webhook"
}

Response

OK - Task created successfully

Example response

{
  "data": {
    "task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    "status": "CREATED"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.