Hy โ
Endpoint: POST https://mps.intl.tencentcloudapi.comAction: CreateAigcImageTask
Hy Image is Tencent Hunyuan's image generation model, supporting text-to-image and reference-image generation / editing. 3.5-preview supports multi-turn re-editing based on the previous result.
Basic Information โ
| Item | Value |
|---|---|
| ModelName | Hunyuan |
| ModelVersion | 3.5-preview / 3.0 |
| Guardrail disable support | Not supported |
The input/output guardrail disable parameters do not apply to Hy Image.
It supports text generation and reference image editing.
3.0 supports 3 reference images, and 3.5-preview supports up to 6 images.
Request Parameters โ
| Parameter | Required | Type | Description |
|---|---|---|---|
ModelName | Required | String | Fixed value Hunyuan |
ModelVersion | Optional | String | 3.5-preview / 3.0 |
Prompt | Required | String | Generation prompt. Up to 1000 characters. When a reference image is provided, it acts as an editing instruction |
EnhancePrompt | Optional | Boolean | Automatic prompt enhancement. Default value: false |
ImageInfos.N | Optional | Array | Array of reference images. Each item uses the ImageUrl field |
ExtraParameters | Optional | Object | Output options such as Resolution / AspectRatio |
AdditionalParameters | Optional | String | Specify the pixel size directly. {"size":"1808x1024"} |
OutputImageCount | Optional | Integer | Top-level field. In 3.5-preview, only 1 image is returned |
MPS output configuration
Specify the resolution and aspect ratio in ExtraParameters, and the number of output images in the top-level OutputImageCount.
Request Example โ
{
"ModelName": "Hunyuan",
"ModelVersion": "3.5-preview",
"Prompt": "a serene japanese garden, soft morning light",
"ExtraParameters": {
"Resolution": "2K",
"AspectRatio": "16:9"
},
"Operator": "admin",
"StoreCosParam": {
"CosBucketName": "<bucket-appid>",
"CosBucketRegion": "<bucket-region>",
"CosBucketPath": "/aigc/"
},
"EnhancePrompt": false
}{
"ModelName": "Hunyuan",
"ModelVersion": "3.5-preview",
"Prompt": "change the car color to matte black, keep the composition",
"ImageInfos": [
{
"ImageUrl": "https://<host>/car.png"
}
],
"ExtraParameters": {
"Resolution": "1K",
"AspectRatio": "16:9"
},
"Operator": "wiki-example",
"StoreCosParam": {
"CosBucketName": "<bucket-appid>",
"CosBucketRegion": "<bucket-region>",
"CosBucketPath": "/aigc/"
},
"EnhancePrompt": false
}Response Example โ
{
"Response": {
"Status": "DONE",
"Message": "ok",
"ImageUrls": [
"https://aigc-output-image-<id>.cos.<region>.myqcloud.com/<file>.png?q-sign-algorithm=sha1&..."
],
"RequestId": "<request-id>"
}
}Special Configuration โ
Output Resolution โ
The actual output pixels for each combination of ExtraParameters.Resolution and ExtraParameters.AspectRatio. The same mapping as the VOD API is used.
| Resolution | 1:1 | 16:9 | 9:16 | 4:3 | 3:4 |
|---|---|---|---|---|---|
| Omitted | 720x720 | 1280x720 | 720x1280 | 960x720 | 720x960 |
1K | 1024x1024 | 1808x1024 | 1024x1808 | 1360x1024 | 1024x1360 |
2K | 2048x2048 | 2048x1152 | 1152x2048 | 1920x1440 | 1440x1920 |
4K | 4096x4096 | 3840x2160 | 2160x3840 | 3840x2880 | 2880x3840 |
If Resolution is omitted and only AspectRatio is provided, the short side is fixed to 720. If both values are omitted, the output has an aspect ratio of 3:2 and a size of 1872x1248.
The 4K / 5:4 combination is output as 2688x2160.
Specifying the Pixel Size Directly โ
In AdditionalParameters, pass size, which takes precedence over the resolution and aspect ratio of ExtraParameters. The value is in the widthxheight format and, unlike the VOD API, requires only one level of JSON escaping.
{
"AdditionalParameters": "{\"size\":\"1808x1024\"}"
}| Input Value | Actual Output |
|---|---|
1808x1024 | 1808x1024 |
1024x1536 | 1024x1536 |
656x1000 | 656x992 (rounded down to a multiple of 16) |
auto | Determined automatically based on the prompt |
100x100 | 256x256 (adjusted to the lower limit) |
Reference Image โ
In ImageInfos, enter the ImageUrl of the reference image.
{
"ImageInfos": [
{
"ImageUrl": "https://<host>/reference.png"
}
]
}| Item | Value |
|---|---|
| Required field | ImageUrl |
| Number of reference images | Up to 6 images |
| Format | jpeg, png, webp |
Reference Image Input
In ImageInfos, specify ImageUrl. ReferenceType can be used together.