自定义水印
hy-image-v3.5-preview 支持在生图时通过 footnote 参数添加水印,无需自行实现图像合成逻辑。
参数说明
| 参数 | 类型 | 必选 | 说明 |
|---|---|---|---|
footnote | string | 否 | 水印文字内容,最长 16 字符,生成在图片右下角 |
使用示例
const imageModel = ai.createImageModel("cloudbase");
const res = await imageModel.generateImage({
model: "hy-image-v3.5-preview",
footnote: "CloudBase AI",
messages: [
{
role: "user",
content: [{ type: "text", text: "一只胖胖的橘猫坐在窗台上打盹,水彩风格,温暖色调" }],
},
],
});
console.log(res.choices[0].delta.image.url); // 返回的图片已包含水印
注意事项
- 水印最长 16 字符(按 Unicode 字符计,不区分中英文)
- 服务端在生图过程中同步添加,不会额外增加生图时间
相关文档
- 文生图 — 尺寸、种子等参数说明
- Hy-Image-3.5-preview — 完整协议与参数参考
- 历史版本(旧模型) — 已废弃的 HY-Image-3.0 用法