Integración con Midjourney / MJ
Utilice rutas de envío, recuperación, imágenes y ayuda de tareas compatibles con Midjourney cuando estén configuradas.
POST /mj/submit/imagine
Envía una tarea de imaginación Midjourney. El ejemplo utiliza el ejemplo de documentación del último modelo seleccionado mj_imagine e incluye todos los campos de la solicitud Midjourney DTO.
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
Envía una acción de mejora o variación contra una tarea MJ existente.
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 y rutas de envío relacionadas
Las rutas action, shorten, modal, simple-change, describe, blend, edits, video y upload-discord-images comparten el mismo formato de solicitud de Midjourney y definen action desde la ruta o el cuerpo.
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"
}'
| Método | Ruta | Estado |
|---|---|---|
| POST | /mj/submit/action | Planificado / sujeto al despliegue |
| POST | /mj/submit/shorten | Planificado / sujeto al despliegue |
| POST | /mj/submit/modal | Planificado / sujeto al despliegue |
| POST | /mj/submit/change | Planificado / sujeto al despliegue |
| POST | /mj/submit/simple-change | Planificado / sujeto al despliegue |
| POST | /mj/submit/describe | Planificado / sujeto al despliegue |
| POST | /mj/submit/blend | Planificado / sujeto al despliegue |
| POST | /mj/submit/edits | Planificado / sujeto al despliegue |
| POST | /mj/submit/video | Planificado / sujeto al despliegue |
| POST | /mj/submit/upload-discord-images | Planificado / sujeto al despliegue |
GET /mj/task/{id}/fetch
Recupera una única tarea MJ por ID de tarea para el usuario actual de la clave API.
curl https://www.token168.cc/mj/task/mj_task_123/fetch \
-H "Authorization: Bearer $TOKEN168_API_KEY"
POST /mj/task/list-by-condition
Enumera las tareas MJ por condición. Utilícelo para realizar encuestas o búsquedas al estilo de un panel cuando esté configurado el acceso del proveedor.
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 y GET /mj/image/{id}
Las rutas auxiliares de semilla de imagen y proxy de imagen están disponibles en el grupo de rutas MJ. Utilizan parámetros de ruta y la misma autorización de clave API.
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
| Método | Ruta | Estado |
|---|---|---|
| GET | /mj/task/{id}/image-seed | Planificado / sujeto al despliegue |
| GET | /mj/image/{id} | Planificado / sujeto al despliegue |
POST /mj/insight-face/swap
Envía una solicitud de ayuda de intercambio InsightFace a través del grupo de rutas MJ cuando la implementación habilita esa capacidad.
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"
}'