Documentation Index Fetch the complete documentation index at: https://docs.aihubmix.com/llms.txt
Use this file to discover all available pages before exploring further.
可用模型列表
OpenAI 模型
Imagen 模型
阿里云模型
Wan(万相)系列
Qwen-Image(千问图像)系列
GLM 模型
glm-image —— 智谱 AI 发布的图像生成模型,支持高清(hd)和标准(standard)两种质量模式。
Doubao 模型
iRAG 模型
Ideogram 模型
V3 —— Ideogram AI 生图模型,能够快速生成图片。
API 接口
zimage 接口
POST https://aihubmix.com/v1/models/ < model_pat h > /predictions
<model_path> 为<供应商/模型id>,如<openai/gpt-image-1.5>,<qianfan/qwen-image>。
openai 兼容接口
文生图
POST https://aihubmix.com/v1/images/generations
图片编辑
POST https://aihubmix.com/v1/images/edits
请求头
Authorization: Bearer $AIHUBMIX_API_KEY
Content-Type: application/json
请求参数
通用参数
参数 类型 必填 说明 prompt string 是 提示词 size string 否 图像尺寸,支持1K(Doubao-4-5系列不支持)、2K、4K、auto (默认)。Qwen系列支持参数:512*1024、768*512、 768*1024、 1024*576、 576*1024、 1024*1024(默认) image string 否 参考图片路径 n integer 否 生成图像数量,支持1-10,默认为 1。Imagen 模型该参数不生效 quality string 否 渲染质量,支持 low 、medium 和high,质量越高,耗时越长
OpenAI 模型参数
参数 类型 必填 说明 input_fidelity string 否 保真度,支high和 low(默认) moderation string 否 内容审核严格程度,支持 auto (默认,标准过滤)和 low(过滤限制较少),图生图模式下不支持 output_format string 否 输出图片格式,支持 png 、 jpeg (默认) 、webp
Imagen 模型参数
参数 类型 必填 说明 sampleCount integer 否 生成图像数量,默认为 4
Flux 模型参数
参数 类型 必填 说明 safety_tolerance integer 否 审核宽松度,数值越大越宽松。支持范围 0<=x<=5 ,默认值为 2 aspect_ratio string 否 图像所需的宽高比,支持16:9(默认), 1:1 、4:3 seed integer 否 随机数种子 raw boolean 否 是否启用原始模式,获得更自然的视觉效果,默认false
FLUX-1.1-pro 模型参数
参数 类型 默认值 必填 说明 prompt string - 是 图像的文本描述 size string 1024x1024 否 图像尺寸(像素) prompt_upsampling boolean false 否 是否对提示词进行增强优化以获得更好的效果 seed integer null 否 随机数种子,用于结果复现,可填任意整数 safety_tolerance integer 2 否 内容审核级别,范围 0(最严格)到 6(最宽松) output_format string jpeg 否 输出图片格式,支持 jpeg 和 png
prompt_upsampling、safety_tolerance、seed 需放在请求体的 extra_body 字段内传递。
阿里云模型参数
阿里云模型支持两种调用方式:OpenAI 兼容接口和 zimage 原生接口。
OpenAI 兼容接口 — 标准参数
参数 类型 必填 默认值 说明 model string 是 - 模型名称 prompt string 是 - 图像描述提示词,最长 800 字符 n integer 否 1 生成图片数量,取值范围因模型而异 size string 否 1024x1024 图片尺寸,格式 宽x高 response_format string 否 url 返回格式:url 或 b64_json
OpenAI 兼容接口 — 扩展参数(与 model、prompt 同级传递)
参数 类型 默认值 支持模型 说明 thinking_mode boolean true wan2.7 系列 思考模式,提升生成质量,增加耗时约 10-30s negative_prompt string - qwen-image 系列、wan2.6 反向提示词,最长 500 字符。wan2.7 系列请在 prompt 中使用「不要出现 XX」 prompt_extend boolean true qwen-image 系列、wan2.6 提示词智能改写,wan2.7 系列不支持 seed integer 随机 全部 随机种子,范围 0-2147483647 watermark boolean false 全部 是否添加水印
zimage 原生接口参数(位于 input 对象内)
参数 类型 必填 说明 prompt string 是 图像描述或编辑指令,最长 800 字符 images string[] 否 图片 URL 或 base64 数组(1-3 张),有值时为图片编辑模式 n integer 否 生成图片数量,取值范围因模型而异 size string 否 输出分辨率,格式为 宽*高 或缩写 1K/2K/4K seed integer 否 随机种子,范围 0-2147483647 negative_prompt string 否 反向提示词,最长 500 字符,wan2.7 系列不支持 prompt_extend boolean 否 提示词智能改写,默认 true,wan2.7 系列不支持 thinking_mode boolean 否 思考模式,仅 wan2.7 系列,默认 true watermark boolean 否 是否添加水印,默认 false color_palette array 否 自定义颜色主题,含 3-10 个颜色对象,仅 wan2.7 系列支持
各模型 n 和 size 取值范围
模型 n 范围 size 范围 默认 size wan2.7-image-pro 1(组图模式 1-12) 1K/2K/4K;自定义每边 768-4096px,宽高比 1:8~8:12K wan2.7-image 1(组图模式 1-12) 1K/2K;自定义每边 768-2048px,宽高比 1:8~8:12K wan2.6-t2i 1-4 自定义每边 1280-1440px,宽高比 1:4~4:1 1280x1280 qwen-image-2.0-pro / qwen-image-2.0 1-6 自定义每边 512-2048px,总像素 ≤ 2048×2048 2048x2048 qwen-image-max / qwen-image-plus 1-6 5 种固定规格:1664x928、1472x1104、1328x1328、1104x1472、928x1664 1664x928 qwen-image-edit 固定 1 不可指定,由模型自动决定 - qwen-image-edit-plus / qwen-image-edit-max 1-6 自定义每边 512-2048px 约 1024x1024
GLM 模型参数
参数 类型 必填 说明 quality string 否 渲染质量,支持 hd(默认,细节更丰富,约 20 秒)和 standard(生成更快,约 5-10 秒) size string 否 图像尺寸,默认 1280x1280。推荐值:1280x1280、1568x1056、1056x1568、1472x1088、1088x1472、1728x960、960x1728。自定义尺寸要求:宽高均在 1024px–2048px 之间,必须能被 32 整除,且总像素不超过 2²² px
Doubao 模型参数
参数 类型 必填 说明 sequential_image_generation string 否 控制是否关闭组图功能 sequential_image_generation_options object 否 组图功能配置,仅当 sequential_image_generation 为 auto 时生效。目前支max_images,取值范围[1, 15],默认值为 15 watermark boolean 否 是否在生成的图片中添加水印,支持 true (默认)和 false seed integer 否 随机数种子,取值范围为 [-1, 2147483647],默认值为 -1 response_format string 否 生成图像的返回格式,支url(链接在图片生成后24小时内有效,请及时下载图片)base64_json
实际可生成的图片数量,除受到 max_images 影响外,还受到输入的参考图数量影响。输入的参考图数量+最终生成的图片数量 ≤ 15 张。
使用示例
OpenAI
curl https://aihubmix.com/v1/models/openai/gpt-image-1.5/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"prompt": "A deer drinking in the lake, Sakura petals falling, green and clean water, japanese temple, dappled sunlight, cinematic lighting, expansive view, peace",
"size": "1024x1024",
"n": 1,
"quality": "high",
"moderation": "low",
"background": "auto"
}
}'
Google Imagen
curl https://aihubmix.com/v1/models/google/imagen-4.0-fast-generate-001/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"prompt": "A deer drinking in the lake, Sakura petals falling, green and clean water, japanese temple, dappled sunlight, cinematic lighting, expansive view, peace",
"numberOfImages": 1
}
}'
阿里云模型
支持两种调用方式:OpenAI 兼容接口(/v1/images/generations 和 /v1/images/edits)和 zimage 原生接口(/v1/models/bailian/:model/predictions)
返回的图片 URL 有效期 24 小时,请及时下载保存
OpenAI兼容-文生图
OpenAI兼容-图片编辑
zimage-文生图
zimage-图片编辑
curl https://aihubmix.com/v1/images/generations \
-H "Authorization: Bearer sk-***" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.7-image-pro",
"prompt": "一座古色古香的中国风小桥,水墨画风格",
"n": 1,
"size": "1024x1024",
"thinking_mode": true,
"seed": 42
}'
GLM
curl https://aihubmix.com/v1/models/openai/glm-image/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"prompt": "A deer drinking in the lake, Sakura petals falling, green and clean water, japanese temple, dappled sunlight, cinematic lighting, expansive view, peace",
"size": "1024x1024",
"quality": "hd"
}
}'
Doubao
curl https://aihubmix.com/v1/models/doubao/doubao-seedream-4-0/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"prompt": "星际穿越,黑洞,黑洞里冲出一辆快支离破碎的复古列车,抢视觉冲击力,电影大片,末日既视感,动感,对比色,oc渲染,光线追踪,动态模糊,景深,超现实主义,深蓝,画面通过细腻的丰富的色彩层次塑造主体与场景,质感真实,暗黑风背景的光影效果营造出氛围,整体兼具艺术幻想感,夸张的广角透视效果,耀光,反 射,极致的光影,强引力,吞噬",
"size": "2K",
"sequential_image_generation": "disabled",
"stream": false,
"response_format": "url",
"watermark": true
}
}'
Flux
flux-2-flex 和 flux-2-pro 为异步端口,需要分 2 步请求。该系列速度极快,几乎秒出。
FLUX.1-Kontext-pro 使用通用接口,一步到位
Azure 渠道的FLUX-1.1-pro 等 BFL 模型均为同步绘图,而非异步。
FLUX 一步绘图
curl https://aihubmix.com/v1/models/bfl/FLUX-1.1-pro/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"prompt": "A serene deer drinking from a crystal-clear lake, sakura petals gently falling, traditional Japanese temple in the background, warm dappled sunlight, cinematic lighting, ultra-wide composition, peaceful atmosphere, highly detailed",
"size": "1024x1024",
"output_format": "jpeg",
"extra_body": {
"prompt_upsampling": true,
"safety_tolerance": 6,
"seed": 1
}
}
}'
Flux 异步绘图
第一步:发出绘图请求
curl https://aihubmix.com/v1/models/bfl/flux-kontext-max/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"prompt": "A deer drinking in the lake, Sakura petals falling, green and clean water, japanese temple, dappled sunlight, cinematic lighting, expansive view, peace. reference style as the given image:",
"aspect_ratio": "2:3",
"safety_tolerance": 6
}
}'
输出结果示例:
{
"output" : [
{
"taskId" : "api.us1.***",
"polling_url" : "https://api.us1.bfl.ai/v1/get_result?id=f9821dbf-f134-41c2-aaa8-5405fb665c76"
}
]
}
第二步:获取生成的图片链接
curl https://api.aihubmix.com/v1/tasks/ < taskI d > \
-H "Authorization: Bearer sk-***" \
-X GET
Ideogram V3
V3 以下版本(V_2、V_1 等)为旧接口,暂不支持
返回的链接需要打开代理网络才能获取
curl https://aihubmix.com/v1/models/ideogram/V3/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"prompt": "A deer drinking in the lake, Sakura petals falling, green and clean water, japanese temple, dappled sunlight, cinematic lighting, expansive view, peace, in the style of Pixar 3D",
"rendering_speed": "QUALITY",
"aspect_ratio": "2x1"
}
}'
iRAG
ERNIE iRAG
ERNIE iRAG Edit
curl https://aihubmix.com/v1/models/qianfan/irag-1.0/predictions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-***" \
-d '{
"input": {
"prompt": "A beautiful sunset over a calm ocean",
"refer_image": "",
"n": 1,
"size": "1024x1024",
"guidance": 7.5,
"watermark": false
}
}'