Skip to main content

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​

ParameterTypeRequiredDescription
modelstringYesFixed to hy-image-v3.5-preview
messagesArray<object>YesConversation content; put the text in the content of a role=user message
sizestringNoSize in ${width}x${height} format; when set, output is forced to this size
seedintegerNoGeneration seed in [0, 2^63-1]; fix it to reproduce results
generate_max_pixelsintegerNoArea tier, effective only when size is not set
footnotestringNoBottom-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​

MethodDescription
sizeWidth/height in [256, 8192], area up to 4096x4096, 4K maximum
generate_max_pixels1048576 (1K), 2359296 (1.5K, default), 4194304 (2K)
NeitherThe 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​