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="把背景换成星空"