Passer au contenu principal
POST
/
mj
/
submit
/
imagine
Create a Midjourney imagine task
curl --request POST \
  --url https://api.cometapi.com/mj/submit/imagine \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "a paper boat floating on calm water at sunrise --v 6.1"
}
'
{
  "code": 1,
  "description": "Submission successful",
  "result": "1773314942177684",
  "properties": {
    "discordChannelId": "5e6ca8e1f40e4de6",
    "discordInstanceId": "5e6ca8e1f40e4de6"
  }
}

Documentation Index

Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt

Use this file to discover all available pages before exploring further.

Utilisez ce endpoint pour démarrer le workflow principal de Midjourney. Chaque étape ultérieure, y compris l’upscale, la variation et le zoom personnalisé, commence par une tâche imagine réussie.

Ce que la première réponse vous fournit

  • result est l’identifiant de tâche que vous interrogerez ensuite
  • code peut toujours être un code de succès même lorsqu’il ne correspond pas à un 200 de type HTTP

Workflow principal

1

Soumettre la tâche imagine

Envoyez le prompt et stockez l’identifiant de tâche renvoyé.
2

Interroger jusqu'à la fin de la tâche

Utilisez Fetch Single Task jusqu’à ce que la tâche atteigne SUCCESS, MODAL ou FAILURE.
3

Poursuivre avec le post-traitement

Lorsque des boutons apparaissent, utilisez Action pour l’upscale, la variation, le reroll, le zoom et d’autres opérations de suivi similaires.

Modèle facultatif de prompt vidéo

Si vous souhaitez ajouter du mouvement à partir d’une image source, ajoutez une URL d’image ainsi que des flags vidéo Midjourney dans le prompt, comme --video et --motion.

Autorisations

Authorization
string
header
requis

Bearer token authentication. Use your CometAPI key.

Corps

application/json
prompt
string
requis

Text prompt for the generation. Supports standard Midjourney parameters such as --v, --ar, --stylize, etc.

Exemple:

"a paper boat floating on calm water at sunrise --v 6.1"

botType
enum<string>
défaut:MID_JOURNEY

Bot type to use. MID_JOURNEY for Midjourney (default), NIJI_JOURNEY for Niji.

Options disponibles:
MID_JOURNEY,
NIJI_JOURNEY
accountFilter
object

Filter which Midjourney account modes may be used for this task.

base64Array
string[]

Base64-encoded reference images. Each item should be a data URI such as data:image/png;base64,xxx.

state
string

Custom state string. Returned as-is in the task result and webhook callback for your own tracking.

Réponse

200 - application/json

Task accepted.

code
integer
requis
description
string
requis
result
string
requis

Task id returned after submission.

properties
object