Skip to main content

Overview

CloudBase AI provides text-to-image capabilities based on the Hunyuan large model. You can generate high-quality images through text descriptions.

Supported Models

Model NameDescription
hunyuan-image-v3.0-v1.0.4Hunyuan text-to-image v3.0, supports custom sizes, prompt rewriting, and thinking mode
Legacy Model Deprecation Notice

The legacy hunyuan-image model will be discontinued on June 30, 2026 at 00:00. Please switch to hunyuan-image-v3.0-v1.0.4 as soon as possible. See the upgrade guide for details.

Supported Sizes

SizeAspect RatioDescription
1024x10241:1Square (default)
1280x72016:9Horizontal widescreen
720x12809:16Vertical portrait
1280x12801:1Square (large)

Parameters

ParameterTypeRequiredDescription
modelstringYesModel name, use hunyuan-image-v3.0-v1.0.4
promptstringYesImage description text, max 500 characters
sizestringNoImage size, defaults to 1024x1024, see table above for options
revise{ value: boolean }NoWhether to enable prompt rewriting. When enabled, the model will automatically optimize the prompt to improve image quality
enable_thinking{ value: boolean }NoWhether to enable thinking mode. When enabled, image quality is higher but generation takes longer (approximately 60 seconds more)

Access Methods

Image generation supports the following access methods:

  • wx-server-sdk — Suitable for WeChat Mini Program Cloud Function scenarios
  • Node SDK — Suitable for Cloud Functions, Cloud Run, and other Node.js server-side scenarios

Limitations

  • Image generation only supports server-side invocation (Cloud Functions/Cloud Run). Mini Program and Web clients need to call through Cloud Functions
  • Generated image URLs expire after 24 hours. Upload to Cloud Storage for permanent access
  • Maximum prompt length is 500 characters
  • It is recommended to set Cloud Function timeout to 900 seconds (enabling revise adds ~10 seconds, enabling thinking adds up to 60 seconds)

Pricing

  • Mini Program Growth Plan users: Use the plan's complimentary image generation resources at no extra cost
  • Resource-Point Plan users: Deducted from plan resource points

FAQ

How to improve image quality?

  • Enable revise to let the model optimize your prompt
  • Enable enable_thinking for deeper understanding by the model (takes longer)
  • Write more detailed and specific prompts, including style, color tone, composition, etc.

Why does generation take so long?

Image generation itself takes relatively long, typically 10-30 seconds. Enabling revise or enable_thinking adds additional time. Make sure your Cloud Function timeout is set long enough.

What if the generated image URL has expired?

Image URLs are valid for 24 hours. It is recommended to upload the generated image to Cloud Storage immediately in your Cloud Function to obtain a permanent fileID. See the "Save Image to Cloud Storage" section in each SDK documentation for details.