Wan-T2I

Copy success!
Add to Compare

Overview

The upgraded Wan2.5 Preview text to image model, newly upgraded model architecture significantly enhances visual aesthetics, design sensibility, and realistic texture. It excels in precise instruction adherence, generates text proficiently in English, Chinese, and less common languages, and supports the generation of complex structured long texts, charts, and architectural diagrams.

Input

Text

Output

Image

Features

Prefix Completion

Enable Partial Mode when calling the Qwen API to make the model continue strictly from your provided prefix text.View docs

Function Calling

Use function calling to connect large language models with external tools and systems.View docs

Cache

Context Cache stores shared prefixes for long-context requests to reduce repeated computation, improve latency, and lower cost.View docs

Structured Outputs

Structured Outputs help ensure the model returns a JSON string in the expected format.View docs

Batches

Asynchronously process requests in batches to reduce costs.View docs

Web Search

Enable web search so the model can answer with real-time retrieved data.View docs

Fine-tuning

Train models on sample data to better adapt them to specific tasks.View docs

Pricing

  • Image Generation
    $0.03Per image

Rate Limits

  • Concurrency
    5concurrent
  • Async Queue Limit
    500tasks
  • RPMRequests Per Minute
    300

API Reference

Call API
Copy success!
123456789101112131415161718192021222324252627
from http import HTTPStatus
from urllib.parse import urlparse, unquote
from pathlib import PurePosixPath
import requests
from dashscope import ImageSynthesis
import os
import dashscope

dashscope.base_http_api_url = 'https://ap-southeast-1.maas.qwencloudapi.com/api/v1'
prompt = "A flower shop with delicate windows, a beautiful wooden door, and flowers on display"

print('----sync call, please wait a moment----')
rsp = ImageSynthesis.call(api_key=os.getenv("DASHSCOPE_API_KEY"),
                          model="wan2.5-t2i-preview",
                          prompt=prompt,
                          n=1,
                          size='1280*1280')
print('response: %s' % rsp)
if rsp.status_code == HTTPStatus.OK:
    # Save the image in the current directory
    for result in rsp.output.results:
        file_name = PurePosixPath(unquote(urlparse(result.url).path)).parts[-1]
        with open('./%s' % file_name, 'wb+') as f:
            f.write(requests.get(result.url).content)
else:
    print('sync_call Failed, status_code: %s, code: %s, message: %s' %
          (rsp.status_code, rsp.code, rsp.message))