> ## 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 Pro – Text-to-Image API | Magnific API

> Generate high-quality images from text with Flux Kontext Pro. Advanced context understanding with optional image input support. Multiple aspect ratios and fine-grained generation control.

<Card title="FLUX Kontext Pro integration" icon="wand-magic-sparkles">
  Advanced text-to-image model that excels at understanding context and generating high-quality images with optional image input guidance.
</Card>

Flux Kontext Pro is a state-of-the-art text-to-image model that combines superior context understanding with flexible generation controls. It supports optional image input to guide the generation process, enabling more precise control over the output. The model produces high-quality images across multiple aspect ratios, suitable for professional creative workflows.

### Key capabilities

* **Context-aware generation**: Advanced understanding of complex text descriptions for accurate image synthesis
* **Optional image guidance**: Provide a reference image URL to guide the generation toward desired visual styles
* **Prompt upsampling**: Automatic prompt modification for more creative and detailed outputs
* **Fine-grained control**: Adjustable guidance scale (1-10) and inference steps (1-100) for quality tuning
* **Multiple aspect ratios**: Support for square (1:1), widescreen (16:9), social story (9:16), classic (4:3, 3:4), and standard (3:2)
* **Reproducible results**: Optional seed parameter for consistent generation across requests

### Use cases

* **Marketing and advertising**: Generate product visuals and campaign imagery from descriptions
* **Content creation**: Create unique illustrations and graphics for blogs, social media, and websites
* **Design prototyping**: Quickly visualize concepts before detailed design work
* **E-commerce**: Generate product mockups and lifestyle imagery at scale
* **Creative exploration**: Experiment with visual ideas using text prompts and reference images

### Generate images with Flux Kontext Pro

Create images by submitting a request 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-pro" icon="wand-magic-sparkles" href="/api-reference/text-to-image/flux-kontext-pro/post-flux-kontext-pro">
      Create a new image generation task
    </Card>

    <Card title="GET /v1/ai/text-to-image/flux-kontext-pro" icon="list" href="/api-reference/text-to-image/flux-kontext-pro/get-flux-kontext-pro">
      List all Flux Kontext Pro tasks
    </Card>

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

### Parameters

| Parameter           | Type      | Required | Default      | Description                                                                                                                 |
| ------------------- | --------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------- |
| `prompt`            | `string`  | Yes      | -            | Text description of the image to generate                                                                                   |
| `input_image`       | `string`  | No       | -            | URL to a reference image for guided generation                                                                              |
| `prompt_upsampling` | `boolean` | No       | `false`      | Enable automatic prompt modification for creative results                                                                   |
| `seed`              | `integer` | No       | random       | Seed for reproducible generation                                                                                            |
| `guidance`          | `number`  | No       | `3.0`        | Guidance scale (1-10), higher values follow prompt more closely                                                             |
| `steps`             | `integer` | No       | `50`         | Inference steps (1-100), more steps produce higher quality                                                                  |
| `aspect_ratio`      | `string`  | No       | `square_1_1` | Output aspect ratio: `square_1_1`, `classic_4_3`, `traditional_3_4`, `widescreen_16_9`, `social_story_9_16`, `standard_3_2` |

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="What is Flux Kontext Pro and how does it work?">
    Flux Kontext Pro is an advanced text-to-image AI model that excels at understanding context from text descriptions. You submit a prompt via the API, optionally include a reference image URL, receive a task ID, and then poll for results or receive a webhook notification when the image is ready.
  </Accordion>

  <Accordion title="How does the image input guidance work?">
    When you provide an `input_image` URL, the model uses that image as a reference to guide the generation process. This helps achieve specific visual styles, color palettes, or compositional elements in the output while still following your text prompt.
  </Accordion>

  <Accordion title="What does prompt upsampling do?">
    Prompt upsampling automatically modifies your prompt to add more creative details and variations. Enable it when you want the model to expand on your description for more elaborate and artistic results.
  </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 images more faithful to the description. The `steps` parameter (1-100, default 50) controls quality: more steps produce finer details but take longer to process.
  </Accordion>

  <Accordion title="What aspect ratios are available?">
    Flux Kontext Pro supports six aspect ratios: `square_1_1` (default), `classic_4_3`, `traditional_3_4`, `widescreen_16_9`, `social_story_9_16`, and `standard_3_2`. Choose based on your intended use case.
  </Accordion>

  <Accordion title="Can I reproduce the same image?">
    Yes, use the `seed` parameter with the same value across requests to generate reproducible results. Combined with identical prompts and settings, you will get consistent outputs.
  </Accordion>
</AccordionGroup>

## Best practices

* **Prompt writing**: Be specific about subjects, scenes, lighting, atmosphere, and art style for better results
* **Guidance tuning**: Start with the default guidance (3.0) and increase for more literal prompt adherence
* **Image guidance**: Use reference images when you need specific visual styles or want to maintain consistency across generations
* **Production integration**: Use webhooks instead of polling for scalable applications
* **Error handling**: Implement retry logic for 503 errors during high traffic

## Related APIs

* **[Flux 2 Pro](/api-reference/text-to-image/post-flux-2-pro)**: High-quality text-to-image generation without image input support
* **[Flux 2 Turbo](/api-reference/text-to-image/post-flux-2-turbo)**: Faster generation with Flux 2 for time-sensitive workflows
* **[Seedream 4.5](/api-reference/text-to-image/post-seedream-v4-5)**: Alternative text-to-image model with different capabilities
