black-forest-labs/FLUX-1-schnell cover image
featured

black-forest-labs/FLUX-1-schnell

FLUX.1 [schnell] is a 12 billion parameter rectified flow transformer capable of generating images from text descriptions. This model offers cutting-edge output quality and competitive prompt following, matching the performance of closed source alternatives. Trained using latent adversarial diffusion distillation, FLUX.1 [schnell] can generate high-quality images in only 1 to 4 steps.

FLUX.1 [schnell] is a 12 billion parameter rectified flow transformer capable of generating images from text descriptions. This model offers cutting-edge output quality and competitive prompt following, matching the performance of closed source alternatives. Trained using latent adversarial diffusion distillation, FLUX.1 [schnell] can generate high-quality images in only 1 to 4 steps.

Public
$0.0005 x (width / 1024) x (height / 1024) x iters
ProjectLicense

OpenAI-compatible HTTP API

This document provides an overview of the DeepInfra-compatible OpenAI image generation API. It allows users to generate AI-created images based on text prompts using DeepInfra models.

Image Generation

curl https://api.deepinfra.com/v1/openai/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DEEPINFRA_TOKEN" \
  -d '{
    "prompt": "A photo of an astronaut riding a horse on Mars.",
    "size": "1024x1024",
    "model": "black-forest-labs/FLUX-1-schnell",
    "n": 1
    }'

The API returns a JSON object containing the generated image(s).

Example Response

{
  "created": 1707000000,
  "data": [
    {
      "revised_prompt": "A photo of an astronaut riding a horse on Mars.",
      "b64_json": "/9j/4AAQS..."
    }
  ]
}

Input fields

modelstring

The model to use for image generation.


ninteger

The number of images to generate.

Default value: 1

Range: 1 ≤ n ≤ 4


response_formatstring

The format in which the generated images are returned. Currently only b64_json is supported.

Default value: "b64_json"

Allowed values: b64_json


sizestring

The size of the generated images. Available sizes depend on the model.

Default value: "1024x1024"


userstring

A unique identifier representing your end-user, which can help to monitor and detect abuse.


promptstring

A text description of desired image(s).


qualitystring

The quality of the image that will be generated.


stylestring

The style of the generated images.

Input Schema

Output Schema