Saltar al contenido principal
POST
/
midjourney
/
imagine
Midjourney Imagine
curl --request POST \
  --url https://api.acedata.cloud/midjourney/imagine \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "mask": "<string>",
  "mode": "fast",
  "action": "generate",
  "prompt": "A cat sitting on a table",
  "timeout": 480,
  "image_id": "<string>",
  "translation": false,
  "callback_url": "<string>",
  "async": true,
  "split_images": false,
  "version": "<string>",
  "hd": false,
  "quality": "1",
  "style_reference": false,
  "moodboard": false
}
'
import requests

url = "https://api.acedata.cloud/midjourney/imagine"

payload = {
"mask": "<string>",
"mode": "fast",
"action": "generate",
"prompt": "A cat sitting on a table",
"timeout": 480,
"image_id": "<string>",
"translation": False,
"callback_url": "<string>",
"async": True,
"split_images": False,
"version": "<string>",
"hd": False,
"quality": "1",
"style_reference": False,
"moodboard": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mask: '<string>',
mode: 'fast',
action: 'generate',
prompt: 'A cat sitting on a table',
timeout: 480,
image_id: '<string>',
translation: false,
callback_url: '<string>',
async: true,
split_images: false,
version: '<string>',
hd: false,
quality: '1',
style_reference: false,
moodboard: false
})
};

fetch('https://api.acedata.cloud/midjourney/imagine', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "actions": [
    "upscale1",
    "upscale2",
    "upscale3",
    "upscale4",
    "reroll",
    "variation1",
    "variation2",
    "variation3",
    "variation4"
  ],
  "success": true,
  "task_id": "27a1128f-14b5-440e-a82d-510c81e6fcd4",
  "image_id": "1211290228438868029",
  "progress": 100,
  "image_url": "https://cdn.acedata.cloud/8c5b69a6e0.png",
  "image_width": 1024,
  "image_height": 1024,
  "raw_image_url": "https://cdn.acedata.cloud/8c5b69a6e0.png",
  "raw_image_width": 2048,
  "raw_image_height": 2048
}
{
"error": {
"code": "bad_request",
"message": "The json payload is not valid to request the API"
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
"error": {
"code": "invalid_token",
"message": "The specified token is invalid or wrong."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
"error": {
"code": "forbidden",
"message": "Sorry! Our Al moderators feel your prompt might be against our community standards."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
"error": {
"code": "too_many_requests",
"message": "You have exceeded the rate limit."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
"error": {
"code": "api_error",
"message": "Internal server error."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
"error": {
"code": "timeout",
"message": "Timeout to generate the image."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}

Autorizaciones

Authorization
string
header
requerido

Encabezados

accept
enum<string>

Midjourney Imagine Param Accept

Opciones disponibles:
application/json,
application/x-ndjson

Cuerpo

application/json
mask
string

Midjourney Imagine Mask

mode
enum<string>
predeterminado:fast

Midjourney Imagine Mode

Opciones disponibles:
fast,
relax,
turbo
action
string
predeterminado:generate

Midjourney Imagine Action

prompt
string

Midjourney Imagine Prompt

Ejemplo:

"A cat sitting on a table"

timeout
number
predeterminado:480

Midjourney Imagine Timeout

image_id
string

Midjourney Imagine Image Id

translation
boolean
predeterminado:false

Midjourney Imagine Translation

callback_url
string

Midjourney Imagine Callback Url

async
boolean

Midjourney Imagine Async

split_images
boolean
predeterminado:false

Midjourney Imagine Split Images

version
string

Midjourney Imagine Version

hd
boolean
predeterminado:false

Midjourney Imagine Hd

quality
string
predeterminado:1

Midjourney Imagine Quality

style_reference
boolean
predeterminado:false

Midjourney Imagine Style Reference

moodboard
boolean
predeterminado:false

Midjourney Imagine Moodboard

Respuesta

Midjourney Imagine Response 200

actions
string[]

Midjourney Imagine Response 200 Actions

success
boolean

Midjourney Imagine Response 200 Success

task_id
string

Midjourney Imagine Response 200 Task Id

image_id
string

Midjourney Imagine Response 200 Image Id

progress
number

Midjourney Imagine Response 200 Progress

image_url
string

Midjourney Imagine Response 200 Image Url

image_width
string

Midjourney Imagine Response 200 Image Width

image_height
string

Midjourney Imagine Response 200 Image Height

raw_image_url
string

Midjourney Imagine Response 200 Raw Image Url

raw_image_width
string

Midjourney Imagine Response 200 Raw Image Width

raw_image_height
string

Midjourney Imagine Response 200 Raw Image Height