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 Name | Description |
|---|---|
hunyuan-image-v3.0-v1.0.4 | Hunyuan text-to-image v3.0, supports custom sizes, prompt rewriting, and thinking mode |
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
| Size | Aspect Ratio | Description |
|---|---|---|
1024x1024 | 1:1 | Square (default) |
1280x720 | 16:9 | Horizontal widescreen |
720x1280 | 9:16 | Vertical portrait |
1280x1280 | 1:1 | Square (large) |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model name, use hunyuan-image-v3.0-v1.0.4 |
prompt | string | Yes | Image description text, max 500 characters |
size | string | No | Image size, defaults to 1024x1024, see table above for options |
revise | { value: boolean } | No | Whether to enable prompt rewriting. When enabled, the model will automatically optimize the prompt to improve image quality |
enable_thinking | { value: boolean } | No | Whether 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
reviseto let the model optimize your prompt - Enable
enable_thinkingfor 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.