> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magnific.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Flux Kontext Max - Image Editing API | Magnific API

> Edit and transform images from text with Flux Kontext Max. Highest-quality Kontext tier with maximum prompt adherence, 10 aspect ratios and fine-grained control.

<Card title="Black Forest Labs FLUX Kontext Max" icon="wand-magic-sparkles">
  The highest-quality tier of the FLUX Kontext family, delivering maximum prompt adherence and detail for context-aware image editing.
</Card>

Flux Kontext Max is an image editing API that transforms a reference image based on a text prompt. Developed by Black Forest Labs, it is the highest-quality tier of the Kontext family, delivering maximum prompt adherence and fine detail for context-aware editing and generation. It accepts up to 4 reference images and produces high-quality images across 10 aspect ratios in PNG or JPEG format, suitable for professional creative workflows.

### Key capabilities

* **Context-aware editing**: Uses a reference image and text prompt together for precise, prompt-driven transformations
* **Multi-image reference**: Up to 4 reference image URLs (`input_image`, `input_image_2`, `input_image_3`, `input_image_4`) to guide the edit
* **Maximum prompt adherence**: Highest-quality tier of the Kontext family for accurate detail and faithful edits
* **Prompt upsampling**: Optional automatic prompt modification for more creative outputs
* **Fine-grained control**: Adjustable guidance scale (1-10) and inference steps (1-100) for quality tuning
* **10 aspect ratios**: Square (1:1), widescreen (16:9), social story (9:16), classic (4:3), portrait, and more
* **Safety control**: Adjustable moderation tolerance from 0 (most strict) to 6 (least strict)
* **Output formats**: PNG (lossless) or JPEG (compressed)
* **Async processing**: Webhook notifications or polling for task completion

### Use cases

* **Product photography**: Edit and restyle product shots while preserving key elements
* **Marketing and advertising**: Adapt existing campaign imagery to new concepts from text
* **Content creation**: Transform illustrations and photos for blogs, social media, and websites
* **Design prototyping**: Iterate on visual concepts using a reference image as a starting point
* **E-commerce**: Generate consistent lifestyle and mockup variations at scale

### Edit images with Flux Kontext Max

Submit a reference image and a text prompt to the API. The service returns a task ID for async polling or webhook notification.

<div className="my-11">
  <Columns cols={2}>
    <Card title="POST /v1/ai/text-to-image/flux-kontext-max" icon="wand-magic-sparkles" href="/api-reference/text-to-image/flux-kontext-max/edit-image">
      Create a new image editing task
    </Card>

    <Card title="GET /v1/ai/text-to-image/flux-kontext-max" icon="list" href="/api-reference/text-to-image/flux-kontext-max/flux-kontext-max-tasks">
      List all Flux Kontext Max tasks with status
    </Card>

    <Card title="GET /v1/ai/text-to-image/flux-kontext-max/{task-id}" icon="magnifying-glass" href="/api-reference/text-to-image/flux-kontext-max/task-by-id">
      Get task status and results by ID
    </Card>
  </Columns>
</div>

### Parameters

| Parameter           | Type      | Required | Default      | Description                                                                                                                                                                               |
| ------------------- | --------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `prompt`            | `string`  | Yes      | -            | Text description of the image or edit to generate                                                                                                                                         |
| `input_image`       | `string`  | Yes      | -            | URL to the reference image that guides the generation                                                                                                                                     |
| `input_image_2`     | `string`  | No       | -            | Second reference image URL                                                                                                                                                                |
| `input_image_3`     | `string`  | No       | -            | Third reference image URL                                                                                                                                                                 |
| `input_image_4`     | `string`  | No       | -            | Fourth reference image URL                                                                                                                                                                |
| `prompt_upsampling` | `boolean` | No       | `false`      | Enable automatic prompt modification for creative results                                                                                                                                 |
| `seed`              | `integer` | No       | random       | Seed that influences generation                                                                                                                                                           |
| `guidance`          | `number`  | No       | `3.0`        | Guidance scale (1-10), higher values follow the prompt more closely                                                                                                                       |
| `steps`             | `integer` | No       | `50`         | Inference steps (1-100), more steps produce higher quality                                                                                                                                |
| `aspect_ratio`      | `string`  | No       | `square_1_1` | Output 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` |
| `safety_tolerance`  | `integer` | No       | `2`          | Content moderation: 0 (strict) to 6 (lenient)                                                                                                                                             |
| `output_format`     | `string`  | No       | -            | Output format: `jpeg` or `png`                                                                                                                                                            |
| `webhook_url`       | `string`  | No       | -            | URL for completion notification                                                                                                                                                           |

<Warning>
  `aspect_ratio` accepts named string values only (for example `widescreen_16_9`), not numeric ratios like `"16:9"`. Passing an unlisted value returns a `400` error.
</Warning>

### Aspect ratios

| Value               | Ratio         |
| ------------------- | ------------- |
| `square_1_1`        | 1:1 (default) |
| `classic_4_3`       | 4:3           |
| `traditional_3_4`   | 3:4           |
| `widescreen_16_9`   | 16:9          |
| `social_story_9_16` | 9:16          |
| `standard_3_2`      | 3:2           |
| `portrait_2_3`      | 2:3           |
| `horizontal_2_1`    | 2:1           |
| `vertical_1_2`      | 1:2           |
| `social_post_4_5`   | 4:5           |

<Warning>
  Generated image URLs are signed and expire quickly (around 10-15 minutes). Download or store the output promptly; do not treat the URL as a permanent link.
</Warning>

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="What is Flux Kontext Max and how does it work?">
    Flux Kontext Max is the highest-quality tier of Black Forest Labs' FLUX Kontext family, built for context-aware image editing. You submit a reference image URL (`input_image`) and a text prompt via the API, receive a task ID immediately, then poll for results or receive a webhook notification when processing completes.
  </Accordion>

  <Accordion title="What is the difference between Flux Kontext Max and Flux Kontext Pro?">
    Both edit images using a reference image and text prompt. Flux Kontext Max is the highest-quality tier, offering maximum prompt adherence and detail. Flux Kontext Pro treats the reference image as optional guidance for broader text-to-image generation. Choose Flux Kontext Max when edit precision and detail are the priority.
  </Accordion>

  <Accordion title="Is the input image required?">
    Yes. Flux Kontext Max requires both a `prompt` and an `input_image` URL. The model uses the reference image as the basis for the edit and applies the transformation described in the prompt. You can supply up to 3 additional reference images with `input_image_2`, `input_image_3`, and `input_image_4`.
  </Accordion>

  <Accordion title="Does the same seed produce identical images?">
    The `seed` influences generation and helps you steer toward similar results, but the Kontext provider does not guarantee identical output for an identical seed. Setting `prompt_upsampling` to `true` makes runs inherently non-reproducible, since the prompt is rewritten on each call.
  </Accordion>

  <Accordion title="How do guidance and steps affect the output?">
    The `guidance` parameter (1-10, default 3.0) controls how closely the model follows your prompt; higher values produce edits more faithful to the description. The `steps` parameter (1-100, default 50) controls quality: more steps produce finer detail but take longer to process.
  </Accordion>

  <Accordion title="What aspect ratios and output formats are available?">
    Flux Kontext Max supports 10 aspect ratios, passed as named string values: `square_1_1` (default), `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`, and `social_post_4_5`. Use the exact enum value, for example `widescreen_16_9` for a 16:9 image; a numeric ratio like `"16:9"` returns a `400` error. Output is delivered as `png` (lossless) or `jpeg` (compressed).
  </Accordion>

  <Accordion title="What are the rate limits for Flux Kontext Max?">
    See [Rate Limits](/ratelimits) for current limits by subscription tier.
  </Accordion>

  <Accordion title="How much does Flux Kontext Max cost?">
    See [Pricing](/pricing) for detailed rates and subscription options.
  </Accordion>
</AccordionGroup>

## Best practices

* **Reference image**: Use a high-quality `input_image` with clear subjects for the most accurate edits
* **Prompt writing**: Describe the exact edit or transformation you want, including lighting, atmosphere, and art style
* **Guidance tuning**: Start with the default guidance (3.0) and increase for more literal prompt adherence
* **Production integration**: Use webhooks instead of polling for scalable applications
* **Error handling**: Implement retry logic with exponential backoff for 503 errors

## Related APIs

* **[Flux Kontext Pro](/api-reference/text-to-image/flux-kontext-pro/overview)**: Context-aware generation with optional image guidance
* **[FLUX.2 Klein](/api-reference/text-to-image/flux-2-klein/overview)**: Fastest FLUX.2 model for sub-second generation
* **[FLUX.2 Pro](/api-reference/text-to-image/post-flux-2-pro)**: High-quality text-to-image generation
