POST
/
v3beta
/
flux-1-schnell

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

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

Request Headers

Content-Type
string
required

Enum: application/json

Authorization
string
required

Bearer authentication format, for example: Bearer {{API Key}}.

Request Body

response_image_type
string

The returned image type. Default is png.
Enum: png webp jpeg

prompt
string
required

Text input required to guide the image generation, divided by , . Range [1, 1024].

seed
integer
required

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].

steps
integer
required

The number of denoising steps. More steps usually can produce higher quality images, but take more time to generate, Range [1, 100].

width
integer
required

Width of image. Range [64, 2048].

height
integer
required

Height of image. Range [64, 2048].

image_num
integer
required

Images numbers generated in one single generation. Range [1, 8].

Response

task
object

Task information.

images
object[]

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.

Example

request

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

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

Was this page helpful?