Skip to content
Alibaba logo

Wan 2.6 Image

Text-to-ImageAlibabaProxied

Alibaba's Wan 2.6 text-to-image model generating images from text prompts with optional negative prompts and customizable dimensions.

Model Info
Terms and Licenselink
More informationlink

Usage

TypeScript
const response = await env.AI.run(
'alibaba/wan-2.6-image',
{
prompt: 'A golden retriever puppy playing in autumn leaves',
},
{
gateway: { id: 'default' },
}
)
console.log(response)

Examples

Custom Dimensions — Specify image size in WxH format
TypeScript
const response = await env.AI.run(
'alibaba/wan-2.6-image',
{
prompt:
'A vast alien desert landscape with two suns setting on the horizon, ancient ruins in the foreground',
size: '1024x768',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Square Format — Square image for social media or product photos
TypeScript
const response = await env.AI.run(
'alibaba/wan-2.6-image',
{
prompt:
'A sleek wireless headphone on a minimalist white marble surface with soft studio lighting',
size: '1024x1024',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Negative Prompt — Guide generation away from unwanted elements
TypeScript
const response = await env.AI.run(
'alibaba/wan-2.6-image',
{
prompt:
'A detailed oil painting portrait of a Renaissance nobleman with intricate lace collar',
negative_prompt: 'modern clothing, photograph, blurry, low quality',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Portrait Format — Tall vertical image for portraits
TypeScript
const response = await env.AI.run(
'alibaba/wan-2.6-image',
{
prompt:
'An elegant Art Deco poster featuring a jazz singer under a spotlight',
size: '768x1024',
},
{
gateway: { id: 'default' },
}
)
console.log(response)

Parameters

prompt
stringrequired
size
stringpattern: ^\d+x\d+$
negative_prompt
string
n
numberconst: 1

API Schemas

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"prompt": {
"type": "string"
},
"size": {
"type": "string",
"pattern": "^\\d+x\\d+$"
},
"negative_prompt": {
"type": "string"
},
"n": {
"type": "number",
"const": 1
}
},
"required": [
"prompt"
],
"additionalProperties": false
}