Midjourney V7 API: AI 图像生成
通过 Muapi REST API 使用 Midjourney V7生成图像。按次生成付费,无需订阅。
交互式模型控制
使用 Midjourney V7 每次生成 4 张照片级图像。支持文生图,并可通过 `source_image_url` 引导参考图像。
通过 Muapi REST API 使用 Midjourney V7生成图像。按次生成付费,无需订阅。
使用 Midjourney V7 每次生成 4 张照片级图像。支持文生图,并可通过 `source_image_url` 引导参考图像。
POST https://api.muapi.ai/api/v1/midjourney-v7使用 Muapi API 密钥在 x-api-key 请求头中提交任务,然后轮询 https://api.muapi.ai/api/v1/predictions/{request_id}/result 直到状态变为 completed。
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| prompt | string | 是 | 要生成的图像的文本描述。 |
| image_url | string | 否 | 可选的 reference image URL. Influences the style and content of the generation. |
| aspect_ratio | string | 否 | 输出图像画面比例。选项: 1:1, 16:9, 9:16, 3:4, 4:3, 21:9默认值: "1:1" |
| stylize | int | 否 | 控制结果的艺术化程度。范围:0–1000。数值越低越贴近提示词,越高越具风格化。默认值: 100 |
| chaos | int | 否 | 控制 4 张图像之间的变化程度。范围:0–100。数值越高越多样。默认值: 0 |
| weird | int | 否 | 增添独特的美学效果。范围:0–3000。默认值: 0 |
| negative_prompt | string | 否 | 要从图像中排除的内容,例如“text, watermark”。 |
| seed | int | 否 | 可复现种子。范围:0–4294967295。相同种子和相同提示词通常会产生相近结果。默认值: 0 |
REQUEST_ID=$(curl -s -X POST https://api.muapi.ai/api/v1/midjourney-v7 \
-H "x-api-key: $MUAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"<prompt>"}' | jq -r .request_id)
curl -s https://api.muapi.ai/api/v1/predictions/$REQUEST_ID/result -H "x-api-key: $MUAPI_API_KEY"import os, time, requests
API = "https://api.muapi.ai/api/v1"
headers = {"x-api-key": os.environ["MUAPI_API_KEY"]}
r = requests.post(f"{API}/midjourney-v7", headers=headers, json={"prompt":"<prompt>"})
request_id = r.json()["request_id"]
while True:
res = requests.get(f"{API}/predictions/{request_id}/result", headers=headers).json()
if res["status"] == "completed":
print(res["outputs"]); break
if res["status"] == "failed":
raise RuntimeError(res.get("error"))
time.sleep(3)完整文档及 Agent/MCP 集成: llms.txt. 在此获取 API 密钥: muapi.ai/access-keys.