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

# Wan2.7 Image

> Generate or edit images with Wan2.7 Image. Supports text-to-image, image editing, and sequential image generation.



## OpenAPI

````yaml en/api-reference/model-api/alibaba/openapi/wan2.7-image/openapi.yaml POST /v1/images/generations
openapi: 3.1.0
info:
  title: Wan2.7 Image
  description: Call Alibaba Wan image generation and editing 2.7 model
  version: 1.0.0
servers:
  - url: https://ai.cubeuaeai.com
security:
  - bearerAuth: []
paths:
  /v1/images/generations:
    post:
      summary: Image generation / editing
      description: |
        Generate or edit images with Wan2.7 Image. Multiple modes are supported:
        - **Text-to-image**: provide `prompt` only
        - **Image editing**: provide `prompt` + `image`
        - **Sequential images**: "set `enable_sequential: true`"

        The API returns the final image URL synchronously.
      operationId: createWan27Image
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - prompt
              properties:
                model:
                  type: string
                  enum:
                    - wan2.7-image-pro
                    - wan2.7-image
                  description: >-
                    Model ID. `wan2.7-image-pro` text-to-image supports 4K
                    output; `wan2.7-image` generates faster.
                  example: wan2.7-image-pro
                prompt:
                  type: string
                  description: >-
                    Image description. Chinese and English are supported.
                    Maximum 5000 characters.
                  example: >-
                    A flower shop with delicate windows, a beautiful wooden
                    door, and flowers on display
                image:
                  type: string
                  description: >
                    Input image for editing — URL (HTTP/HTTPS) or Base64 data
                    URI（`data:{MIME};base64,{data}`）。

                    Supported formats: JPEG, JPG, PNG (no alpha channel), BMP,
                    WEBP. Max 20 MB, width/height 240–8000 px, aspect ratio
                    1:8–8:1. Up to 9 images.
                  example: https://example.com/input.jpg
                'n':
                  type: integer
                  minimum: 1
                  maximum: 12
                  default: 1
                  description: >
                    Number of images to generate.

                    - Sequential mode off (`enable_sequential: "false`): `1–4`,
                    default `1`."

                    - Sequential mode on (`enable_sequential: "true`): `1–12`,
                    default" `12`. The actual count is decided by the model.
                  example: 1
                size:
                  type: string
                  description: >
                    Output resolution. Two formats are supported (do not mix
                    them):

                    - Presets: `1K` (1024×1024), `2K` (2048×2048, default), `4K`
                    (4096×4096, only wan2.7-image-pro text-to-image).

                    - Custom pixels: `{width}x{height}` — text-to-image total
                    pixels 768×768–4096×4096; other modes up to 2048×2048,
                    aspect ratio 1:8–8:1.
                  example: 2K
                enable_sequential:
                  type: boolean
                  default: false
                  description: >-
                    Enable sequential image output. When `true`, `n` is the
                    maximum count and the model decides the actual number.
                thinking_mode:
                  type: boolean
                  default: true
                  description: >-
                    Enable thinking mode to improve reasoning and image quality.
                    Only takes effect when there is no image input and
                    sequential mode is off.
                watermark:
                  type: boolean
                  default: false
                  description: >-
                    Whether to add a watermark to the bottom-right corner of the
                    generated image.
                seed:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: >-
                    Random seed, range [0, 2147483647]. The same seed yields
                    similar results but does not guarantee an exact match.
                response_format:
                  type: string
                  enum:
                    - url
                    - b64_json
                  default: url
                  description: Return an image URL or Base64 encoding.
                  example: url
      responses:
        '200':
          description: Image generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  created:
                    type: integer
                    description: Creation timestamp
                    example: 1773803391
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                          description: Image download URL (PNG, valid for 24 hours).
                          example: https://example.com/generated.png
                        b64_json:
                          type: string
                          description: >-
                            Base64-encoded image (returned only when
                            response_format=b64_json).
                        revised_prompt:
                          type: string
                          description: The actual prompt after AI expansion.
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized
        '429':
          description: Rate limit exceeded
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````