Skip to content

Hy โ€‹

Updated

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 โ€‹

ItemValue
ModelNameHunyuan
ModelVersion3.5-preview / 3.0
Guardrail disable supportNot 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 โ€‹

ParameterRequiredTypeDescription
ModelNameRequiredStringFixed value Hunyuan
ModelVersionOptionalString3.5-preview / 3.0
PromptRequiredStringGeneration prompt. Up to 1000 characters. When a reference image is provided, it acts as an editing instruction
EnhancePromptOptionalBooleanAutomatic prompt enhancement. Default value: false
ImageInfos.NOptionalArrayArray of reference images. Each item uses the ImageUrl field
ExtraParametersOptionalObjectOutput options such as Resolution / AspectRatio
AdditionalParametersOptionalStringSpecify the pixel size directly. {"size":"1808x1024"}
OutputImageCountOptionalIntegerTop-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 โ€‹

json
{
  "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
}
json
{
  "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 โ€‹

json
{
  "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.

Resolution1:116:99:164:33:4
Omitted720x7201280x720720x1280960x720720x960
1K1024x10241808x10241024x18081360x10241024x1360
2K2048x20482048x11521152x20481920x14401440x1920
4K4096x40963840x21602160x38403840x28802880x3840

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.

json
{
  "AdditionalParameters": "{\"size\":\"1808x1024\"}"
}
Input ValueActual Output
1808x10241808x1024
1024x15361024x1536
656x1000656x992 (rounded down to a multiple of 16)
autoDetermined automatically based on the prompt
100x100256x256 (adjusted to the lower limit)

Reference Image โ€‹

In ImageInfos, enter the ImageUrl of the reference image.

json
{
  "ImageInfos": [
    {
      "ImageUrl": "https://<host>/reference.png"
    }
  ]
}
ItemValue
Required fieldImageUrl
Number of reference imagesUp to 6 images
Formatjpeg, png, webp

Reference Image Input

In ImageInfos, specify ImageUrl. ReferenceType can be used together.

Built with VitePress ยท Deployed on Tencent EdgeOne Pages