8. 图像 Images#
8.1 图片生成#
POST /v1/images/generations — 文生图(同步返回)。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 图像模型名 |
prompt | string | 是 | 图像描述 |
size | string | 否 | 尺寸,如 1024x1024 |
n | integer | 否 | 生成数量 |
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 图片编辑#
POST /v1/images/edits — 图生图 / 局部重绘。使用 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="把背景换成星空"