Midjourney / MJ 接口
计划中
在已配置的情况下,使用兼容 Midjourney 的提交、获取、图片和任务辅助路由。
POST /mj/submit/imagine
提交 Midjourney imagine 任务。示例使用所选的最新模型文档示例 mj_imagine,并包含 Midjourney 请求 DTO 的全部字段。
MJ imagine 生成
curl https://www.token168.cc/mj/submit/imagine \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"prompt": "A clean product render --v 8 --ar 16:9",
"customId": "",
"botType": "MID_JOURNEY",
"notifyHook": "",
"action": "IMAGINE",
"index": 1,
"state": "client-trace-123",
"taskId": "",
"base64Array": [],
"content": "",
"maskBase64": ""
}'
POST /mj/submit/change
针对已有 MJ 任务提交放大或变体操作。
MJ 变更
curl https://www.token168.cc/mj/submit/change \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"taskId": "mj_task_123",
"action": "UPSCALE",
"index": 1,
"customId": "MJ::JOB::upsample::1",
"state": "client-trace-123",
"content": ""
}'
POST /mj/submit/action 及相关提交路由
Action、shorten、modal、simple-change、describe、blend、edits、video 和 upload-discord-images 路由共用同一 Midjourney 请求结构,并从路径或请求体设置 action。
MJ 提交路由示例
curl https://www.token168.cc/mj/submit/action \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"taskId": "mj_task_123",
"action": "VARIATION",
"index": 1,
"customId": "MJ::JOB::variation::1",
"state": "client-trace-123",
"content": ""
}'
curl https://www.token168.cc/mj/submit/shorten \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"prompt": "A long Midjourney prompt to shorten --v 8",
"state": "client-trace-123",
"botType": "MID_JOURNEY"
}'
curl https://www.token168.cc/mj/submit/modal \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"taskId": "mj_task_123",
"customId": "MJ::JOB::modal",
"prompt": "Adjust the modal prompt",
"maskBase64": "",
"state": "client-trace-123"
}'
curl https://www.token168.cc/mj/submit/simple-change \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"taskId": "mj_task_123",
"action": "UPSCALE",
"index": 2,
"state": "client-trace-123"
}'
curl https://www.token168.cc/mj/submit/describe \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"base64Array": ["data:image/png;base64,..."],
"state": "client-trace-123",
"botType": "MID_JOURNEY"
}'
curl https://www.token168.cc/mj/submit/blend \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"base64Array": ["data:image/png;base64,...", "data:image/png;base64,..."],
"dimensions": "SQUARE",
"state": "client-trace-123",
"botType": "MID_JOURNEY"
}'
curl https://www.token168.cc/mj/submit/edits \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"prompt": "Replace the background with a clean studio wall",
"taskId": "mj_task_123",
"maskBase64": "data:image/png;base64,...",
"state": "client-trace-123",
"botType": "MID_JOURNEY"
}'
curl https://www.token168.cc/mj/submit/video \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"taskId": "mj_task_123",
"prompt": "Animate this frame with a slow camera move",
"image": "https://example.com/frame.png",
"state": "client-trace-123",
"botType": "MID_JOURNEY"
}'
curl https://www.token168.cc/mj/submit/upload-discord-images \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"base64Array": ["data:image/png;base64,..."],
"state": "client-trace-123",
"botType": "MID_JOURNEY"
}'
| 方法 | 路径 | 状态 |
|---|---|---|
| POST | /mj/submit/action | 计划中 / 受部署配置限制 |
| POST | /mj/submit/shorten | 计划中 / 受部署配置限制 |
| POST | /mj/submit/modal | 计划中 / 受部署配置限制 |
| POST | /mj/submit/change | 计划中 / 受部署配置限制 |
| POST | /mj/submit/simple-change | 计划中 / 受部署配置限制 |
| POST | /mj/submit/describe | 计划中 / 受部署配置限制 |
| POST | /mj/submit/blend | 计划中 / 受部署配置限制 |
| POST | /mj/submit/edits | 计划中 / 受部署配置限制 |
| POST | /mj/submit/video | 计划中 / 受部署配置限制 |
| POST | /mj/submit/upload-discord-images | 计划中 / 受部署配置限制 |
GET /mj/task/{id}/fetch
按任务 ID 获取当前 API Key 用户的一条 MJ 任务。
MJ 获取
curl https://www.token168.cc/mj/task/mj_task_123/fetch \
-H "Authorization: Bearer $TOKEN168_API_KEY"
POST /mj/task/list-by-condition
按条件列出 MJ 任务。当供应商访问已配置时,可用于控制台式轮询或搜索。
按条件列出 MJ 任务
curl https://www.token168.cc/mj/task/list-by-condition \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"mj_id": "mj_task_123",
"action": "IMAGINE",
"status": "SUCCESS"
}'
GET /mj/task/{id}/image-seed 和 GET /mj/image/{id}
MJ 路由组提供图片 seed 和图片代理辅助路由。它们使用路径参数和同一套 API Key 认证。
MJ 图片辅助接口
curl https://www.token168.cc/mj/task/mj_task_123/image-seed \
-H "Authorization: Bearer $TOKEN168_API_KEY"
curl https://www.token168.cc/mj/image/image_123 \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
--output mj-image.png
| 方法 | 路径 | 状态 |
|---|---|---|
| GET | /mj/task/{id}/image-seed | 计划中 / 受部署配置限制 |
| GET | /mj/image/{id} | 计划中 / 受部署配置限制 |
POST /mj/insight-face/swap
当部署启用相应能力时,通过 MJ 路由组提交 InsightFace 换脸辅助请求。
MJ InsightFace 换脸
curl https://www.token168.cc/mj/insight-face/swap \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"sourceBase64": "data:image/png;base64,...",
"targetBase64": "data:image/png;base64,...",
"state": "client-trace-123"
}'