Qwen 和 Wan 图片模型
Qwen 和 Wan 图片模型
Qwen 和 Wan 图片模型使用带有 input.messages 载荷的图片生成端点。qwen-image-2.0、qwen-image-2.0-pro、wan2.7-image 和 wan2.7-image-pro 使用相同请求结构;在 parameters 内选择模型专属选项。
curl --location --request POST "https://api.getopenmodels.com/v1/images" \--header "Authorization: Bearer $OM_API_KEY" \--header "Content-Type: application/json" \--data-raw '{"model": "qwen-image-2.0-pro","route": { "provider": "<provider-for-this-model>" },"route_mode": "balanced","input": {"messages": [{"role": "user","content": [{"text": "Create a high-quality ecommerce poster for a white ceramic coffee cup, clean layout, realistic lighting, clear Chinese and English typography."}]}]},"parameters": {"n": 1,"watermark": false,"size": "2048*2048","negative_prompt": "low resolution, blurry text, distorted hands, cluttered composition","prompt_extend": true}}'
对于 Wan 模型,请使用相同载荷结构并切换到 Wan 专属参数值:
curl --location --request POST "https://api.getopenmodels.com/v1/images" \--header "Authorization: Bearer $OM_API_KEY" \--header "Content-Type: application/json" \--data-raw '{"model": "wan2.7-image-pro","route": { "provider": "<provider-for-this-model>" },"route_mode": "balanced","input": {"messages": [{"role": "user","content": [{"text": "A cinematic product photo of a premium black ceramic coffee cup on a marble table, soft side lighting, luxury ecommerce style."}]}]},"parameters": {"n": 1,"watermark": false,"size": "2K","thinking_mode": true}}'
对于 Qwen 和 Wan 图片模型,请在 parameters 中设置输出选项。
| 字段 | 类型 | 备注 |
|---|---|---|
model | string | 支持的值:qwen-image-2.0、qwen-image-2.0-pro、wan2.7-image、wan2.7-image-pro。 |
input.messages | array | 必填。使用单个带有 content 部分的用户消息。 |
input.messages[].content[].text | string | 文生图提示词必填。Qwen 2.0 提示词最多支持 1300 tokens;Wan 提示词最多支持 5000 个字符。 |
input.messages[].content[].image | string | 图片编辑或参考图工作流的可选图片输入,前提是所选模型路由支持图片输入。使用公开图片 URL 或 base64 Data URL。 |
parameters.n | integer | 图片数量。Qwen 2.0 当前要求为 1;Wan 在组图生成关闭时支持 1-4,当 enable_sequential 为 true 时支持 1-12。 |
parameters.size | string | 输出大小。Qwen 2.0 使用明确像素大小,例如 2048*2048、2688*1536 或 1536*2688。Wan 支持 1K 和 2K;wan2.7-image-pro 也支持文生图的 4K。Wan 还接受在像素限制内的自定义 WIDTH*HEIGHT 值。 |
parameters.watermark | boolean | 是否添加水印。默认值:false。 |
parameters.seed | integer | [0, 2147483647] 范围内的可选随机种子。固定 seed 可提高可复现性,但不保证结果完全相同。 |
parameters.negative_prompt | string | Qwen 专属负面提示词,用于描述要避免的内容。 |
parameters.prompt_extend | boolean | Qwen 专属提示词优化开关。默认值:true。 |
parameters.enable_sequential | boolean | Wan 专属组图生成开关。默认值:false。 |
parameters.thinking_mode | boolean | Wan 专属质量模式。默认值:true;仅当组图生成关闭时适用。 |
parameters.color_palette | array | Wan 专属色彩主题控制。提供 3-10 个包含 hex 和 ratio 的颜色对象;所有比例必须合计为 100.00%。 |