Midjourney / MJ-Integration

Geplant

Verwenden Sie konfigurierte Midjourney-compatible-Routen zum Senden, Abrufen sowie für Bild- und Aufgabenhilfen.

POST /mj/submit/imagine

Sendet eine Midjourney-Imagine-Aufgabe. Das Beispiel verwendet das ausgewählte aktuelle Dokumentationsbeispiel mj_imagine und enthält alle Felder des Midjourney-Anfrage-DTO.

MJ-Imagine-Anfrage
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

Sendet eine Upscale- oder Variationsaktion für eine vorhandene MJ-Aufgabe.

MJ-Änderung
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 und zugehörige Senderouten

Die Routen action, shorten, modal, simple-change, describe, blend, edits, video und upload-discord-images verwenden denselben Midjourney-Anfrageumschlag und beziehen die Aktion aus Pfad oder Anfragekörper.

Beispiele für MJ-Senderouten
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"
  }'
MethodePfadBetriebsstatus
POST/mj/submit/actionGeplant / durch Bereitstellung gesperrt
POST/mj/submit/shortenGeplant / durch Bereitstellung gesperrt
POST/mj/submit/modalGeplant / durch Bereitstellung gesperrt
POST/mj/submit/changeGeplant / durch Bereitstellung gesperrt
POST/mj/submit/simple-changeGeplant / durch Bereitstellung gesperrt
POST/mj/submit/describeGeplant / durch Bereitstellung gesperrt
POST/mj/submit/blendGeplant / durch Bereitstellung gesperrt
POST/mj/submit/editsGeplant / durch Bereitstellung gesperrt
POST/mj/submit/videoGeplant / durch Bereitstellung gesperrt
POST/mj/submit/upload-discord-imagesGeplant / durch Bereitstellung gesperrt

GET /mj/task/{id}/fetch

Ruft eine einzelne MJ-Aufgabe anhand ihrer Aufgaben-ID für den aktuellen API-Key-Benutzer ab.

MJ-Aufgabe abrufen
curl https://www.token168.cc/mj/task/mj_task_123/fetch \
  -H "Authorization: Bearer $TOKEN168_API_KEY"

POST /mj/task/list-by-condition

Listet MJ-Aufgaben nach Bedingung auf. Nutzen Sie dies für Dashboard-Polling oder Suche, wenn der Providerzugriff konfiguriert ist.

MJ-Liste nach Bedingung
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 und GET /mj/image/{id}

Hilfsrouten für Image Seed und Bild-Proxy stehen in der MJ-Routengruppe zur Verfügung. Sie verwenden Pfadparameter und dieselbe API-Key-Autorisierung.

MJ-Bildhilfen
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
MethodePfadBetriebsstatus
GET/mj/task/{id}/image-seedGeplant / durch Bereitstellung gesperrt
GET/mj/image/{id}Geplant / durch Bereitstellung gesperrt

POST /mj/insight-face/swap

Sendet über die MJ-Routengruppe eine InsightFace-Swap-Hilfsanfrage, wenn die Bereitstellung diese Funktion aktiviert.

MJ-InsightFace-Tausch
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"
  }'