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

# Nano Banana 图片编辑

> 使用 Nano Banana Edit 模型编辑图片（异步）

使用 [Google DeepMind](https://deepmind.google) 的 Nano Banana 模型进行图片编辑。

**模型特点：**

* **自然语言编辑** - 通过文本指令描述修改需求
* **局部修改** - 精准编辑图片特定区域
* **风格调整** - 支持调整图片风格和效果
* **快速处理** - 基于 Gemini 架构，编辑速度快


## OpenAPI

````yaml /cn/openapi.yaml POST /generate/k/nano-banana-edit
openapi: 3.0.0
info:
  contact:
    email: support@sinancode.com
    name: API Support
    url: https://sinancode.com/support
  description: AI 模型任务调度平台 API
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  termsOfService: https://sinancode.com/terms-of-service
  title: TikTomato API
  version: '1.0'
servers:
  - url: https://api.sinancode.com/v1
    description: Production server
security: []
paths:
  /generate/k/nano-banana-edit:
    post:
      tags:
        - public
      summary: Nano Banana Edit 图片编辑
      description: 使用 Nano Banana Edit 模型编辑图片（异步）
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ka.CreateNanoBananaEditTaskRequest'
        description: Task parameters
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dto.CreateTaskResponse'
        '400':
          description: Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
      security:
        - AccessToken: []
components:
  schemas:
    ka.CreateNanoBananaEditTaskRequest:
      properties:
        image_size:
          default: '1:1'
          description: 图片尺寸（可选，默认 1:1）- 图片宽高比
          enum:
            - '1:1'
            - '9:16'
            - '16:9'
            - '3:4'
            - '4:3'
            - '3:2'
            - '2:3'
            - '5:4'
            - '4:5'
            - '21:9'
            - auto
          example: '1:1'
          type: string
        image_urls:
          description: 图片 URL 列表（必填）- 用于编辑的输入图片列表，最多10张
          example:
            - >-
              https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png
          items:
            type: string
          maxItems: 10
          minItems: 1
          type: array
        output_format:
          description: 输出格式（可选）- 图片输出格式
          enum:
            - png
            - jpeg
          example: png
          type: string
        prompt:
          description: 提示词（必填，最大5000字符）- 图片编辑的文本描述
          example: >-
            turn this photo into a character figure. Behind it, place a box with
            the character's image printed on it
          maxLength: 5000
          minLength: 1
          type: string
      required:
        - image_urls
        - prompt
      type: object
    dto.CreateTaskResponse:
      properties:
        task_id:
          description: Task ID
          example: 01234567-89ab-cdef-0123-456789abcdef
          type: string
      required:
        - task_id
      type: object
    apierror.ErrorResponse:
      properties:
        error_code:
          description: Machine-readable error code (e.g. TASK.INVALID_PARAMS)
          type: string
        message:
          description: User-friendly error message
          type: string
      type: object
  securitySchemes:
    AccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 请使用您的 API Token 进行认证

````