TTAPI 中文文档
  • TTAPI 中文文档
  • API能力
    • 🔥Midjourney API
    • Flux API
    • Recraft API
    • 📖LLM API
    • 🔀Midjourney Hold Account
    • 🟢OpenAI Image Models
    • 🔵Luma
    • 🎵Suno
    • 🔗账户体系
    • ⭕状态码详解
  • 企业服务
    • Midjourney离线服务
  • 问答专区
    • Midjourney
      • 常见问题解答
      • 账户托管
      • 科学使用你的Midjourney账户
    • Luma
    • 使用相关
    • 其他杂项
  • 升级日志
Powered by GitBook
On this page
  • 速度模式
  • 使用模式
  • 生成图像[/imagine]
  • 图像变化[U1~U4、V1~V4]
  • 获取图像种子[--seed]
  • 图像合成[/blend]
  • 图像描述词[/describe]
  • 区域重绘[Vary(region)]
  • 获取任务状态 - fetch
  • Prompt效验 - Prompt Checker
  • Midjourney服务状态查询
  • Action 具体使用操作
  • 异步回调 JSON 结构
  • 返回JSON结构详解

Was this helpful?

  1. API能力

Midjourney API

Midjourney相关API,支持目前最新v7版本。TTAPI 的 Midjourney API 是目前最稳定、最具成本效益的 Midjourney 产品。

PreviousTTAPI 中文文档NextFlux API

Last updated 3 days ago

Was this helpful?

速度模式

TT API 的 Midjourney 服务提供 relax、fast 和 turbo 三种模式的图像生成,与 Midjourney 对应。

  • fast 模式响应一般在 60秒内

  • relax 模式响应一般在 120秒内

  • turbo 模式响应一般在 30秒内

最多可以 同时执行 10 个生成队列,如需更多作业队列请

使用模式

TTAPI支持两种账户使用模式,满足不同用户、不同场景以及不同体量的使用需求。

  • PPU 模式(Pay for per use)按量付费,即使用TTAPI账户池中账户执行 Midjourney 任务,无需关注于账户的相关问题。

  • 账户托管模式,将你的账户托管在TTAPI平台上执行Midjourney任务。具体区别详见

生成图像[/imagine]

  • --cref 操作必须配合 --v 6.0 模型使用

  • 托管模式的host与PPU模式不相同

  • v7版本当前只支持turbo与relax模式

POST https://api.ttapi.io/midjourney/v1/imagine

Imagine 接口将根据文案生成4张图像。

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

prompt

string

是

用以生成图像的提示词

例:a cat --ar 1:1

hookUrl

string

否

mode

string

否

timeout

int

否

任务执行超时时间,单位:秒,范围 300 - 1200。 fast与turbo模式下默认与最小值为300 relax模式下默认与最小值为600。

getUImages

boolean

否

translation

boolean

否

是否翻译 true-翻译 false-不翻译 默认true

请求示例

import requests

endpoint = "https://api.ttapi.io/midjourney/v1/imagine"

headers = {
    "TT-API-KEY": your_key
}

data = {
    "prompt": "a cute cat",
    "mode": "fast",
    "hookUrl": "",
    "timeout": 300
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
<?php

$url = 'https://api.ttapi.io/midjourney/v1/imagine';

$data = array(
    'prompt' => 'a cat --ar 1:1',
    'model' => 'fast',
    'hookUrl' => '',
    'timeout' => 300
);

$ch = curl_init($url);

$dataString = json_encode($data);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'TT-API-KEY: your_key'
));

$result = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo $httpCode;
const axios = require('axios');

let config = {
  method: 'post',
  url: 'https://api.ttapi.io/midjourney/v1/imagine',
  headers: { 
    'TT-API-KEY': 'your_key'
  },
  data : {
    "prompt": "a cute cat",
    "model": "fast",
    "hookUrl": "",
    "timeout": 300
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.status));
})
.catch(function (error) {
  console.log(error);
});

响应示例

{
  "status": "SUCCESS",
  "message": "",
  "data": {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4"
  }
}
{
  "status": "FAILED",
  "message": "'action' parameter error!",
  "data": null
}

图像变化[U1~U4、V1~V4]

POST https://api.ttapi.io/midjourney/v1/action

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

jobId

string

是

上一步请求返回的jobId

action

string

否

您的具体操作

例如:

upsample1 = U1

variation1 = V1

timeout

int

否

请求超时时间,单位:秒。如果未填写,默认超时时间 300秒

hookUrl

string

否

getUImages

boolean

否

请求示例

import requests

endpoint = "https://api.ttapi.io/midjourney/v1/action"

headers = {
    "TT-API-KEY": your_key
}

data = {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4",
    "action": "upsample1",
    "hookUrl": ""
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
<?php

$url = 'https://api.ttapi.io/midjourney/v1/action';

$data = array(
    'jobId' => 'afa774a3-1aee-5aba-4510-14818d6875e4',
    'action' => 'upsample1',
    'hookUrl' => ''
);

$ch = curl_init($url);

$dataString = json_encode($data);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'TT-API-KEY: your_key'
);

$result = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo $httpCode;
const axios = require('axios');

let config = {
  method: 'post',
  url: 'https://api.ttapi.io/midjourney/v1/action',
  headers: { 
    'TT-API-KEY': 'your_key'
  },
  data : {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4",
    "action": "upsample1",
    "hookUrl": ""
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.status));
})
.catch(function (error) {
  console.log(error);
});

响应示例

{
  "status": "SUCCESS",
  "message": "",
  "data": {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4"
  }
}
{
  "status": "FAILED",
  "message": "'action' parameter error!",
  "data": null
}

获取图像种子[--seed]

POST https://api.ttapi.io/midjourney/v1/seed

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

jobId

string

是

上一步请求返回的jobId

timeout

int

否

请求超时时间,单位:秒。如果未填写,默认超时时间 300秒

hookUrl

string

否

请求示例

import requests

endpoint = "https://api.ttapi.io/midjourney/v1/seed"

headers = {
    "TT-API-KEY": your_key
}

data = {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4",
    "hookUrl": ""
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
<?php

$url = 'https://api.ttapi.io/midjourney/v1/seed';

$data = array(
    'jobId' => 'afa774a3-1aee-5aba-4510-14818d6875e4',
    'hookUrl' => ''
);

$ch = curl_init($url);

$dataString = json_encode($data);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'TT-API-KEY: your_key'
);

$result = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo $httpCode;
const axios = require('axios');

let config = {
  method: 'post',
  url: 'https://api.ttapi.io/midjourney/v1/seed',
  headers: { 
    'TT-API-KEY': 'your_key'
  },
  data : {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4",
    "hookUrl": ""
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.status));
})
.catch(function (error) {
  console.log(error);
});

响应示例

{
  "status": "SUCCESS",
  "message": "",
  "data": {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4"
  }
}

图像合成[/blend]

POST https://api.ttapi.io/midjourney/v1/blend

上传2-5个图像,然后根据每个图像的概念和美学,将它们合并为一个新图像。

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

imgBase64Array

Array

是

将要生成混图的图片Base64数组

数组长度为 2-5

例:[

"data:image/png;base64,xxx1", "data:image/png;base64,xxx2"

]

dimensions

string

否

生成图像的比例,包括PORTRAIT

、SQUARE、LANDSCAPE。如果未填写,默认使用SQUARE。

PORTRAIT 对应比例 2:3

SQUARE 对应比例 1:1

LANDSCAPE 对应比例 3:2

mode

string

否

hookUrl

string

否

任务完成或失败将通过请地址进行通知。如果未设置,则需要请求fetch 接口进行查询。

timeout

int

否

请求超时时间,单位:秒。如果未填写,默认超时时间 300秒

getUImages

boolean

否

请求示例

import requests

endpoint = "https://api.ttapi.io/midjourney/v1/blend"

headers = {
    "TT-API-KEY": your_key
}

data = {
    "imgBase64Array": ["data:image/png;base64,xxx1","data:image/png;base64,xxx2"],
    "dimensions": "SQUARE",
    "model": "fast",
    "hookUrl": ""
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
<?php

$url = 'https://api.ttapi.io/midjourney/v1/blend';

$data = array(
    "imgBase64Array" => ["data:image/png;base64,xxx1","data:image/png;base64,xxx2"],
    "dimensions" => "SQUARE",
    "model" => "fast",
    "hookUrl" => ""
);

$ch = curl_init($url);

$dataString = json_encode($data);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'TT-API-KEY: your_key'
);

$result = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo $httpCode;
const axios = require('axios');

let config = {
  method: 'post',
  url: 'https://api.ttapi.io/midjourney/v1/blend',
  headers: { 
    'TT-API-KEY': 'your_key'
  },
  data : {
    "imgBase64Array": ["data:image/png;base64,xxx1","data:image/png;base64,xxx2"],
    "dimensions": "SQUARE",
    "model": "fast",
    "hookUrl": ""
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.status));
})
.catch(function (error) {
  console.log(error);
});

响应示例

{
  "status": "SUCCESS",
  "message": "",
  "data": {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4"
  }
}

图像描述词[/describe]

POST https://api.ttapi.io/midjourney/v1/describe

上传图像,并根据该图像生成四个提示信息。

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

base64

string

否

图像的base64编码

字符串"data:image/png;base64,"+ 图片base64值

例:"data:image/png;base64,xxx1"

url

string

否

图片url地址 url参数与base64参数至少存在一个值不为空,若两个字段同时传值,默认取base64字段

mode

string

否

hookUrl

string

否

任务完成或失败将通过请地址进行通知。如果未设置,则需要请求fetch 接口进行查询。

timeout

int

否

请求超时时间,单位:秒。如果未填写,默认超时时间 300秒

请求示例

import requests

endpoint = "https://api.ttapi.io/midjourney/v1/describe"

headers = {
    "TT-API-KEY": your_key
}

data = {
    "base64": "data:image/png;base64,xxx1",
    "model": "fast",
    "hookUrl": ""
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
<?php

$url = 'https://api.ttapi.io/midjourney/v1/describe';

$data = array(
    "base64" => "data:image/png;base64,xxx1",
    "model" => "fast",
    "hookUrl" => ""
);

$ch = curl_init($url);

$dataString = json_encode($data);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'TT-API-KEY: your_key'
);

$result = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo $httpCode;
const axios = require('axios');

let config = {
  method: 'post',
  url: 'https://api.ttapi.io/midjourney/v1/describe',
  headers: { 
    'TT-API-KEY': 'your_key'
  },
  data : {
    "base64": "data:image/png;base64,xxx1",
    "model": "fast",
    "hookUrl": ""
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.status));
})
.catch(function (error) {
  console.log(error);
});

响应示例

{
  "status": "SUCCESS",
  "message": "",
  "data": {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4"
  }
}

区域重绘[Vary(region)]

POST https://api.ttapi.io/midjourney/v1/inpaint

区域重绘,等同midjourney的Vary(region)按钮

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

jobId

string

是

上一步请求返回的jobId

mask

string

是

所选择图片的Base64值 提交的base64内容 是一张跟原图尺寸一样的黑白通道的蒙版(就是图中只包括黑色与白色) 其中白色部分是重绘圈出来的部分 其余部分是黑色 该base64值无需 “data:image/png;base64,”前缀

prompt

string

否

对所选择图片区域想要修改的描述

timeout

int

否

请求超时时间,单位:秒。如果未填写,默认超时时间 300秒

hookUrl

string

否

请求示例

import requests

endpoint = "https://api.ttapi.io/midjourney/v1/inpaint"

headers = {
    "TT-API-KEY": your_key
}

data = {
   "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4",
    "prompt": "white background",
    "mask": "UklGRrw0AABXRUJQVlA4WAoAAAAgAAAA..."
    "hookUrl": ""
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
<?php

$url = 'https://api.ttapi.io/midjourney/v1/inpaint';

$data = array(
    "jobId" => "afa774a3-1aee-5aba-4510-14818d6875e4",
    "prompt" => "white background",
    "mask"   => "UklGRrw0AABXRUJQVlA4WAoAAAAgAAAA..."
    "hookUrl" => ""
);

$ch = curl_init($url);

$dataString = json_encode($data);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'TT-API-KEY: your_key'
);

$result = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo $httpCode;
const axios = require('axios');

let config = {
  method: 'post',
  url: 'https://api.ttapi.io/midjourney/v1/inpaint',
  headers: { 
    'TT-API-KEY': 'your_key'
  },
  data : {
    "jobId" => "afa774a3-1aee-5aba-4510-14818d6875e4",
    "prompt" => "white background",
    "mask"   => "UklGRrw0AABXRUJQVlA4WAoAAAAgAAAA..."
    "hookUrl" => ""
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.status));
})
.catch(function (error) {
  console.log(error);
});

响应示例

{
  "status": "SUCCESS",
  "message": "",
  "data": {
    "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4"
  }
}
{
  "status": "FAILED",
  "message": "'action' parameter error!",
  "data": {}
}

获取任务状态 - fetch

POST https://api.ttapi.io/midjourney/v1/fetch

查询任务结果,该接口不消耗quota,免费使用

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

jobId

string

是

上一步请求返回的jobId

请求示例

import requests

endpoint = "https://api.ttapi.io/midjourney/v1/fetch"

headers = {
    "TT-API-KEY": your_key
}

data = {
   "jobId": "afa774a3-1aee-5aba-4510-14818d6875e4"
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
<?php

$url = 'https://api.ttapi.io/midjourney/v1/fetch';

$data = array(
    "jobId" => "afa774a3-1aee-5aba-4510-14818d6875e4"
);

$ch = curl_init($url);

$dataString = json_encode($data);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'TT-API-KEY: your_key'
);

$result = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo $httpCode;
const axios = require('axios');

let config = {
  method: 'post',
  url: 'https://api.ttapi.io/midjourney/v1/fetch',
  headers: { 
    'TT-API-KEY': 'your_key'
  },
  data : {
    "jobId" => "afa774a3-1aee-5aba-4510-14818d6875e4"
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.status));
})
.catch(function (error) {
  console.log(error);
});

响应示例

Prompt效验 - Prompt Checker

POST https://api.ttapi.io/midjourney/v1/promptCheck

效验imagine接口中的prompt,该接口不消耗quota,免费使用

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

Body

参数
类型
是否必须
描述

prompt

string

是

prompt文案,注意:该效验目前只对英文文案有效

请求示例

import requests

endpoint = "https://api.ttapi.io/midjourney/v1/promptCheck"

headers = {
    "TT-API-KEY": your_key
}

data = {
   "prompt": "a sexy girl"
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
<?php

$url = 'https://api.ttapi.io/midjourney/v1/promptCheck';

$data = array(
     "prompt"=> "a sexy girl"
);

$ch = curl_init($url);

$dataString = json_encode($data);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'TT-API-KEY: your_key'
);

$result = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo $httpCode;
const axios = require('axios');

let config = {
  method: 'post',
  url: 'https://api.ttapi.io/midjourney/v1/promptCheck',
  headers: { 
    'TT-API-KEY': 'your_key'
  },
  data : {
    "prompt"=> "a sexy girl"
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.status));
})
.catch(function (error) {
  console.log(error);
});

响应示例

{
    "status": "SUCCESS",
    "message": "success",
    "data": "Prompt verification successful."
}
{
    "status": "FAILED",
    "message": "banned prompt words:sexy",
    "data": null
}
{
    "status": "FAILED",
    "message": "\"prompt\" cannot be empty.",
    "data": null
}

Midjourney服务状态查询

GET https://api.ttapi.io/midjourney/status

查询Midjourney API服务各个接口状态,该接口不消耗quota,免费使用

Headers

Name
Value

TT-API-KEY

用于请求授权 TT-API 的API密钥

Content-Type

application-json

请求示例

import requests

endpoint = "https://api.ttapi.io/midjourney/status"

headers = {
    "TT-API-KEY": your_key
}


response = requests.get(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
<?php

$url = 'https://api.ttapi.io/midjourney/status';


$ch = curl_init($url);


curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'TT-API-KEY: your_key'
);

$result = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo $httpCode;
const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://api.ttapi.io/midjourney/status',
  headers: { 
    'TT-API-KEY': 'your_key'
  },
  data : {}
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.status));
})
.catch(function (error) {
  console.log(error);
});

响应示例

{
    "status": "SUCCESS",
    "message": "success",
    "data": {
        "fast": {
            "status": 200,
            "runningMessage": "Endpoints running",
            "averageExecute": 46.42
        },
        "relax": {
            "status": 200,
            "runningMessage": "Endpoints running",
            "averageExecute": 39.37
        },
        "turbo": {
            "status": 200,
            "runningMessage": "Endpoints running",
            "averageExecute": 23.87
        }
    }
}

Action 具体使用操作

异步回调 JSON 结构

{
    "status": "SUCCESS",
    "jobId": "f5850038-90a3-8a97-0476-107ea4b8dac4",
    "message": "success",
    "data": {
        "actions": "imagine",
        "jobId": "f5850038-90a3-8a97-0476-107ea4b8dac4",
        "progress": "100",
        "prompt": "Soccer star Max Kruse and Jan-Peter Jachtmann victims of €528,695 poker scam, German soccer star Max Kruse and WSOP Main Event finalist Jan-Peter Jachtmann are among the players who have been swindled out of €528,695., poker, realistic --ar 1280:720",
        "discordImage": "https://cdn.discordapp.com/attachments/1107938555931656214/1176340921227423844/voyagel_Soccer_star_Max_Kruse_and_Jan-Peter_Jachtmann_victims_o_c513a87b-eed3-4a3b-ab97-6be4dbc3ea99.png?ex=656e83da&is=655c0eda&hm=6e06a1dec3c6c1be209799884681969878eabb81ce81f8db22d54480379fcd9b&",
        "cdnImage": "http://127.0.0.1/8080/pics/452020f2-6793-4525-a1b5-472cac439610.png",
        "width": 1632,
        "height": 2912,
        "hookUrl": "",
        "components": [
            "upsample1",
            "upsample2",
            "upsample3",
            "upsample4",
            "variation1",
            "variation2",
            "variation3",
            "variation4"
        ],
        "seed":"",
        "images": [
            "https://cdnb.ttapi.io/2024-04-02/5ac3b82974cfbc394ff70fdb3f8ad243a78cce8c3cd88defee12739db0b499f9.png",
            "https://cdnb.ttapi.io/2024-04-02/41c7a7dfc8ec9871d7aa6f45bbcb3ca7dcb967cadef285ae3b05b2fce63e9fa5.png",
            "https://cdnb.ttapi.io/2024-04-02/1d62e5110d24de42e8ac4894108874885b8460e5cbd212fe19ad756b1bf15087.png",
            "https://cdnb.ttapi.io/2024-04-02/a1887b8f816286df67cc83d0b1cc07450b2558bc28a60fbea4991f4ae390652c.png"
        ],
        "quota": 3
    }
}
{
    "status": "PENDING_QUEUE",
    "jobId": "f5850038-90a3-8a97-0476-107ea4b8dac4",
    "message": "",
    "data": []
}
{
    "status": "ON_QUEUE",
    "jobId": "f5850038-90a3-8a97-0476-107ea4b8dac4",
    "message": "",
    "data": {
        "actions": "imagine",
        "jobId": "f5850038-90a3-8a97-0476-107ea4b8dac4",
        "progress": "100",
        "prompt": "Soccer star Max Kruse and Jan-Peter Jachtmann victims of €528,695 poker scam, German soccer star Max Kruse and WSOP Main Event finalist Jan-Peter Jachtmann are among the players who have been swindled out of €528,695., poker, realistic --ar 1280:720",
        "discordImage": "https://cdn.discordapp.com/attachments/1107938555931656214/1176340921227423844/voyagel_Soccer_star_Max_Kruse_and_Jan-Peter_Jachtmann_victims_o_c513a87b-eed3-4a3b-ab97-6be4dbc3ea99.png?ex=656e83da&is=655c0eda&hm=6e06a1dec3c6c1be209799884681969878eabb81ce81f8db22d54480379fcd9b&",
        "cdnImage": "http://127.0.0.1/8080/pics/452020f2-6793-4525-a1b5-472cac439610.png",
        "width": null,
        "height": null,
        "hookUrl": "",
        "components": [],
        "seed": null,
        "images": null
    }
}
{
    "status": "FAILED",
    "jobId": "f5850038-90a3-8a97-0476-107ea4b8dac4",
    "message": "failed",
    "data": []
}

自2023年12月1日开始,discord返回的cdn图片链接将在24-72小时之内过期。

自2024年09月13日开始,TTAPI的Midjourney服务的cdnImage字段的域名由原来的 https://mjcdn.ttapi.io 变更至 https://cdnb.ttapi.io

返回JSON结构详解

name
value

status

PENDING_QUEUE //排队中

ON_QUEUE //执行中

SUCCESS //成功 FAILED //失败

progess

进度 : 0-100,100为完成

components

discordImage

discord的cdn图片地址,24小时后过期

cdnImage

国内可访问的cdn代理地址,24小时后过期

images

ttapi的cdn地址,imagine命令生成的四张小图,至少保证留存一个月

quota

实际消耗额度

回调地址,任务完成或失败将通过请地址进行通知。如果未设置,则需要请求 接口进行查询。

生成图像的任务模式,包括。如果未填写,则默认情况下将使用 fast 模式。

是否获取四张小图,可选值为 true, false 默认为 false,对应的返回结果为中images字段。注意:此操作并不是真正对生成的任务执行U操作,选择true之后依然可以进行U放大

如果 hookUrl 不为空,系统会向您设置的 hookUrl 发送一个 。

此接口包含生成图像下方的按钮操作 例如:U1~U4,V1~V4等,具体可参考

任务完成或失败将通过请地址进行通知。如果未设置,则需要请求 接口进行查询。

是否获取四张小图,可选值为 true, false 默认为 false,对应的返回结果为中images字段。注意:此操作并不是真正对生成的任务执行U操作,选择true之后依然可以进行U放大

从 Midjourney 图像中获取种子,了解具体用法请参阅

任务完成或失败将通过请地址进行通知。如果未设置,则需要请求 接口进行查询。

生成图像的任务模式,包括。如果未填写,则默认情况下将使用 fast 模式。

是否获取四张小图,可选值为 true, false 默认为 false,对应的返回结果为中images字段。注意:此操作并不是真正对生成的任务执行U操作,选择true之后依然可以进行U放大

生成图像的任务模式,包括。如果未填写,则默认情况下将使用 fast 模式。

任务完成或失败将通过请地址进行通知。如果未设置,则需要请求 接口进行查询。

返回结果与数据结构一致

关于相关操作的具体用法,您可以详细阅读

操作名称
描述
midjourney 示例

upsample1

U1-U4 按钮

upsample2, upsample3, upsample4 同理

variation1

V1-V4 按钮 variation2, variation3, variation4 同理

high_variation

Vary (Strong)按钮 对图片进行大幅变化

low_variation

Vary (Subtle) 按钮 对图片进行小幅变化

upscale2

Upscale(2x) 按钮 图像放大 2 倍,只存在于v5模式

upscale4

Upscale(4x) 按钮 图像放大 4 倍,只存在于v5模式

zoom_out_2

Zoom Out 2x 按钮

“缩小”选项在不更改原始图片的情况下展开放大图像的画布,根据提示和初始图像填充新空间。

zoom_out_1_5

Zoom Out 1.5x 按钮 “缩小”选项在不更改原始图片的情况下展开放大图像的画布,根据提示和初始图像填充新空间。

pan_left

⬅️➡️⬆️⬇️ 按钮 在选定方向上平移展开图像画布,而不会更改原始内容。根据初始图像和提供的提示填充扩展区域。pan_right, pan_up, pan_down 同理

upscale_creative

Upscale(Creative) 按钮 只存在于v6模式

upscale_subtle

Upscale(Subtle) 按钮 只存在于v6模式

reroll

基于上一个prompt重新生成。🔄按钮

redo_upscale2

Redo Upscale(2x) 按钮 重新对图像放大 2 倍,只存在于v5模式

redo_upscale4

Redo Upscale(4x) 按钮 重新对图像放大 4 倍,只存在于v5模式

make_square

Make Square 按钮 将非方形图像变更为方形图像

redo_upscale_subtle

Redo Upscale(Subtle) 按钮 重新执行Upscale(Subtle) ,

只存在于v6模式

redo_upscale_creative

Redo Upscale(Creative) 按钮 重新执行Upscale(Creative) , 只存在于v6模式

🔥
Midjourney文档
Midjourney官方文档
json响应
Action操作
异步回调
fetch
JSON结构
更多请参考
fetch
JSON结构
fetch
JSON结构
fetch
支持的下一步操作
联系我们
托管模式和PPU模式
relax、fast和turbo
relax、fast和turbo
relax、fast和turbo
upsample
variation
high_variation
low_variation
upscale2
upscale4
zoom_out_2
zoom_out_1_5
pan.png
upscale_creative.png
upscale_subtle.png
reroll.png
redo_upscale2.png
redo_upscale4.png
make_square.png
redo_upscale_subtle.png
redo_upscale_creative.png
upsample
variation
high_variation
low_variation
upscale2
upscale4
zoom_out_2
zoom_out_1_5
pan.png
upscale_creative.png
upscale_subtle.png
reroll.png
redo_upscale2.png
redo_upscale4.png
make_square.png
redo_upscale_subtle.png
redo_upscale_creative.png