Skip to main content
POST
cURL
使用此端点可以通过蒙版编辑 Midjourney 图像,或者基于 prompt 和源图像生成透明背景结果。

两种常见模式

  • 蒙版编辑:发送 maskBase64prompt,也可选择附带原始 image
  • 透明绘制:当你希望在不提供单独蒙版的情况下获得透明背景结果时,发送 imageprompt

任务流程

1

提交编辑任务

选择编辑模式,发送 prompt 和源数据,然后保存返回的任务 id。
2

轮询任务

使用 获取单个任务 直到任务进入终态。
3

基于结果继续操作

直接使用最终资源,或者当编辑结果提供后续操作按钮时触发 Action

授权

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

请求体

application/json
prompt
string
默认值:Change to white background
必填

Text prompt describing the desired edit.

image
string
默认值:https://your-image-host/source.png
必填

Image to edit. Pass a public URL or a base64-encoded data URI.

state
string

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

notifyHook
string

Webhook URL to receive task status updates. Falls back to your account-level webhook if omitted.

noStorage
boolean

When true, return the original provider image URL instead of a CometAPI-proxied link.

响应

200 - application/json

Success

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