Text-to-Image
The Hunyuan text-to-image model generates high-quality images from text descriptions, supporting custom dimensions, prompt revision, and thinking mode.
Model
Use the HY-Image-3.0-Plus-4090-Tob-v1.0 model for text-to-image generation.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model name, use HY-Image-3.0-Plus-4090-Tob-v1.0 |
prompt | string | Yes | Image description text, up to 500 characters |
size | string | No | Image size, default 1024x1024 |
revise | { value: boolean } | No | Enable prompt revision |
Supported Sizes
| Size | Ratio | Description |
|---|---|---|
1024x1024 | 1:1 | Square (default) |
1280x720 | 16:9 | Horizontal widescreen |
720x1280 | 9:16 | Vertical portrait |
1280x1280 | 1:1 | Square (large) |
Usage Example
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',
size: '1024x1024',
revise: { value: true },
})
console.log(res.data[0].url)
console.log(res.data[0].revised_prompt)
Access Methods
- wx-server-sdk — WeChat Mini Program Cloud Functions
- Node SDK — Cloud Functions / Cloud Run
- JS SDK — Node.js server environment