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



## 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 / Pro
  description: >-
    Generate, edit, and create image sequences with wan2.7-image and
    wan2.7-image-pro through AnyFast.
  version: 2.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /v1/images/generations:
    post:
      summary: Generate or edit images
      description: >
        Calls `wan2.7-image` or `wan2.7-image-pro` synchronously. The endpoint
        accepts the existing flat OpenAI-compatible format and the newly adapted
        nested DashScope-compatible format used by AnyFast.


        Supported modes:

        - Text-to-image

        - Multi-image editing and reference generation

        - Interactive region editing with `bbox_list`

        - Text-to-sequence or image-to-sequence generation with
        `enable_sequential`


        `parameters.prompt_extend` defaults to `true`. For special-content
        requests, select the **Special-Ns** resource group and set this
        parameter to `false`.
      operationId: createWan27Image
      parameters:
        - name: X-DashScope-DataInspection
          in: header
          required: false
          description: Optional DashScope data inspection control forwarded by AnyFast.
          schema:
            type: string
          example: '{"input":"disable","output":"disable"}'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Wan27Request'
            examples:
              textToImage:
                summary: Text-to-image (flat OpenAI-compatible format)
                value:
                  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
              singleImageEditing:
                summary: Single-image editing (flat OpenAI-compatible format)
                value:
                  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
              multiImageEditing:
                summary: Multi-image editing
                value:
                  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
                    prompt_extend: true
              interactiveEditing:
                summary: Interactive region editing
                value:
                  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
              sequentialGeneration:
                summary: Sequential image generation
                value:
                  model: wan2.7-image-pro
                  input:
                    messages:
                      - role: user
                        content:
                          - text: >-
                              Create four images of the same orange cat across
                              the four seasons
                  parameters:
                    size: 2K
                    enable_sequential: true
                    'n': 4
                    watermark: false
                    prompt_extend: true
      responses:
        '200':
          description: Images generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Wan27Response'
              example:
                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
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized
        '429':
          description: Rate limit exceeded
components:
  schemas:
    Wan27Request:
      oneOf:
        - $ref: '#/components/schemas/FlatWan27Request'
        - $ref: '#/components/schemas/NestedWan27Request'
      description: Flat OpenAI-compatible request or nested DashScope-compatible request.
    Wan27Response:
      type: object
      required:
        - data
        - created
        - metadata
      properties:
        data:
          type: array
          description: AnyFast-compatible generated image results.
          items:
            type: object
            properties:
              url:
                type: string
                format: uri
                description: >-
                  Temporary generated image URL. Upstream results are retained
                  for 24 hours.
              b64_json:
                type: string
                description: Base64 result field. Empty for URL responses.
              revised_prompt:
                type: string
                description: Revised prompt field. It can be empty.
        created:
          type: integer
          description: Unix creation timestamp.
        metadata:
          type: object
          description: Upstream Wan response and usage details.
          properties:
            output:
              type: object
              properties:
                choices:
                  type: array
                  items:
                    type: object
                    properties:
                      finish_reason:
                        type: string
                        example: stop
                      message:
                        type: object
                        properties:
                          role:
                            type: string
                            example: assistant
                          content:
                            type: array
                            items:
                              type: object
                              properties:
                                image:
                                  type: string
                                  format: uri
                                type:
                                  type: string
                                  example: image
                finished:
                  type: boolean
            usage:
              type: object
              properties:
                image_count:
                  type: integer
                input_tokens:
                  type: integer
                output_tokens:
                  type: integer
                size:
                  type: string
                  example: 2048*2048
                total_tokens:
                  type: integer
            request_id:
              type: string
              description: Upstream request ID.
    FlatWan27Request:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          enum:
            - wan2.7-image-pro
            - wan2.7-image
        prompt:
          type: string
          maxLength: 5000
          description: Text prompt.
        image:
          type: string
          description: >-
            Optional public image URL or Base64 data URI for single-image
            editing.
        size:
          type: string
          default: 2K
          example: 2K
        'n':
          type: integer
          minimum: 1
          maximum: 12
          default: 1
        enable_sequential:
          type: boolean
          default: false
        thinking_mode:
          type: boolean
          default: true
        watermark:
          type: boolean
          default: false
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
        response_format:
          type: string
          enum:
            - url
            - b64_json
          default: url
    NestedWan27Request:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          enum:
            - wan2.7-image-pro
            - wan2.7-image
          description: >-
            Model ID. `wan2.7-image-pro` supports 4K for non-sequential
            text-to-image; `wan2.7-image` supports up to 2K and is faster.
          example: wan2.7-image-pro
        input:
          type: object
          required:
            - messages
          properties:
            messages:
              type: array
              minItems: 1
              maxItems: 1
              description: >-
                A single user message. Multi-turn conversations are not
                supported.
              items:
                type: object
                required:
                  - role
                  - content
                properties:
                  role:
                    type: string
                    enum:
                      - user
                    description: Message role. Must be `user`.
                  content:
                    type: array
                    minItems: 1
                    description: >-
                      Prompt and zero to nine input images. Item order defines
                      image order.
                    items:
                      oneOf:
                        - $ref: '#/components/schemas/TextContent'
                        - $ref: '#/components/schemas/ImageContent'
        parameters:
          $ref: '#/components/schemas/Wan27Parameters'
    TextContent:
      type: object
      required:
        - text
      properties:
        text:
          type: string
          maxLength: 5000
          description: >-
            Chinese or English prompt. Content after 5,000 characters is
            truncated upstream.
          example: A cinematic flower shop with detailed windows and a wooden door
    ImageContent:
      type: object
      required:
        - image
      properties:
        image:
          type: string
          description: >
            Public HTTP/HTTPS URL or Base64 data URI
            (`data:{MIME};base64,{data}`).

            Supported formats: JPEG, JPG, PNG without transparency, BMP, WEBP.
            Maximum 20 MB per image; width and height 240–8,000 px; aspect ratio
            1:8–8:1. A request can contain up to 9 images.
          example: https://example.com/input.png
    Wan27Parameters:
      type: object
      properties:
        size:
          type: string
          default: 2K
          description: >
            Output resolution.

            - `wan2.7-image-pro`: 1K, 2K, or 4K for non-sequential
            text-to-image; other modes support 1K or 2K.

            - `wan2.7-image`: 1K or 2K for all modes.

            Custom dimensions are also accepted within the upstream pixel and
            aspect-ratio limits.
          example: 2K
        'n':
          type: integer
          minimum: 1
          maximum: 12
          description: >-
            Number of images. Non-sequential mode: 1–4, default 1. Sequential
            mode: maximum output count 1–12, default 12.
          example: 1
        enable_sequential:
          type: boolean
          default: false
          description: >-
            Enables text-to-sequence or image-to-sequence generation. Actual
            output count does not exceed `n`.
        thinking_mode:
          type: boolean
          default: true
          description: >-
            Improves text-to-image quality. Only applies when no image is
            supplied and sequential mode is disabled.
        prompt_extend:
          type: boolean
          default: true
          description: >-
            Controls AnyFast prompt extension. For special-content requests,
            select the Special-Ns resource group and set this parameter to
            `false`.
        bbox_list:
          type: array
          description: >-
            Interactive editing boxes. Provide one box list per input image; use
            an empty list when an image has no box. Each image supports up to
            two boxes.
          items:
            type: array
            maxItems: 2
            items:
              type: array
              minItems: 4
              maxItems: 4
              items:
                type: integer
                minimum: 0
              description: Absolute source-image coordinates `[x1, y1, x2, y2]`.
        color_palette:
          type: array
          minItems: 3
          maxItems: 10
          description: >-
            Color theme available when sequential mode is disabled. Ratios must
            total 100.00%.
          items:
            type: object
            required:
              - hex
              - ratio
            properties:
              hex:
                type: string
                pattern: ^#[0-9A-Fa-f]{6}$
                example: '#E63946'
              ratio:
                type: string
                pattern: ^[0-9]+\.[0-9]{2}%$
                example: 25.00%
        watermark:
          type: boolean
          default: false
          description: Adds the fixed AI-generated watermark in the lower-right corner.
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
          description: >-
            Random seed. Equal values can produce similar outputs, but exact
            reproduction is not guaranteed.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````