图像
图像生成能力,支持文生图、图生图及多种尺寸。创建任务时 model 传模型名称(与模型列表 name 一致),提交后通过任务查询获取结果链接。
图像模型
| 模型名称 | 介绍 |
|---|---|
BytePlus-Seedream-5.0-lite | 文生图,支持 size、n 等参数 |
MiniMax-Image-01 | 图像生成,支持文生图、图生图(image_url/image_urls/imageBase64) |
1.1 文生图(BytePlus-Seedream 示例)
向 /v1/images/generations 发送 POST,model 填模型名称(如 BytePlus-Seedream-5.0-lite),返回 task_id,再通过 GET /v1/tasks/:id 轮询获取 resultUrl。
curl -X POST "https://testing.amags.keplerjai.com/v1/images/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "BytePlus-Seedream-5.0-lite",
"prompt": "一只可爱的猫咪在阳光下睡觉",
"size": "1024x1024",
"n": 1
}'成功响应:{"resultCode":"OK","resultMsg":"","task_id":67}。
1.2 图生图(带参考图 URL,MiniMax-Image 示例)
传入 image_url(单张)或 image_urls(多张)作为参考图,或使用 imageBase64 / imageBase64List 传 Base64。
curl -X POST "https://testing.amags.keplerjai.com/v1/images/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MiniMax-Image-01",
"prompt": "将这张图改为水彩风格",
"image_url": "https://example.com/your-reference.jpg"
}'参数速查(POST /v1/images/generations)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 模型名称(与模型列表 name 一致) |
prompt | string | 是 | 提示词 |
size | string | 否 | 如 1024x1024 |
n | int | 否 | 生成张数,默认 1 |
image_url | string | 否 | 图生图单张参考图 URL |
image_urls | string[] | 否 | 图生图多张参考图 URL |
imageBase64 | string | 否 | 单张参考图 Base64 或 data URL |
imageBase64List | string[] | 否 | 多张参考图 Base64 |
callbackUrl | string | 否 | 任务完成后回调地址 |
callbackSecret | string | 否 | 回调请求头 X-Callback-Secret |
任务查询
GET /v1/tasks/:id,路径参数 id 为创建任务返回的 task_id。当 task.status 为 succeeded 时,task.resultUrl 即为图片可访问 URL。详见概览 · 任务查询与取消。
Note
可在「模型测试」页选择图片生成、填写 API Key 与提示词进行体验。