Custom Watermark
The Hunyuan image generation model supports adding custom watermarks directly during image generation. Specify the watermark text via the SDK's footnote parameter — no need to implement image compositing logic yourself.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
footnote | string | No | Watermark text content |
Usage Example
Using Node SDK, pass the footnote parameter to generateImage to add a watermark:
const cloudbase = require('@cloudbase/node-sdk')
const app = cloudbase.init({ env: process.env.ENV_ID })
const ai = app.ai()
const imageModel = ai.createImageModel('hunyuan-image')
const res = await imageModel.generateImage({
model: 'HY-Image-3.0-Plus-4090-Tob-v1.0',
prompt: 'A chubby orange cat napping on a windowsill, watercolor style, warm tones',
footnote: 'CloudBase AI',
})
console.log(res.data[0].url) // The returned image already contains the watermark
Access Methods
- wx-server-sdk — WeChat Mini Program Cloud Functions
- Node SDK — Cloud Functions / Cloud Run
- JS SDK — Node.js server environment
Notes
- Watermarks are applied server-side during image generation and do not add extra processing time
- The
footnoteparameter is supported by all three SDKs'generateImagemethod