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

# Wan Image Editing

Wan 2.6 Image supports editing and interleaved text and image output for a variety of generation and integration needs. Wan 2.5 general image editing uses text instructions and one or more reference images to preserve subjects across edits or combine multiple images.

### Model parameters

* Model IDs: `wan2.6-image`/`wan2.5-i2i-preview`
* Pricing: Check the [Model Hub](https://geekai.co/models?platform=dashscope\&type=image) for current prices.
* Endpoint: `https://geekai.co/api/v1/images/generations`
* Parameters: See the [Image API reference](https://docs.geekai.co/en/api/image/generations.md).
* Authentication: [Get an API key](https://docs.geekai.co/en/docs/quick_start.md).

> [!NOTE]
>
> The following Image API parameters are not supported:
>
> * `strength`
> * `aspect_ratio`
> * `quality`
> * `style_preset`
> * `response_format`
> * `output_format`
> * `mask`
> * `background`
>
> See also: [Official Wan Image Generation and Editing 2.6 API documentation](https://help.aliyun.com/zh/model-studio/wan-image-generation-api-reference).

For wan2.6-image, use `size` to set the output resolution as width × height:

Common recommended resolutions and their aspect ratios:

| Aspect ratio | Pixel dimensions |
| - | - |
| 1:1 | 1280x1280 or 1024x024 |
| 2:3 | 800x1200 |
| 3:2 | 1200x800 |
| 4:3 | 1280x960 |
| 3:4 | 960x1280 |
| 16:9 | 1280x720 |
| 9:16 | 720x1280 |
| 21:9 | 1344x576 |

The total pixel count must be within `[768x768, 1280x1280]` and the aspect ratio within `[1:4, 4:1]`.

Input image limits:

* wan2.6-image accepts image URLs or Base64-encoded strings:

  * When `enable_interleave=true` (interleaved text and image output), supply 0–1 images.
  * When `enable_interleave=false` (image editing), you must supply 1–4 images.

Use `enable_interleave` to control the generation mode:

* false: Image editing mode (default). Supports multiple inputs and consistent subjects.

  * Use case: Edit, transfer styles, or generate images with consistent subjects based on 1–4 inputs.
  * Input: At least 1 reference image is required.
  * Output: 1–4 images.

* true: Interleaved text and image mode. Accepts at most one image.

  * Use case: Generate illustrated content from a description, or generate an image from text alone.
  * Input: No image (text-to-image) or 1 reference image.
  * Output: Exactly 1 mixed content block containing text and images.

Use `n` to specify the number of outputs. Its range and meaning depend on `enable_interleave`:

* `enable_interleave=false` (image editing mode):

  * Purpose: Directly controls the number of images generated.
  * Range: 1–4.

* `enable_interleave=true` (interleaved text and image mode):

  * Limit: Defaults to 1 and must remain 1. Other values return an error.
  * The model decides how many images to generate in this mode. Use `max_images` to set an upper limit.

Use `max_images` to set an upper limit of 1–5 images. The model determines the actual count from the content, not at random, and may generate fewer images. For example, a limit of 5 might produce 3 images. You cannot specify an exact count.

For wan2.5-i2i-preview, use `size` to set the output resolution as width × height:

Recommended resolutions and aspect ratios:

| Aspect ratio | Pixel dimensions |
| - | - |
| 1:1 | 1280x1280 |
| 1:1 | 1024x1024 |
| 2:3 | 800x1200 |
| 3:2 | 1200x800 |
| 4:3 | 1280x960 |
| 3:4 | 960x1280 |
| 16:9 | 1280x720 |
| 9:16 | 720x1280 |
| 21:9 | 1344x576 |

The total pixel count must be within `[768x768, 1280x1280]` and the aspect ratio within `[1:4, 4:1]`.

Input image limit: wan2.5-i2i-preview accepts up to 3 images.

Use `n` to set the number of generated images (1–4).

### wan2.6-image

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "wan2.6-image",
    "prompt": "Generate a dish of stir-fried tomatoes and eggs using the style of image 1 and the background of image 2",
    "image": ["https://cdn.wanx.aliyuncs.com/tmp/pressure/umbrella1.png","https://img.alicdn.com/imgextra/i3/O1CN01SfG4J41UYn9WNt4X1_!!6000000002530-49-tps-1696-960.webp"],
    "negative_prompt": "Low quality",
    "size": "1280x1280"
}'
```

The response is a JSON object containing the URL of the generated image:

```json theme={null}
{
    "model": "wan2.6-image",
    "created": 1767774573,
    "task_id": "46b38e93-9be0-451f-91f4-3db020dd3bcb",
    "task_status": "succeed",
    "data": [
        {
            "url": "https://static.geekai.co/image/2026/01/07/8fee7dbc22368ada8a77ed4c67a73a51.png"
        }
    ],
    "usage": {
        "billed_units": 1
    }
}
```

When interleaved text and image output is enabled (`enable_interleave` is true):

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "wan2.6-image",
    "prompt": "Generate a close-up of the dog lying on the grass",
    "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_imageToimage.png",
    "negative_prompt": "Low quality",
    "size": "960x1280",
    "n": 1,
    "extra_body": {
        "enable_interleave": true,
        "max_images": 4
    }
}'
```

The response is a JSON object containing the URL of the generated image:

```json theme={null}
{
    "model": "wan2.6-image",
    "created": 1767775609,
    "task_id": "7014d7ce-5b9a-44e0-8ef3-51d09e01dbf6",
    "task_status": "succeed",
    "data": [
        {
            "url": "https://static.geekai.co/image/2026/01/07/16d7161ced1a067dce8f4a3a65185f11.png"
        },
        {
            "url": "https://static.geekai.co/image/2026/01/07/0fb6b10bf130d59e6b89f2254912dae1.png"
        },
        {
            "url": "https://static.geekai.co/image/2026/01/07/167939c7a8593a3ae903a0f28ea9ca61.png"
        }
    ],
    "usage": {
        "billed_units": 3
    }
}
```

### wan2.5-i2i-preview

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "wan2.5-i2i-preview",
    "prompt": "Using this kitten photo as a reference, generate an image of the kitten playing with a ball of yarn",
    "image": "https://static.geekai.co/image/2025/12/29/398b72b457492fbe36c9ac6efc69121b.jpeg",
    "negative_prompt": "Low quality",
    "size": "1280x1280",
    "watermark": false,
    "n": 2
}'
```

The response is a JSON list containing the generated image URLs:

```json theme={null}
{
    "model": "wan2.5-i2i-preview",
    "created": 1767844458,
    "task_id": "def5729d-756d-4f43-8e3c-d18611e9f85d",
    "task_status": "succeed",
    "data": [
        {
            "url": "https://static.geekai.co/image/2026/01/08/e882ee78e340213091c2587ed46aa7bd.png"
        },
        {
            "url": "https://static.geekai.co/image/2026/01/08/da2210a94d64b523408bfe67d4aa2568.png"
        }
    ],
    "usage": {
        "billed_units": 2
    }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.