Skip to main content
POST
/
images
/
generations
Image Generation
curl --request POST \
  --url https://api.siliconflow.com/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "black-forest-labs/FLUX.2-pro",
  "prompt": "A serene landscape with mountains and a lake at sunset",
  "image_size": "512x512"
}
'
{
  "images": [
    {
      "url": "<string>"
    }
  ],
  "timings": {
    "inference": 123
  },
  "seed": 123
}

Authorizations

Authorization
string
header
required

Use the following format for authentication: Bearer

Body

application/json
model
enum<string>
default:black-forest-labs/FLUX.2-pro
required

Corresponding Model Name. To better enhance service quality, we will make periodic changes to the models provided by this service, including but not limited to model on/offlining and adjustments to model service capabilities. We will notify you of such changes through appropriate means such as announcements or message pushes where feasible.

Available options:
black-forest-labs/FLUX.2-pro
prompt
string
required

The text prompt describing the image to generate.

Example:

"A serene landscape with mountains and a lake at sunset"

image_size
enum<string>
default:512x512

Image resolution in "widthxheight" format. Supported resolutions:

  • "512x512" (1:1)
  • "768x1024" (3:4)
  • "1024x768" (4:3)
  • "576x1024" (9:16)
  • "1024x576" (16:9)
Available options:
512x512,
768x1024,
1024x768,
576x1024,
1024x576
seed
integer

Random seed for reproducible generation. If not specified, a random seed will be used.

Required range: 0 <= x <= 9999999999
output_format
enum<string>
default:png

Output format for the generated image.

Available options:
png,
jpeg

Response

200

images
object[]
timings
object
seed
integer