Skip to main content

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 NameTypeRequiredDescription
promptstringRequiredThe text description used to generate images
modelstringRequiredModel name, use hunyuan-image
sizestringNot requiredImage dimensions, defaults to 1024x1024
revisebooleanNot requiredwhether to revise the prompt, defaults to true
footnotestringNot requiredCustom watermark content, limited to 16 characters
seednumberNot requiredGeneration 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 - Landscape
  • 768x1024 - 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: 1 to 4294967295
  • 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

  1. What parameters does hunyuan-image support?
  2. How to set image dimensions for the image generation model?
  3. What does the revise parameter mean in hunyuan-image?
  4. How to add a watermark to generated images?
  5. What is the use of the seed parameter in the image generation model?
  6. How to resolve a 400 error reported by hunyuan-image?
  7. What sizes does TCB AI image generation support?
  8. How to reproduce identical image generation results?
  9. hunyuan-image image generation model invocation example
  10. Why is there an error with the style parameter in the image generation model?