> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyfast.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Wan2.7 Image / Pro

> Generate, edit, and create image sequences with wan2.7-image and wan2.7-image-pro through AnyFast.

Wan2.7 Image is Alibaba's image generation and editing model family. Through AnyFast, both variants use the same synchronous endpoint and DashScope-compatible message structure.

| Model ID           | Description                                                                              |
| ------------------ | ---------------------------------------------------------------------------------------- |
| `wan2.7-image-pro` | Professional variant. Text-to-image requests without sequential output support up to 4K. |
| `wan2.7-image`     | Standard variant optimized for faster generation. Supports up to 2K.                     |

## Capabilities

* **Text-to-image** — Generate one or more images from a text prompt
* **Image editing** — Edit up to 9 input images with text instructions
* **Interactive editing** — Limit edits to regions defined by `bbox_list`
* **Sequential generation** — Create a related image sequence from text or image references
* **Multi-image reference** — Place multiple `{ "image": "..." }` items in one content array

<Warning>
  `parameters.prompt_extend` defaults to `true`. For special-content requests, select the **Special-Ns** resource group and set this parameter to `false`.
</Warning>

<Info>
  The endpoint accepts the existing flat OpenAI-compatible format and the newly adapted nested DashScope-compatible format shown in the AnyFast examples. Use the flat format for simple generation or single-image editing, and the nested format for multiple images, region editing, or sequential generation.
</Info>

## Request format

Send requests to `POST /v1/images/generations`. The following examples show both supported request formats.

<CodeGroup>
  ```bash Text-to-image theme={null}
  curl https://www.anyfast.ai/v1/images/generations \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "wan2.7-image",
      "prompt": "A cinematic flower shop with detailed windows and a wooden door",
      "size": "2K",
      "n": 1,
      "watermark": false,
      "thinking_mode": true
    }'
  ```

  ```bash Single-image editing theme={null}
  curl https://www.anyfast.ai/v1/images/generations \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "wan2.7-image-pro",
      "prompt": "Replace the vase with a bouquet of red roses",
      "image": "https://example.com/room.png",
      "size": "2K",
      "n": 1
    }'
  ```

  ```bash Multi-image editing theme={null}
  curl https://www.anyfast.ai/v1/images/generations \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H 'X-DashScope-DataInspection: {"input":"disable","output":"disable"}' \
    -H "Content-Type: application/json" \
    -d '{
      "model": "wan2.7-image-pro",
      "input": {
        "messages": [
          {
            "role": "user",
            "content": [
              {"image": "https://example.com/person.png"},
              {"image": "https://example.com/background.png"},
              {"text": "Place the person from image 1 into the setting from image 2"}
            ]
          }
        ]
      },
      "parameters": {
        "size": "2K",
        "n": 1,
        "watermark": false,
        "thinking_mode": true,
        "prompt_extend": true
      }
    }'
  ```

  ```bash Interactive editing theme={null}
  curl https://www.anyfast.ai/v1/images/generations \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "wan2.7-image-pro",
      "input": {
        "messages": [
          {
            "role": "user",
            "content": [
              {"image": "https://example.com/room.png"},
              {"text": "Replace the selected vase with red roses"}
            ]
          }
        ]
      },
      "parameters": {
        "size": "2K",
        "n": 1,
        "bbox_list": [
          [[420, 280, 760, 720]]
        ],
        "prompt_extend": true
      }
    }'
  ```

  ```bash Sequential generation theme={null}
  curl https://www.anyfast.ai/v1/images/generations \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "wan2.7-image-pro",
      "input": {
        "messages": [
          {
            "role": "user",
            "content": [
              {"text": "Create a four-image cinematic sequence of the same orange cat across spring, summer, autumn, and winter"}
            ]
          }
        ]
      },
      "parameters": {
        "size": "2K",
        "enable_sequential": true,
        "n": 4,
        "watermark": false,
        "prompt_extend": true
      }
    }'
  ```
</CodeGroup>

## Input rules

### Flat OpenAI-compatible format

| Field           | Type    | Description                                                            |
| --------------- | ------- | ---------------------------------------------------------------------- |
| `model`         | string  | `wan2.7-image` or `wan2.7-image-pro`                                   |
| `prompt`        | string  | Chinese or English prompt, up to 5,000 characters                      |
| `image`         | string  | Optional public image URL or Base64 data URI for single-image editing  |
| `size`          | string  | Output size such as `1K` or `2K`; Pro text-to-image also supports `4K` |
| `n`             | integer | Number of generated images                                             |
| `thinking_mode` | boolean | Enables thinking mode for text-to-image                                |
| `watermark`     | boolean | Adds the fixed AI-generated watermark                                  |
| `seed`          | integer | Random seed from 0 to 2,147,483,647                                    |

### Nested DashScope-compatible format

| Field              | Requirement                                          |
| ------------------ | ---------------------------------------------------- |
| `input.messages`   | One message with `role: "user"`                      |
| `content[].text`   | Chinese or English prompt, up to 5,000 characters    |
| `content[].image`  | Public HTTP/HTTPS URL or Base64 data URI             |
| Image formats      | JPEG, JPG, PNG without transparency, BMP, WEBP       |
| Image size         | Up to 20 MB per image; width and height 240–8,000 px |
| Image aspect ratio | From 1:8 to 8:1                                      |
| Image count        | 0–9 images; array order defines image order          |

## Parameters

| Parameter                      | Type    | Default     | Description                                                                                                                                  |
| ------------------------------ | ------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `parameters.size`              | string  | `2K`        | `wan2.7-image-pro`: 1K, 2K, or 4K for non-sequential text-to-image; other modes support up to 2K. `wan2.7-image`: 1K or 2K.                  |
| `parameters.n`                 | integer | `1` or `12` | Non-sequential mode: 1–4, default 1. Sequential mode: maximum output count 1–12, default 12. Billing follows successfully generated images.  |
| `parameters.enable_sequential` | boolean | `false`     | Enables text-to-sequence or image-to-sequence generation.                                                                                    |
| `parameters.thinking_mode`     | boolean | `true`      | Improves text-to-image quality. Only applies with no image input and sequential mode disabled.                                               |
| `parameters.prompt_extend`     | boolean | `true`      | Controls AnyFast prompt extension. For special-content requests, select the **Special-Ns** resource group and set this parameter to `false`. |
| `parameters.bbox_list`         | array   | —           | Region boxes for interactive editing. Provide one list per input image; each image supports up to two `[x1, y1, x2, y2]` boxes.              |
| `parameters.color_palette`     | array   | —           | 3–10 HEX colors and percentage ratios totaling `100.00%`; available only when sequential mode is disabled.                                   |
| `parameters.watermark`         | boolean | `false`     | Adds the fixed AI-generated watermark in the lower-right corner.                                                                             |
| `parameters.seed`              | integer | Random      | Integer from 0 to 2,147,483,647. Equal seeds can produce similar, but not identical, results.                                                |

When images are supplied, the output uses the aspect ratio of the last input image and scales it to the selected resolution. Generated dimensions can differ slightly from custom dimensions.

## Response

AnyFast returns the generated image in `data` and preserves the upstream Wan response under `metadata`.

```json theme={null}
{
  "data": [
    {
      "url": "https://dashscope-result.example.com/generated.png",
      "b64_json": "",
      "revised_prompt": ""
    }
  ],
  "created": 1784274013,
  "metadata": {
    "output": {
      "choices": [
        {
          "finish_reason": "stop",
          "message": {
            "content": [
              {
                "image": "https://dashscope-result.example.com/generated.png",
                "type": "image"
              }
            ],
            "role": "assistant"
          }
        }
      ],
      "finished": true
    },
    "usage": {
      "image_count": 1,
      "input_tokens": 25,
      "output_tokens": 2,
      "size": "2048*2048",
      "total_tokens": 27
    },
    "request_id": "f30f2d2b-e0ee-9a47-ba5e-68b66360fe47"
  }
}
```

Generated URLs are retained for 24 hours by the upstream service. Download outputs promptly rather than storing these URLs permanently.

<Card title="API Reference" icon="code" href="/api-reference/model-api/alibaba/wan2.7-image">
  Open the Wan2.7 Image / Pro API reference.
</Card>

<script src="/feedback.js" />
