Wan 2.7 Image API
Complete API reference for Wan 2.7 image generation models powered by Alibaba.
Model Variants
This API supports four model variants:
Quick Comparison
Supported Aspect Ratios
Both Standard and Pro models support 7 aspect ratios:
16:9,9:16,1:1,4:3,3:4,3:2,2:3
Wan 2.7 Image (Text-to-Image)
Endpoint
POST /api/v1/image/task
Authentication
Authorization: Bearer YOUR_API_KEY
Request Parameters
Required
Note: The width:height ratio must be one of: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3
Optional
Example Request
javascript
Wan 2.7 Image Edit (Image Editing)
Endpoint
POST /api/v1/image/task
Request Parameters
Required
Note: The width:height ratio must be one of: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3
Optional
Single Image Edit Example
javascript
Multi-Image Composition Example
Up to 9 images can be combined in a single request:
javascript
Wan 2.7 Image Pro (Text-to-Image)
Uses the same parameters as Wan 2.7 Image, with model_name set to wan-v2.7-image-pro for enhanced output quality.
Example Request
javascript
Wan 2.7 Image Pro Edit (Image Editing)
Uses the same parameters as Wan 2.7 Image Edit, with model_name set to wan-v2.7-image-pro-edit for enhanced output quality.
Example Request
javascript
Response Format
Initial Response
All models return a task_id for polling:
json
Polling Response
Poll GET /api/v1/image/{taskId} to check status:
json
Status Values
submitted: Task acceptedprocessing: Generation in progresssucceed: Generation completed successfullyfailed: Generation failed
Error Handling
Common Errors
Invalid Aspect Ratio
json
Missing Image URL (Edit Mode)
json
Too Many Images (Edit Mode)
json
Unauthorized
json
Best Practices
Text-to-Image Tips
- Be Specific: Include subject, style, lighting, and composition details in your prompt
- Aspect Ratio Selection: Choose ratio based on your use case (16:9 for web banners, 9:16 for mobile, 1:1 for social media)
- Use Seed for Reproducibility: Set a fixed
seedvalue when you need consistent results across requests - Standard vs Pro: Use Standard for high-volume workflows; use Pro when output quality is the priority
Image Editing Tips
- Clear Instructions: Be specific about what to change in the prompt
- Multi-Image Composition: Provide up to 9 images and describe how they should be combined
- Prompt Guidance: Describe the desired outcome rather than just listing changes
- Image Quality: Higher quality input images generally produce better editing results