Midjourney 换脸
curl --request POST \
--url https://kaienapi.com/mj/insight-face/swap \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceBase64": "data:image/png;base64,...",
"targetBase64": "data:image/png;base64,..."
}
'import requests
url = "https://kaienapi.com/mj/insight-face/swap"
payload = {
"sourceBase64": "data:image/png;base64,...",
"targetBase64": "data:image/png;base64,..."
}
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({
sourceBase64: 'data:image/png;base64,...',
targetBase64: 'data:image/png;base64,...'
})
};
fetch('https://kaienapi.com/mj/insight-face/swap', 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/insight-face/swap"
payload := strings.NewReader("{\n \"sourceBase64\": \"data:image/png;base64,...\",\n \"targetBase64\": \"data:image/png;base64,...\"\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 换脸
提交换脸请求。
请求格式
传入源人脸图片 sourceBase64 和目标图片 targetBase64。两张图片使用清晰、无遮挡的人脸素材。
使用注意
确认图片内容、授权范围和发布规则。对外展示前增加人工审核或人工确认。
读取结果
返回结果按接口结构提取。长期保存时,把结果图片保存到对象存储。
POST
/
mj
/
insight-face
/
swap
Midjourney 换脸
curl --request POST \
--url https://kaienapi.com/mj/insight-face/swap \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceBase64": "data:image/png;base64,...",
"targetBase64": "data:image/png;base64,..."
}
'import requests
url = "https://kaienapi.com/mj/insight-face/swap"
payload = {
"sourceBase64": "data:image/png;base64,...",
"targetBase64": "data:image/png;base64,..."
}
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({
sourceBase64: 'data:image/png;base64,...',
targetBase64: 'data:image/png;base64,...'
})
};
fetch('https://kaienapi.com/mj/insight-face/swap', 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/insight-face/swap"
payload := strings.NewReader("{\n \"sourceBase64\": \"data:image/png;base64,...\",\n \"targetBase64\": \"data:image/png;base64,...\"\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>"
}
}⌘I