Midjourney 简化变体操作
curl --request POST \
--url https://kaienapi.com/mj/submit/simple-change \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "U1 task_xxx"
}
'import requests
url = "https://kaienapi.com/mj/submit/simple-change"
payload = { "content": "U1 task_xxx" }
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({content: 'U1 task_xxx'})
};
fetch('https://kaienapi.com/mj/submit/simple-change', 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://kaienapi.com/mj/submit/simple-change"
payload := strings.NewReader("{\n \"content\": \"U1 task_xxx\"\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))
}{}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}Midjourney 简化变体操作
用简化命令对已有任务做快捷操作。
请求格式
将操作内容写入 content,例如 U1 task_xxx。
使用条件
页面已经保存任务 ID,并按按钮语义触发放大或变体时,可使用该简化接口。需要明确传入操作类型和图片序号时,改用 /mj/submit/change。
POST
/
mj
/
submit
/
simple-change
Midjourney 简化变体操作
curl --request POST \
--url https://kaienapi.com/mj/submit/simple-change \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "U1 task_xxx"
}
'import requests
url = "https://kaienapi.com/mj/submit/simple-change"
payload = { "content": "U1 task_xxx" }
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({content: 'U1 task_xxx'})
};
fetch('https://kaienapi.com/mj/submit/simple-change', 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://kaienapi.com/mj/submit/simple-change"
payload := strings.NewReader("{\n \"content\": \"U1 task_xxx\"\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))
}{}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}Authorizations
在请求头中传入:Authorization: Bearer sk-...
Body
application/json
Midjourney 兼容请求。提交类接口返回任务 ID,随后用任务查询接口获取最终结果。
提示词。比例、风格、质量等 Midjourney 参数写入 prompt,例如 --ar 16:9。
Example:
"a cinematic robot portrait"
已有任务 ID。放大、变体、局部编辑、视频延展和查询任务时传入。
Example:
"task_xxx"
基于已有任务的操作类型,例如 UPSCALE、VARIATION、REROLL。
Example:
"UPSCALE"
自定义动作 ID。按返回按钮或动作标识继续提交时传入。
Example:
"MJ::JOB::upsample::1::abcd"
四宫格中的图片序号,一般为 1 到 4。
Example:
1
任务筛选状态。按条件查询任务列表时传入。
简化操作内容,例如 U1 task_xxx。
图片 base64 数组。describe、blend 和图片上传类接口会读取该字段。
局部编辑遮罩图 base64,用来标记需要重绘的区域。
回调地址。任务状态变化时可接收通知,是否生效以接口说明为准。
Response
成功响应
The response is of type object.