> ## 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

> Wan2.7 image generation and editing model via Alibaba via AnyFast API.

Wan2.7 Image is Alibaba's latest multimodal image model available through AnyFast. It supports text-to-image, image editing, interactive region editing, and group image generation, with up to 4K output resolution.

## Models

| Model ID           | Description                                                 |
| ------------------ | ----------------------------------------------------------- |
| `wan2.7-image-pro` | Professional variant. Supports 4K output for text-to-image. |
| `wan2.7-image`     | Standard variant. Faster generation speed.                  |

## Key capabilities

* **Text-to-image** — Generate images from text prompts
* **Image editing** — Edit an existing image guided by a text prompt (0–9 input images)
* **Interactive editing** — Edit specific regions using bounding boxes (`bbox_list`)
* **Group image generation** — Generate multiple related images in one request (`enable_sequential`)
* **Thinking mode** — Enhanced reasoning for better quality in text-to-image

## Quick example

<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-pro",
      "prompt": "A flower shop with exquisite windows and a beautiful wooden door",
      "size": "2K",
      "thinking_mode": true
    }'
  ```

  ```bash 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": "Change the vase to a bouquet of red roses",
      "image": "https://example.com/room.jpg",
      "size": "2K"
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://www.anyfast.ai/v1/images/generations",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      json={
          "model": "wan2.7-image-pro",
          "prompt": "A flower shop with exquisite windows and a beautiful wooden door",
          "size": "2K",
          "thinking_mode": True
      }
  )

  result = response.json()
  print(result["data"][0]["url"])
  ```
</CodeGroup>

## Parameters

| Parameter           | Type    | Required | Description                                                                                                      |
| ------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------- |
| `model`             | string  | Yes      | `wan2.7-image-pro` or `wan2.7-image`                                                                             |
| `prompt`            | string  | Yes      | Text description. Max 5000 characters.                                                                           |
| `image`             | string  | No       | Input image URL or Base64 data URI for editing. Supports JPEG, JPG, PNG, BMP, WEBP. Max 20 MB. Up to 9 images.   |
| `n`                 | integer | No       | Number of images. Sequential mode off: `1–4`, default `1`. Sequential mode on: `1–12`, default `12`.             |
| `size`              | string  | No       | `1K`, `2K` (default), or `4K` (wan2.7-image-pro text-to-image only). Also accepts custom `{W}x{H}` pixels.       |
| `enable_sequential` | boolean | No       | Enable group image output mode. Default: `false`.                                                                |
| `thinking_mode`     | boolean | No       | Enhanced reasoning for higher quality. Default: `true`. Only for text-to-image (no image input, sequential off). |
| `watermark`         | boolean | No       | Add watermark to output. Default: `false`.                                                                       |
| `seed`              | integer | No       | Random seed `[0, 2147483647]` for reproducible results.                                                          |
| `response_format`   | string  | No       | `url` (default) or `b64_json`.                                                                                   |

### Size reference

| Size | Pixels                                           |
| ---- | ------------------------------------------------ |
| 1K   | 1024×1024                                        |
| 2K   | 2048×2048                                        |
| 4K   | 4096×4096 (wan2.7-image-pro, text-to-image only) |

When an input image is provided, the output aspect ratio matches the input and is scaled to the selected resolution.

## Response

| Field                   | Description                                         |
| ----------------------- | --------------------------------------------------- |
| `data[].url`            | Generated image URL (PNG, valid 24 hours)           |
| `data[].b64_json`       | Base64 image (only when `response_format=b64_json`) |
| `data[].revised_prompt` | AI-expanded prompt actually used                    |
| `created`               | Unix timestamp                                      |

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

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