POST
/
images
/
generations
curl --request POST \
  --url https://api.siliconflow.cn/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "Kwai-Kolors/Kolors",
  "prompt": "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea",
  "negative_prompt": "<string>",
  "image_size": "1024x1024",
  "batch_size": 1,
  "seed": 4999999999,
  "num_inference_steps": 20,
  "guidance_scale": 7.5,
  "image": "data:image/webp;base64, XXX"
}'
{
  "images": [
    {
      "url": "<string>"
    }
  ],
  "timings": {
    "inference": 123
  },
  "seed": 123
}

Authorizations

Authorization
string
header
required

Use the following format for authentication: Bearer <your api key>

Body

application/json
model
enum<string>
default:Kwai-Kolors/Kolors
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:
Kwai-Kolors/Kolors
prompt
string
default:an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea
required
image_size
enum<string>
default:1024x1024
required
Available options:
1024x1024,
960x1280,
768x1024,
720x1440,
720x1280,
others
batch_size
integer
default:1
required

number of output images

Required range: 1 <= x <= 4
num_inference_steps
integer
default:20
required

number of inference steps

Required range: 1 <= x <= 100
guidance_scale
number
default:7.5
required

This value is used to control the degree of match between the generated image and the given prompt. The higher the value, the more the generated image will tend to strictly match the text prompt. The lower the value, the more creative and diverse the generated image will be, potentially containing more unexpected elements.

Required range: 0 <= x <= 20
negative_prompt
string

negative prompt

seed
integer
Required range: 0 <= x <= 9999999999
image
string
default:data:image/webp;base64, XXX

The image that needs to be uploaded should be converted into base64 format.

Response

200
application/json
200
images
object[]
timings
object
seed
integer