---
title: "Flux Kontext Pro - Create image from text"
method: POST
path: "/v1/ai/text-to-image/flux-kontext-pro"
tags: ["text-to-image"]
---

# Flux Kontext Pro - Create image from text

`POST /v1/ai/text-to-image/flux-kontext-pro`

## Request

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

Generate images using FLUX Kontext Pro, an advanced text-to-image model with optional image input support.

This model excels at understanding context and generating high-quality images from text descriptions.
Optionally, you can provide an input image to guide the generation process.

## Request body

- TtifkpRequestContent
  - `prompt` string, required: Text description of the image you want to generate. **FLUX Kontext Pro** is an advanced text-to-image model that excels at understanding context and generating high-quality images. It supports optional image input to guide the generation. **Tips for better results:** - Be specific about subjects, scenes, and visual details - Describe lighting, atmosphere, and mood - Mention art style or photographic techniques if desired
  - `input_image` string, uri, nullable: Optional URL to an input image that will guide the generation process. The model will use this image as a reference while generating the output.
  - `prompt_upsampling` boolean: Whether to perform upsampling on the prompt. If active, automatically modifies the prompt for more creative generation.
  - `seed` integer, nullable: Optional seed for reproducibility. If not provided, a random seed will be used.
  - `guidance` number, nullable: Guidance scale for the generation. Higher values make the model follow the prompt more closely.
  - `steps` integer, 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_tolerance` integer: 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_url` string, 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.

## Response `200`

OK - Task created successfully

- CreateImageFromTextFlux200Response
  - `data` Task, required
    - `task_id` string, uuid, required: Task identifier
    - `status` 'CREATED' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED', required: Task status

## Other responses

- `400`: Bad Request - The server could not understand the request due to invalid syntax.
- `401`: Unauthorized - The client must authenticate itself to get the requested response.
- `500`: Internal Server Error - The server has encountered a situation it doesn't know how to handle.
- `503`: Service Unavailable

---

[API](https://skmtc.dev/magnific/apis/magnific-api.md) · [All operations](https://skmtc.dev/magnific/apis/magnific-api/llms.txt) · [OpenAPI document](https://skmtc.dev/magnific/apis/magnific-api/revisions/60711fb082c7?raw)
