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