跳转到主要内容

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 模型

  • gpt-image-1.5 —— OpenAI 最新的图像生成模型,它具有更好的指令遵循性和对提示的执行能力。
  • gpt-image-1 —— 多模态语言模型,它接受文本和图像输入,并生成图像输出。
  • gpt-image-1-mini —— gpt-image-1 的经济型版本。
  • dall-e-3 —— 能够根据自然语言描述创建逼真的图像和艺术作品,支持根据提示创建指定尺寸的新图像。

Imagen 模型

阿里云模型

Wan(万相)系列

  • wan2.7-image-pro —— 万相 2.7 专业版,支持思考模式与最高 4K 分辨率
  • wan2.7-image —— 万相 2.7 标准版,最高支持 2K 分辨率
  • wan2.6-t2i —— 万相 2.6 文生图

Qwen-Image(千问图像)系列

  • qwen-image —— 图像生成基础模型,在复杂文本渲染和精确图像编辑方面取得了显著进展
  • qwen-image-edit —— 图像编辑模型,单图编辑和多图融合
  • qwen-image-2.0-pro —— 2.0 专业版,文字渲染和语义理解更强,同时支持图片编辑
  • qwen-image-2.0 —— 2.0 加速版,兼顾质量和速度,同时支持图片编辑
  • qwen-image-max —— Max 版,擅长工业设计和几何推理
  • qwen-image-plus —— Plus 版,支持多图和自定义分辨率
  • qwen-image-edit-plus —— 编辑 Plus 版,支持多输出和自定义分辨率
  • qwen-image-edit-max —— 编辑 Max 版,擅长工业设计和几何推理

GLM 模型

  • glm-image —— 智谱 AI 发布的图像生成模型,支持高清(hd)和标准(standard)两种质量模式。

Doubao 模型

  • doubao-seedream-5.0-lite —— 字节跳动发布的最新图像创作模型,该模型首次搭载联网检索功能,能融合实时网络信息,提升生图时效性。
  • doubao-seedream-4-5 —— 字节跳动推出的图像多模态模型,整合了文生图、图生图、组图输出等能力。
  • doubao-seedream-4-0 —— 字节跳动SOTA级多模态图像创作模型,支持多图融合创作、图像编辑、组图生成等多样玩法。

iRAG 模型

  • irag-1.0 —— 百度自研生图模型,能够生成超真实图片。
  • ernie-irag-edit —— 百度自研的图像编辑模型,支持基于图片进行 erase、repaint、variation 等操作。

Ideogram 模型

  • V3 —— Ideogram AI 生图模型,能够快速生成图片。

API 接口

zimage 接口


POST https://aihubmix.com/v1/models/<model_path>/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

请求参数

通用参数

参数类型必填说明
promptstring提示词
sizestring图像尺寸,支持1K(Doubao-4-5系列不支持)、2K4Kauto (默认)。Qwen系列支持参数:512*1024768*512768*10241024*576576*10241024*1024(默认)
imagestring参考图片路径
ninteger生成图像数量,支持1-10,默认为 1。Imagen 模型该参数不生效
qualitystring渲染质量,支持 lowmediumhigh,质量越高,耗时越长

OpenAI 模型参数

参数类型必填说明
input_fidelitystring保真度,支highlow(默认)
moderationstring内容审核严格程度,支持 auto (默认,标准过滤)和 low(过滤限制较少),图生图模式下不支持
output_formatstring输出图片格式,支持 pngjpeg (默认) 、webp

Imagen 模型参数

参数类型必填说明
sampleCountinteger生成图像数量,默认为 4

Flux 模型参数

参数类型必填说明
safety_toleranceinteger审核宽松度,数值越大越宽松。支持范围 0<=x<=5 ,默认值为 2
aspect_ratiostring图像所需的宽高比,支持16:9(默认), 1:14:3
seedinteger随机数种子
rawboolean是否启用原始模式,获得更自然的视觉效果,默认false

FLUX-1.1-pro 模型参数

参数类型默认值必填说明
promptstring-图像的文本描述
sizestring1024x1024图像尺寸(像素)
prompt_upsamplingbooleanfalse是否对提示词进行增强优化以获得更好的效果
seedintegernull随机数种子,用于结果复现,可填任意整数
safety_toleranceinteger2内容审核级别,范围 0(最严格)到 6(最宽松)
output_formatstringjpeg输出图片格式,支持 jpegpng
prompt_upsamplingsafety_toleranceseed 需放在请求体的 extra_body 字段内传递。

阿里云模型参数

阿里云模型支持两种调用方式:OpenAI 兼容接口和 zimage 原生接口。 OpenAI 兼容接口 — 标准参数
参数类型必填默认值说明
modelstring-模型名称
promptstring-图像描述提示词,最长 800 字符
ninteger1生成图片数量,取值范围因模型而异
sizestring1024x1024图片尺寸,格式 宽x高
response_formatstringurl返回格式:urlb64_json
OpenAI 兼容接口 — 扩展参数(与 modelprompt 同级传递)
参数类型默认值支持模型说明
thinking_modebooleantruewan2.7 系列思考模式,提升生成质量,增加耗时约 10-30s
negative_promptstring-qwen-image 系列、wan2.6反向提示词,最长 500 字符。wan2.7 系列请在 prompt 中使用「不要出现 XX」
prompt_extendbooleantrueqwen-image 系列、wan2.6提示词智能改写,wan2.7 系列不支持
seedinteger随机全部随机种子,范围 0-2147483647
watermarkbooleanfalse全部是否添加水印
zimage 原生接口参数(位于 input 对象内)
参数类型必填说明
promptstring图像描述或编辑指令,最长 800 字符
imagesstring[]图片 URL 或 base64 数组(1-3 张),有值时为图片编辑模式
ninteger生成图片数量,取值范围因模型而异
sizestring输出分辨率,格式为 宽*高 或缩写 1K/2K/4K
seedinteger随机种子,范围 0-2147483647
negative_promptstring反向提示词,最长 500 字符,wan2.7 系列不支持
prompt_extendboolean提示词智能改写,默认 true,wan2.7 系列不支持
thinking_modeboolean思考模式,仅 wan2.7 系列,默认 true
watermarkboolean是否添加水印,默认 false
color_palettearray自定义颜色主题,含 3-10 个颜色对象,仅 wan2.7 系列支持
各模型 nsize 取值范围
模型n 范围size 范围默认 size
wan2.7-image-pro1(组图模式 1-12)1K/2K/4K;自定义每边 768-4096px,宽高比 1:8~8:12K
wan2.7-image1(组图模式 1-12)1K/2K;自定义每边 768-2048px,宽高比 1:8~8:12K
wan2.6-t2i1-4自定义每边 1280-1440px,宽高比 1:4~4:11280x1280
qwen-image-2.0-pro / qwen-image-2.01-6自定义每边 512-2048px,总像素 ≤ 2048×20482048x2048
qwen-image-max / qwen-image-plus1-65 种固定规格:1664x9281472x11041328x13281104x1472928x16641664x928
qwen-image-edit固定 1不可指定,由模型自动决定-
qwen-image-edit-plus / qwen-image-edit-max1-6自定义每边 512-2048px约 1024x1024

GLM 模型参数

参数类型必填说明
qualitystring渲染质量,支持 hd(默认,细节更丰富,约 20 秒)和 standard(生成更快,约 5-10 秒)
sizestring图像尺寸,默认 1280x1280。推荐值:1280x12801568x10561056x15681472x10881088x14721728x960960x1728。自定义尺寸要求:宽高均在 1024px–2048px 之间,必须能被 32 整除,且总像素不超过 2²² px

Doubao 模型参数

参数类型必填说明
sequential_image_generationstring控制是否关闭组图功能
sequential_image_generation_optionsobject组图功能配置,仅当 sequential_image_generationauto 时生效。目前支max_images,取值范围[1, 15],默认值为 15
watermarkboolean是否在生成的图片中添加水印,支持 true (默认)和 false
seedinteger随机数种子,取值范围为 [-1, 2147483647],默认值为 -1
response_formatstring生成图像的返回格式,支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 小时,请及时下载保存
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-flexflux-2-pro 为异步端口,需要分 2 步请求。该系列速度极快,几乎秒出。
  • FLUX.1-Kontext-pro 使用通用接口,一步到位
  • Azure 渠道的FLUX-1.1-pro 等 BFL 模型均为同步绘图,而非异步。

FLUX 一步绘图

FLUX-1.1-pro
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/<taskId> \
    -H "Authorization: Bearer sk-***" \
    -X GET

Ideogram V3

  1. V3 以下版本(V_2、V_1 等)为旧接口,暂不支持
  2. 返回的链接需要打开代理网络才能获取
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

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
    }
  }'