Skip to main content

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

ParameterTypeRequiredDescription
modelstringYesModel name, use HY-Image-3.0-Plus-4090-Tob-v1.0
promptstringYesImage description text, up to 500 characters
sizestringNoImage size, default 1024x1024
revise{ value: boolean }NoEnable prompt revision

Supported Sizes

SizeRatioDescription
1024x10241:1Square (default)
1280x72016:9Horizontal widescreen
720x12809:16Vertical portrait
1280x12801:1Square (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