跳到主要内容

自定义水印

hy-image-v3.5-preview 支持在生图时通过 footnote 参数添加水印,无需自行实现图像合成逻辑。

参数说明​

参数类型必选说明
footnotestring否水印文字内容,最长 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 字符计,不区分中英文)
  • 服务端在生图过程中同步添加,不会额外增加生图时间