Text-to-Image
hy-image-v3.5-preview generates images from text prompts via the Chat/Messages protocol, supporting custom dimensions (up to 4096x4096), seed, and watermark.
Model
Use the hy-image-v3.5-preview model with the cloudbase provider. Requires @cloudbase/js-sdk >= 3.11.0.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Fixed to hy-image-v3.5-preview |
messages | Array<object> | Yes | Conversation content; put the text in the content of a role=user message |
size | string | No | Size in ${width}x${height} format; when set, output is forced to this size |
seed | integer | No | Generation seed in [0, 2^63-1]; fix it to reproduce results |
generate_max_pixels | integer | No | Area tier, effective only when size is not set |
footnote | string | No | Bottom-right watermark, up to 16 characters |
For the full reference (session, resize_max_pixels, use_search_tool) and response fields, see Hy-Image-3.5-preview.
Supported Sizes
| Method | Description |
|---|---|
size | Width/height in [256, 8192], area up to 4096x4096, 4K maximum |
generate_max_pixels | 1048576 (1K), 2359296 (1.5K, default), 4194304 (2K) |
| Neither | The model decides based on prompt semantics; defaults to the 1.5K tier |
Usage Example
const imageModel = ai.createImageModel("cloudbase");
const res = await imageModel.generateImage({
model: "hy-image-v3.5-preview",
size: "4096x4096",
seed: 42,
footnote: "CloudBase AI",
messages: [
{
role: "user",
content: [{ type: "text", text: "A chubby orange cat napping on a windowsill, watercolor style, warm tones" }],
},
],
});
// Final image, URL valid for 12 hours
console.log(res.choices[0].delta.image.url);
Access Methods
- JS SDK — Node.js server side
- Hy-Image-3.5-preview — full protocol and parameter reference
- Legacy Models — deprecated HY-Image-3.0 usage