---
title: "Flux Dev - Create image from text"
method: POST
path: "/v1/ai/text-to-image/flux-dev"
tags: ["text-to-image"]
---

# Flux Dev - Create image from text

`POST /v1/ai/text-to-image/flux-dev`

## Request

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

Convert descriptive text input into images using AI. This endpoint accepts a variety of parameters to customize the generated images.

## Request body

- TtifdRequestContent
  - `prompt` string: The prompt is a short text that describes the image you want to generate. It can range from simple descriptions, like `"a cat"`, to detailed scenarios, such as `"a cat with wings, playing the guitar, and wearing a hat"`. If no prompt is provided, the AI will generate a random 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.
  - `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`.
  - `styling` TtifdRequestContentStyling: Styling options for the image
    - `effects` TtifdRequestContentStylingEffects
      - `color` 'softhue' | 'b&w' | 'goldglow' | 'vibrant' | 'coldneon': Color effect to apply
      - `framing` 'portrait' | 'lowangle' | 'midshot' | 'wideshot' | 'tiltshot' | 'aerial': Camera effect to apply
      - `lightning` 'iridescent' | 'dramatic' | 'goldenhour' | 'longexposure' | 'indorlight' | 'flash' | 'neon': Lightning effect to apply
    - `colors` ColorsPaletteInner[]: Dominant colors to generate the image
      - `color` string, required: Hex color code
      - `weight` number, required: Weight of the color (0.05 to 1)
  - `seed` integer: Seed for the image generation. If not provided, a random seed will be used.

## Response `200`

OK - Get the status of the flux-dev task

- 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)
