WaveSpeedAI APIAlibabaAlibaba Wan 2.6 Text To Image

Alibaba Wan 2.6 Text To Image

Alibaba Wan 2.6 Text To Image

Playground

Try it on WavespeedAI!

Alibaba WAN 2.6 Text-to-Image turns text prompts into AI-generated images with the WAN 2.6 model for on-demand image creation. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.

Features

Alibaba Wan 2.6 Text-to-Image

Wan 2.6 Text-to-Image is Alibaba’s text-to-image model for generating PNG images from a single prompt. It’s designed for practical creative workflows—concept art, product visuals, portraits, and stylized imagery—where you want strong prompt adherence plus flexible output sizing.


Key capabilities

  • Single-request (synchronous) generation Generate images and get results back in one request (no separate polling flow).

  • Flexible custom dimensions Choose width*height freely as long as the total pixel area stays within the allowed range and the aspect ratio is within [1:4, 4:1].

  • Prompt rewriting via prompt_extend Optional prompt expansion can improve results for short/simple prompts (at the cost of a few extra seconds).

  • Negative prompting for tighter control Use negative_prompt to suppress unwanted artifacts (e.g., “blurry, low quality, extra fingers”).

  • Batch generation (n images per run) Generate 1–4 images per request; n directly affects cost (price scales with image count).

  • Reproducibility with seed Set seed for more consistent outputs across runs (results may still vary slightly).

  • Optional watermark control Toggle an “AI-generated” watermark in the lower-right corner.


Parameters and how to use

  • prompt: (required) The text instruction describing the image you want.
  • negative_prompt: What you want to avoid in the output image.
  • size: Output resolution as width*height.
  • n: Number of images to generate (1–4).
  • prompt_extend: Enable/disable prompt rewriting.
  • watermark: Enable/disable watermark.
  • seed: Random seed for more consistent results.

Prompt

Write prompts that are concrete and visual:

  • Start with subject + setting + style: “A modern tea shop interior, warm afternoon light, minimalist wood design, cinematic photography”
  • Add composition/camera when you care about framing: “medium shot, shallow depth of field, 35mm look”
  • If you need cleaner outputs, pair with a short negative prompt: “blurry, low-res, watermark, extra limbs, distorted hands”
  • Prompt language: Chinese and English are supported; prompts longer than the documented limit may be truncated.

Other parameters

  1. prompt (required) The positive prompt text that describes the content, style, and composition.

  2. size Format: width*height.

    • For wan2.6-t2i, total pixels must be between 768×768 and 1440×1440, and aspect ratio must be within [1:4, 4:1]. Common starting points:
    • 1:1 → 1280*1280 or 1024*1024
    • 16:9 → 1280*720
    • 9:16 → 720*1280
  3. negative_prompt Short list of undesired attributes. Max length is limited by the upstream API (extra text may be truncated).

  4. enable_prompt_expansion

    • true (default): improves results for short prompts; adds latency (often a few seconds).
    • false: faster; you control all detail manually.
  5. seed Integer in [0, 2147483647]. Use a fixed seed to reduce randomness; omit for fresh variations each run.

After you finish configuring the parameters, click Run, preview the result, and iterate if needed.


Pricing

Each run cost $0.03.


Notes

  • If you turn on enable_prompt_expansion, expect slightly higher latency; it’s best when your prompt is short or under-specified.
  • The image URLs returned by the upstream API may be time-limited—download and store outputs promptly if you need to keep them.

Authentication

For authentication details, please refer to the Authentication Guide.

API Endpoints

Submit Task & Query Result


# Submit the task
curl --location --request POST "https://api.wavespeed.ai/api/v3/alibaba/wan-2.6/text-to-image" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${WAVESPEED_API_KEY}" \
--data-raw '{
    "size": "1024*1024",
    "enable_prompt_expansion": false,
    "seed": -1
}'

# Get the result
curl --location --request GET "https://api.wavespeed.ai/api/v3/predictions/${requestId}/result" \
--header "Authorization: Bearer ${WAVESPEED_API_KEY}"

Parameters

Task Submission Parameters

Request Parameters

ParameterTypeRequiredDefaultRangeDescription
promptstringYes-The positive prompt for the generation.
sizestringNo1024*1024768 ~ 1440 per dimensionThe size of the generated image in pixels (width*height).
enable_prompt_expansionbooleanNofalse-If set to true, the prompt optimizer will be enabled.
seedintegerNo-1-1 ~ 2147483647The random seed to use for the generation. -1 means a random seed will be used.

Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
data.idstringUnique identifier for the prediction, Task Id
data.modelstringModel ID used for the prediction
data.outputsarrayArray of URLs to the generated content (empty when status is not completed)
data.urlsobjectObject containing related API endpoints
data.urls.getstringURL to retrieve the prediction result
data.has_nsfw_contentsarrayArray of boolean values indicating NSFW detection for each output
data.statusstringStatus of the task: created, processing, completed, or failed
data.created_atstringISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”)
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds

Result Request Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Task ID

Result Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
dataobjectThe prediction data object containing all details
data.idstringUnique identifier for the prediction, the ID of the prediction to get
data.modelstringModel ID used for the prediction
data.outputsobjectArray of URLs to the generated content (empty when status is not completed).
data.urlsobjectObject containing related API endpoints
data.urls.getstringURL to retrieve the prediction result
data.statusstringStatus of the task: created, processing, completed, or failed
data.created_atstringISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”)
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds
© 2025 WaveSpeedAI. All rights reserved.