Wan-T2I
Copy success!
Try AIAdd to Compare
Overview
Newly upgraded Wan 2.2 Text-to-Image offers faster generation speed. Fully upgraded creativity, stability, and photorealism, stronger instruction following, and native support for multiple styles. Supports up to 2 MP generation and smart prompt rewriting.
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 docsFunction Calling
Use function calling to connect large language models with external tools and systems.View docsCache
Context Cache stores shared prefixes for long-context requests to reduce repeated computation, improve latency, and lower cost.View docsStructured Outputs
Structured Outputs help ensure the model returns a JSON string in the expected format.View docsPricing
- Image Generation$0.025Per image
Rate Limits
- Concurrency2concurrent
- Async Queue Limit500tasks
- RPMRequests Per Minute120
API Reference
Call APICopy 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://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.2-t2i-flash",
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))