跳转到主要内容
POST
/
generate
/
k
/
mj-txt2img
Midjourney 文生图
curl --request POST \
  --url https://api.sinancode.com/v1/generate/k/mj-txt2img \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "aspectRatio": "16:9",
  "enableTranslation": false,
  "prompt": "Help me generate a sci-fi themed fighter jet in a beautiful sky",
  "speed": "relaxed",
  "stylization": 1,
  "variety": 10,
  "version": "7",
  "waterMark": "my_watermark",
  "weirdness": 1
}'
{
  "task_id": "01234567-89ab-cdef-0123-456789abcdef"
}
业界领先的艺术风格 AI 图片生成模型,以其独特的美学风格和强大的艺术表现力著称。

Authorizations

Authorization
string
header
required

请使用您的 API Token 进行认证

Body

application/json

Task parameters

prompt
string
required

提示词(必填,最大2000字符)- 生成的文本描述

Maximum length: 2000
Example:

"Help me generate a sci-fi themed fighter jet in a beautiful sky"

aspectRatio
enum<string>

宽高比(可选)- 输出宽高比

可用选项:
1:2,
9:16,
2:3,
3:4,
5:6,
6:5,
4:3,
3:2,
1:1,
16:9,
2:1
Example:

"16:9"

enableTranslation
boolean
default:false

启用翻译(可选,默认 false)- 启用自动翻译

Example:

false

speed
enum<string>

速度(可选)- API 生成速度

可用选项:
relaxed,
fast,
turbo
Example:

"relaxed"

stylization
integer

风格化(可选,范围 0-1000)- 艺术风格强度

Required range: 0 <= x <= 1000
Example:

1

variety
integer

多样性(可选,范围 0-100,步长5)- 内容多样性

Required range: 0 <= x <= 100
Example:

10

version
enum<string>

版本(可选)- Midjourney 模型版本

可用选项:
7,
6.1,
6,
5.2,
5.1,
niji6
Example:

"7"

waterMark
string

水印(可选)- 水印标识

Example:

"my_watermark"

weirdness
integer

怪异度(可选,范围 0-3000)- 创意独特性

Required range: 0 <= x <= 3000
Example:

1

Response

OK

task_id
string
required

Task ID

Example:

"01234567-89ab-cdef-0123-456789abcdef"