hunyuan-image Generate images model parameter specifications
TCB AI's hunyuan-image image generation model supports generating images from text descriptions. This document describes the parameters supported by the model.
Supported Parameters
| Parameter Name | Type | Required | Description |
|---|---|---|---|
prompt | string | Required | The text description used to generate images |
model | string | Required | Model name, use hunyuan-image |
size | string | Not required | Image dimensions, defaults to 1024x1024 |
revise | boolean | Not required | whether to revise the prompt, defaults to true |
footnote | string | Not required | Custom watermark content, limited to 16 characters |
seed | number | Not required | Generation seed, range [1, 4294967295] |
Parameter Details
size Image Dimensions
- Default value:
1024x1024 - Supports custom dimensions: width and height must be between 768-1280 and must be multiples of 64.
- If the input number is not a multiple of 64, it will be rounded up to the nearest multiple of 64, and then cropped to the target size from the center point.
Common Dimensions:
1024x1024- Square (default)1024x768- Landscape768x1024- Portrait
revise Prompt Rewriting
- Default value:
true - After enabling, the model will automatically optimize your prompt, which can improve generation results in most scenarios.
- If you wish to strictly follow the original prompt for generation, set this to
false
footnote Watermark
- Limit to 16 characters (both Chinese and English characters count as one character each).
- The watermark is generated at the bottom-right corner of the image.
- Can be used to add brand logos or copyright information.
seed generation seed
- Only takes effect when the number of generated images is 1.
- Range:
1to4294967295 - Random when not passed
- Using the same seed + prompt can generate similar images, which can be used to reproduce results.
Invocation Example
Mini Program Cloud Function Invocation
const cloud = require('wx-server-sdk');
cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV });
exports.main = async (event) => {
const ai = cloud.extend.AI;
const result = await ai.createImage({
model: 'hunyuan-image',
prompt: 'a cute orange cat napping in the sunlight',
size: '1024x1024',
revise: true,
footnote: 'TCB generation'
});
return result;
};
Node.js SDK Invocation
const cloudbase = require('@cloudbase/node-sdk');
const app = cloudbase.init({ env: 'your-env-id' });
const result = await app.ai.createImage({
model: 'hunyuan-image',
prompt: 'a cute orange cat napping in the sunlight',
size: '1024x1024',
revise: true
});
Common Errors
400 Bad Request
A 400 error will be returned when unsupported parameters are passed. Please make sure to only use the parameters listed in the table above.
Note: The style parameter is currently not supported. Do not pass it.
Similar Issues
- What parameters does hunyuan-image support?
- How to set image dimensions for the image generation model?
- What does the revise parameter mean in hunyuan-image?
- How to add a watermark to generated images?
- What is the use of the seed parameter in the image generation model?
- How to resolve a 400 error reported by hunyuan-image?
- What sizes does TCB AI image generation support?
- How to reproduce identical image generation results?
- hunyuan-image image generation model invocation example
- Why is there an error with the style parameter in the image generation model?