Wan Text to Image
Calls Ali wan2.7-image-pro or wan2.7-image to perform text-to-image generation.
The public calling convention keeps top-level model, input, response_format, and exposes size, n, watermark, thinking_mode, enable_sequential, color_palette, seed as top-level fields. The prompt is placed in input.messages[0].content[0].text. The request body does not accept a top-level parameters field.
Authorizations
Body
Controls output image resolution. Supports two modes (do not mix):
Mode 1: Resolution preset (recommended)
Supported presets: 1K, 2K (default), 4K.
- Text-to-image (no input image, non-sequential): supports 1K, 2K, 4K.
- Other scenarios: supports 1K, 2K.
- Pixel totals: 1K = 1024×1024, 2K = 2048×2048, 4K = 4096×4096.
- With input image: output aspect ratio matches the last input image, scaled to the selected resolution.
- Without input image: output is square.
Mode 2: Custom width×height
Format: {width}*{height}, e.g. 1024*768.
- Text-to-image: total pixels [768×768, 4096×4096], aspect ratio [1:8, 8:1].
- Other scenarios: total pixels [768×768, 2048×2048], aspect ratio [1:8, 8:1].
Note: actual output dimensions may differ slightly from the specified values.
Important: n directly affects cost. Cost = unit price × number of successfully generated images. Confirm the model pricing before calling.
Required range: 1 <= n <= 12.
Non-sequential mode: range 1-4, default 1.
Sequential mode: range 1-12, default 12. The actual count is determined by the model and will not exceed n.
1 <= x <= 12Random seed. Range [0, 2147483647].
Using the same seed value helps keep generation results relatively stable. If not provided, the algorithm automatically uses a random seed.
Note: the generation process is probabilistic; the same seed does not guarantee identical results every time.
x >= 0