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

# FLUX.1 [schnell] Text to Image

**Generate images from text prompts using FLUX.1 \[schnell].**

> **Pricing:** \$0.003 \* (Width \* Height \* Steps) / (1024\*1024\*4)

## Request Headers

<ParamField header="Content-Type" type="string" required={true}>
  Enum: `application/json`
</ParamField>

<ParamField header="Authorization" type="string" required={true}>
  Bearer authentication format, for example: Bearer \{\{API Key}}.
</ParamField>

## Request Body

<ParamField body="response_image_format" type="string" required={false}>
  The returned image type. Default is png.<br />
  Enum: `png` `webp` `jpeg`
</ParamField>

<ParamField body="prompt" type="string" required={true}>
  Text input required to guide the image generation, divided by `,` . Range \[1, 1024].
</ParamField>

<ParamField body="seed" type="integer" required={true}>
  A seed is a number from which Stable Diffusion generates noise, which, makes generation deterministic. Using the same seed and set of parameters will produce identical image each time. Range \[0, 4294967295].
</ParamField>

<ParamField body="steps" type="integer" required={true}>
  The number of denoising steps. More steps usually can produce higher quality images, but take more time to generate, Range \[1, 100].
</ParamField>

<ParamField body="width" type="integer" required={true}>
  Width of image. Range \[64, 2048].
</ParamField>

<ParamField body="height" type="integer" required={true}>
  Height of image. Range \[64, 2048].
</ParamField>

<ParamField body="image_num" type="integer" required={true}>
  Images numbers generated in one single generation. Range \[1, 8].
</ParamField>

## Response

<ResponseField name="task" type="object" required={false}>
  Task information.

  <Expandable title="properties" defaultOpen={false}>
    <ResponseField name="task_id" type="string" required={false}>
      Task ID.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="images" type="object[]" required={false}>
  Contains information about images associated with image-type tasks. This parameter provides detailed data on each image processed or generated during the task, such as file paths, metadata, or any image-specific attributes. It is returned only for tasks that involve image operations, facilitating enhanced tracking and management of image data.

  <Expandable title="properties" defaultOpen={false}>
    <ResponseField name="image_url" type="string" required={false}>
      Image URL.
    </ResponseField>

    <ResponseField name="image_url_ttl" type="integer" required={false}>
      Image expiration time in seconds.
    </ResponseField>

    <ResponseField name="image_type" type="string" required={false}>
      Image type.<br />
      Enum: `jpeg`, `png`, `webp`
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

request

```bash theme={"system"}
curl --location 'https://api.novita.ai/v3beta/flux-1-schnell' \
--header 'Authorization: Bearer {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
  "prompt": "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"Novita AI\" is painted over it in big, white brush strokes with visible texture",
  "width": 512,
  "height": 512,
  "seed": 2024,
  "steps": 4,
  "image_num": 1
}'
```

response

```json theme={"system"}
{
  "images": [
    {
      "image_url": "https://model-api-output.5e61b0cbce9f453eb9db49fdd85c7cac.r2.cloudflarestorage.com/xxx",
      "image_url_ttl": 604800,
      "image_type": "png"
    }
  ],
  "task": {
    "task_id": "xxx"
  }
}
```
