Intégration Midjourney / MJ
Utilisez les itinéraires de soumission, de récupération, d'image et d'assistance aux tâches compatibles Midjourney lorsqu'ils sont configurés.
POST /mj/submit/imagine
Soumet une tâche d'imagination Midjourney. L'exemple utilise l'exemple de documentation du dernier modèle sélectionné mj_imagine et inclut tous les champs de la demande 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
Soumet une action de mise à l'échelle ou de variation sur une tâche MJ existante.
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 et routes d’envoi associées
Les itinéraires d'action, de raccourcissement, de modalité, de changement simple, de description, de fusion, de modification, de vidéo et de téléchargement d'images discordantes partagent la même enveloppe de requête Midjourney et définissent l'action à partir du chemin ou du corps.
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éthode | Route | Statut |
|---|---|---|
| POST | /mj/submit/action | Planifié/déploiement bloqué |
| POST | /mj/submit/shorten | Planifié/déploiement bloqué |
| POST | /mj/submit/modal | Planifié/déploiement bloqué |
| POST | /mj/submit/change | Planifié/déploiement bloqué |
| POST | /mj/submit/simple-change | Planifié/déploiement bloqué |
| POST | /mj/submit/describe | Planifié/déploiement bloqué |
| POST | /mj/submit/blend | Planifié/déploiement bloqué |
| POST | /mj/submit/edits | Planifié/déploiement bloqué |
| POST | /mj/submit/video | Planifié/déploiement bloqué |
| POST | /mj/submit/upload-discord-images | Planifié/déploiement bloqué |
GET /mj/task/{id}/fetch
Récupère une tâche MJ par ID de tâche pour l’utilisateur actuel de la clé API.
curl https://www.token168.cc/mj/task/mj_task_123/fetch \
-H "Authorization: Bearer $TOKEN168_API_KEY"
POST /mj/task/list-by-condition
Répertorie les tâches MJ par condition. Utilisez-le pour une interrogation de type tableau de bord ou une recherche lorsque l'accès du fournisseur est configuré.
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 et GET /mj/image/{id}
Les routes de départ d'image et d'assistance de proxy d'image sont disponibles dans le groupe de routes MJ. Ils utilisent des paramètres de chemin et la même autorisation de clé 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éthode | Route | Statut |
|---|---|---|
| GET | /mj/task/{id}/image-seed | Planifié/déploiement bloqué |
| GET | /mj/image/{id} | Planifié/déploiement bloqué |
POST /mj/insight-face/swap
Soumet une demande d'assistance d'échange InsightFace via le groupe de routage MJ lorsque le déploiement active cette fonctionnalité.
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"
}'