Skip to main content
POST
cURL
استخدم نقطة النهاية هذه لبدء سير العمل الأساسي في Midjourney. كل خطوة لاحقة، بما في ذلك الارتقاء بالدقة والتنوع والتكبير المخصص، تبدأ بمهمة imagine ناجحة.

ما الذي تمنحك إياه الاستجابة الأولى

  • result هو معرّف المهمة الذي ستقوم باستطلاعه بعد ذلك
  • يمكن أن يكون code رمز نجاح حتى عندما لا يكون 200 بأسلوب HTTP

سير العمل الأساسي

1

إرسال مهمة imagine

أرسل الـ Prompt وخزّن معرّف المهمة الذي يتم إرجاعه.
2

الاستطلاع حتى تنتهي المهمة

استخدم Fetch Single Task حتى تصل المهمة إلى SUCCESS أو MODAL أو FAILURE.
3

المتابعة بالمعالجة اللاحقة

عند ظهور الأزرار، استخدم Action لإجراءات مثل الارتقاء بالدقة والتنوع وإعادة التوليد والتكبير والعمليات المشابهة اللاحقة.

نمط Prompt اختياري للفيديو

إذا كنت تريد حركة من صورة مصدر، فأضف URL للصورة مع علامات فيديو Midjourney في الـ Prompt، مثل --video و --motion.

التفويضات

Authorization
string
header
مطلوب

Bearer token authentication. Use your CometAPI key.

الجسم

application/json
prompt
string
مطلوب

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

مثال:

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

botType
enum<string>
افتراضي:MID_JOURNEY

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

الخيارات المتاحة:
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.

الاستجابة

200 - application/json

Task accepted.

code
integer
مطلوب

Submission status code. 1 = submitted successfully (result carries the task id). 21 = the action opened a confirmation modal; continue with /mj/submit/modal using the returned task id. 4 = parameter error; description explains the cause.

description
string
مطلوب
result
string
مطلوب

Task id returned after submission.

properties
object