图生视频
curl --request POST \
--url https://api.ephone.ai/midjourney/video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image": "https://example.com/first-frame.png"
}
'import requests
url = "https://api.ephone.ai/midjourney/video"
payload = { "image": "https://example.com/first-frame.png" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({image: 'https://example.com/first-frame.png'})
};
fetch('https://api.ephone.ai/midjourney/video', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ephone.ai/midjourney/video"
payload := strings.NewReader("{\n \"image\": \"https://example.com/first-frame.png\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"task_id": "mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3",
"action": "video",
"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": "queue_full",
"message": "Queue is full, please try again later"
}
}{
"error": {
"code": "upstream_error",
"message": "The service is temporarily unavailable, please retry"
}
}Midjourney
图生视频
把一张图变成 5 秒视频,可选 480p / 720p、运动幅度和视频数量。
POST
/
midjourney
/
video
图生视频
curl --request POST \
--url https://api.ephone.ai/midjourney/video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image": "https://example.com/first-frame.png"
}
'import requests
url = "https://api.ephone.ai/midjourney/video"
payload = { "image": "https://example.com/first-frame.png" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({image: 'https://example.com/first-frame.png'})
};
fetch('https://api.ephone.ai/midjourney/video', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ephone.ai/midjourney/video"
payload := strings.NewReader("{\n \"image\": \"https://example.com/first-frame.png\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"task_id": "mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3",
"action": "video",
"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": "queue_full",
"message": "Queue is full, please try again later"
}
}{
"error": {
"code": "upstream_error",
"message": "The service is temporarily unavailable, please retry"
}
}也可以用统一任务接口
POST /v1/task/submit 提交:model 填 midjourney-video,参数放进 input。两种写法效果与计费完全一样。notify_hook 等推送。完成后结果里的 actions 列出还能接着做的加工,调 图像操作 继续。
这个接口用你自己的图做首帧。要用某个任务里的图做视频、或者延长视频,调 图像操作,action 填 video 或 video-extend。授权
在请求头 Authorization: Bearer YOUR_API_KEY 里带上 API Key。
请求体
application/json
首帧:图片 URL(公网可访问)或 base64 data URI,单张不超过 20 MB。
提示词:可选:描述画面怎么动。不写时自动按画面生成运动。
Maximum string length:
6000分辨率:480p(默认)或 720p(3.2 倍价格)。
可用选项:
480p, 720p 运动幅度:low 低运动(默认,适合静态场景)/ high 高运动(大幅镜头运动)。
可用选项:
low, high 视频数量:一次生成几个视频:1(默认)、2 或 4,价格按数量计。
可用选项:
1, 2, 4 尾帧:可选:视频最后一帧的图。图片 URL(公网可访问)或 base64 data URI,单张不超过 20 MB。
循环:生成首尾相同的循环视频,不能和尾帧同时用。
速度:视频只支持快速(fast)与极速(turbo)。也可以在提示词里写 --fast / --turbo,请求参数优先。
可用选项:
fast, turbo 推送地址:任务结束后,把和查询结果相同的内容 POST 到这个地址(公网可以访问的 http / https 地址)。不传就自己查询。
此页面对您有帮助吗?