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

> Generate or edit images using Wan2.7 Image. Supports multiple modes:
- **Text-to-image**: provide `prompt` only
- **Image editing**: provide `prompt` + `image`
- **Group image generation**: set `enable_sequential: true`

Returns synchronously with the final image URL.




## OpenAPI

````yaml 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: Wan2.7 image generation and editing model via Alibaba via AnyFast API
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /v1/images/generations:
    post:
      summary: Image Generation / Editing
      description: |
        Generate or edit images using Wan2.7 Image. Supports multiple modes:
        - **Text-to-image**: provide `prompt` only
        - **Image editing**: provide `prompt` + `image`
        - **Group image generation**: set `enable_sequential: true`

        Returns synchronously with the final image URL.
      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` supports 4K output for
                    text-to-image; `wan2.7-image` is faster.
                  example: wan2.7-image-pro
                prompt:
                  type: string
                  description: >-
                    Text description of the image. Supports Chinese and English.
                    Max 5000 characters.
                  example: >-
                    A flower shop with exquisite windows and a beautiful wooden
                    door
                image:
                  type: string
                  description: >
                    Input image for editing — URL (HTTP/HTTPS) or Base64 data
                    URI (`data:{MIME};base64,{data}`).

                    Formats: JPEG, JPG, PNG (no transparency), BMP, WEBP. Max 20
                    MB per image. Resolution: 240–8000 px per side, 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`.
                  example: 1
                size:
                  type: string
                  description: >
                    Output resolution. Two formats (cannot mix):

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

                    - Custom pixels: `{W}x{H}` — total pixels 768×768–4096×4096
                    (text-to-image) or up to 2048×2048 (other modes), aspect
                    ratio 1:8–8:1.
                  example: 2K
                enable_sequential:
                  type: boolean
                  default: false
                  description: >-
                    Enable group image output mode. When `true`, `n` represents
                    the maximum number of images; actual count is decided by the
                    model.
                thinking_mode:
                  type: boolean
                  default: true
                  description: >-
                    Enable thinking mode for enhanced reasoning and higher
                    quality. Only effective for text-to-image (no image input,
                    sequential mode off).
                watermark:
                  type: boolean
                  default: false
                  description: Add a watermark to the generated image.
                seed:
                  type: integer
                  minimum: 0
                  maximum: 2147483647
                  description: >-
                    Random seed for reproducible results. Same seed produces
                    similar outputs, though exact reproduction is not
                    guaranteed.
                response_format:
                  type: string
                  enum:
                    - url
                    - b64_json
                  default: url
                  description: Return a URL or Base64-encoded image.
                  example: url
      responses:
        '200':
          description: Image generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  created:
                    type: integer
                    description: Unix timestamp
                    example: 1773803391
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                          description: Image download URL (PNG format, valid 24 hours).
                          example: https://example.com/generated.png
                        b64_json:
                          type: string
                          description: >-
                            Base64-encoded image (only when
                            response_format=b64_json).
                        revised_prompt:
                          type: string
                          description: AI-expanded prompt actually used for generation.
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '429':
          description: Rate limit exceeded
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````