curl --request POST \
--url https://api.ephone.ai/midjourney/action \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "upscale",
"task_id": "mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3",
"index": 2
}
'{
"task_id": "mj-7a2d3c1f0b9e4d8a8c6b5a4f3e2d1c0b",
"action": "upscale",
"status": "submitted",
"created_at": 1792000000
}{
"error": {
"code": "invalid_request",
"message": "index must be between 1 and 4"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient balance"
}
}{
"error": {
"code": "task_not_found",
"message": "Task not found"
}
}{
"error": {
"code": "task_not_finished",
"message": "The task has not succeeded yet"
}
}{
"error": {
"code": "queue_full",
"message": "Queue is full, please try again later"
}
}{
"error": {
"code": "upstream_error",
"message": "The service is temporarily unavailable, please retry"
}
}Midjourney
图像操作
对已有任务里的图继续加工:放大、变化、重塑、重跑、扩图、平移、局部重绘、增强、做视频、延长视频。
POST
/
midjourney
/
action
curl --request POST \
--url https://api.ephone.ai/midjourney/action \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "upscale",
"task_id": "mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3",
"index": 2
}
'{
"task_id": "mj-7a2d3c1f0b9e4d8a8c6b5a4f3e2d1c0b",
"action": "upscale",
"status": "submitted",
"created_at": 1792000000
}{
"error": {
"code": "invalid_request",
"message": "index must be between 1 and 4"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient balance"
}
}{
"error": {
"code": "task_not_found",
"message": "Task not found"
}
}{
"error": {
"code": "task_not_finished",
"message": "The task has not succeeded yet"
}
}{
"error": {
"code": "queue_full",
"message": "Queue is full, please try again later"
}
}{
"error": {
"code": "upstream_error",
"message": "The service is temporarily unavailable, please retry"
}
}action | 能做什么 |
|---|---|
upscale | 把一组图里的某一张放大到 2 倍分辨率,可选细微或创意两种风格。 |
variation | 以一张图为基础生成四张变体,可选强烈或细微。 |
remix | 用新的提示词重塑一张图,保留原图的结构。 |
reroll | 用同一个提示词重新生成整组图,也可以改提示词再跑。 |
zoom | 把一张图向外扩展,补出画面四周的内容。 |
pan | 把一张图朝一个方向延展。 |
inpaint | 只重画一张图里的指定区域。 |
enhance | 从草图里挑一张,按完整质量重新生成。 |
video | 把一张图变成 5 秒视频,可选 480p / 720p、运动幅度和视频数量。 |
video-extend | 把一段视频再延长 4 秒,最多延长到 21 秒。 |
actions,可以一直接下去。actions 里没有的操作会返回 unsupported_action。
也可以用统一任务接口
POST /v1/task/submit 提交:model 填 midjourney-upscale,参数放进 input,不用传 action。两种写法效果与计费完全一样。授权
在请求头 Authorization: Bearer YOUR_API_KEY 里带上 API Key。
请求体
application/json
- upscale · 放大
- variation · 变化
- remix · 重塑
- reroll · 重跑
- zoom · 扩图
- pan · 平移
- inpaint · 局部重绘
- enhance · 增强
- video · 做视频
- video-extend · 延长视频
固定填 upscale。
可用选项:
upscale 任务 ID:要继续加工的任务(提交时返回的 task_id),必须是已成功的任务。
图片序号:选第几张图,从 1 开始(四宫格是 1–4,V8 草图最多 24 张)。父任务只有一张图时可以不传。
必填范围:
1 <= x <= 24放大方式:subtle 细微(默认)/ creative 创意。
可用选项:
subtle, creative 速度:慢速(relax)价格最低、排队较久;极速(turbo)最快、2 倍价格。也可以在提示词里写 --relax / --fast / --turbo,请求参数优先;都不写为快速。
可用选项:
relax, fast, turbo 推送地址:任务结束后,把和查询结果相同的内容 POST 到这个地址(公网可以访问的 http / https 地址)。不传就自己查询。
此页面对您有帮助吗?