Wan Image Edit
Calls Ali wan2.7-image-pro to perform image editing.
The public calling convention keeps top-level model, input, response_format, and exposes size, n, watermark, negative_prompt, seed, bbox_list as top-level fields. Input images are placed in input.messages[0].content[].image, and the editing instruction is in a text item within the same array. The request body does not accept a top-level parameters field.
Authorizations
Pass Authorization: Bearer <token> in the request header.
Body
Model name. Available value: wan2.7-image-pro.
wan2.7-image-pro Unified response format. Supported values: url or b64_json.
url, b64_json 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.
When group mode is disabled, this value represents the number of generated images. Range: 1-4, default: 1.
When group mode is enabled, this value represents the maximum number of generated images. Range: 1-12, default: 12. The actual count is determined by the model and will not exceed n.
1 <= x <= 12Whether to add a watermark. The watermark is positioned at the bottom-right corner with the text 'AI生成'. false (default): no watermark. true: add watermark.
Negative prompt. Describes what should be avoided in the output.
Random 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.
0 <= x <= 2147483647Interactive editing bounding box regions.
Correspondence: The list length must match the number of input images. If an image does not need editing, pass an empty array [] at the corresponding position.
Coordinate format: [x1, y1, x2, y2] (top-left x, top-left y, bottom-right x, bottom-right y), using absolute pixel coordinates of the original image, with (0,0) at the top-left corner.
Constraint: Maximum 2 bounding boxes per image.
Example: Input 3 images where the 2nd image has no selection, and the 1st has two selections: