8. Images#
8.1 Image generation#
POST /v1/images/generations — text to image (synchronous response).
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Image model name |
prompt | string | Yes | Image description |
size | string | No | Size, e.g. 1024x1024 |
n | integer | No | Number of images to generate |
cURL
curl http://183.240.79.21:52099/v1/images/generations \
-H "Authorization: Bearer sk-你的YiTuoToken-Key" \
-H "Content-Type: application/json" \
-d '{
"model": "dall-e-3",
"prompt": "一只戴着宇航头盔的柯基犬,赛博朋克风格",
"size": "1024x1024"
}'
8.2 Image editing#
POST /v1/images/edits — image-to-image / inpainting. The image file is uploaded with multipart/form-data.
cURL
curl http://183.240.79.21:52099/v1/images/edits \
-H "Authorization: Bearer sk-你的YiTuoToken-Key" \
-F model="dall-e-2" \
-F image=@./input.png \
-F prompt="把背景换成星空"