flux-2-pro
本文介绍 flux-2-pro 模型调用 API 的输入输出参数,供您使用接口时查阅字段含义。
以下只展示部分使用到的字段说明,flux-2-pro API 详细字段见flux-2-pro 官网文档
请求地址
POST https://api.modelverse.cn/v1/flux-2-pro
认证方式
API Key
与官方不同,我们不使用 x-key,而是使用 Authorization。
请求参数
请求体
响应参数
示例
curl
curl -X POST "https://api.modelverse.cn/v1/flux-2-pro" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MODELVAULTS_API_KEY" \
-d '{
"prompt" : "A photograph of a red fox in an autumn forest",
"width": 1024,
"height": 1024
}' | jq -r '.data[0].b64_json' | base64 --decode > flux-2-pro.pngpython
import requests
import os
url = "https://api.modelverse.cn/v1/flux-2-pro"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('MODELVAULTS_API_KEY')}"
}
payload = {
"prompt": "A photograph of a red fox in an autumn forest",
"width": 1024,
"height": 1024
}
response = requests.post(url, headers=headers, json=payload)
result = response.json()
print(result)








