Wan-Image
Copy success!
Overview
Wan2.7–image-pro,supports text to image, text/image to sequential images, image editing, multi-image reference generation, and interactive editing. Delivers enhanced performance in text rendering, subject consistency, and complex instruction following.
Input
ImageText
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.075Per image
Rate Limits
- Concurrency5concurrent
- Async Queue Limit500tasks
- RPMRequests Per Minute300
API Reference
Call APICopy success!
1234567891011121314151617181920212223242526272829
import os
import dashscope
from dashscope.aigc.image_generation import ImageGeneration
from dashscope.api_entities.dashscope_response import Message
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'
api_key = os.getenv("DASHSCOPE_API_KEY")
message = Message(
role="user",
content=[
{
"text": "A cinematic photo series documenting the same stray ginger cat, ensuring its physical characteristics remain consistent across all images. Image 1: Spring—the ginger cat weaves beneath blooming cherry blossom trees. Image 2: Summer—the cat seeks respite from the heat in the shade of trees along an old street. Image 3: Autumn—the cat walks across a ground carpeted with golden fallen leaves. Image 4: Winter—the cat traverses the snow, leaving a trail of paw prints behind."
}
]
)
print("----sync call, please wait a moment----")
rsp = ImageGeneration.call(
model='wan2.7-image-pro',
api_key=api_key,
messages=[message],
enable_sequential=True,
n=4,
size="2K"
)
print(rsp)