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

# Midjourney 图生图

> 使用 Midjourney AI 模型从输入图片生成图片（异步）

使用 [Midjourney](https://midjourney.com) V7 模型基于图片生成新的艺术作品。

**模型特点：**

* **特征保留** - 保留原图核心特征的同时添加创意元素
* **风格转换** - 将照片转化为独特的 Midjourney 艺术风格
* **灵活控制** - 通过权重参数控制原图影响程度
* **高质量输出** - V7 增强的纹理和细节表现


## OpenAPI

````yaml /cn/openapi.yaml POST /generate/k/mj-img2img
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/mj-img2img:
    post:
      tags:
        - public
      summary: Midjourney 图生图
      description: 使用 Midjourney AI 模型从输入图片生成图片（异步）
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ka.CreateMidjourneyImg2ImgTaskRequest'
        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'
        '402':
          description: Insufficient credits
          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.CreateMidjourneyImg2ImgTaskRequest:
      properties:
        aspectRatio:
          description: 宽高比（可选）- 输出宽高比
          enum:
            - '1:2'
            - '9:16'
            - '2:3'
            - '3:4'
            - '5:6'
            - '6:5'
            - '4:3'
            - '3:2'
            - '1:1'
            - '16:9'
            - '2:1'
          example: '16:9'
          type: string
        enableTranslation:
          default: false
          description: 启用翻译（可选，默认 false）- 启用自动翻译
          example: false
          type: boolean
        fileUrls:
          description: 文件 URL 列表（可选）- 输入图片 URL 数组
          example:
            - https://example.com/image.jpg
          items:
            type: string
          type: array
        prompt:
          description: 提示词（必填，最大2000字符）- 生成的文本描述
          example: Make it more colorful and vibrant
          maxLength: 2000
          minLength: 1
          type: string
        speed:
          description: 速度（可选）- API 生成速度
          enum:
            - relaxed
            - fast
            - turbo
          example: relaxed
          type: string
        stylization:
          description: 风格化（可选，范围 0-1000）- 艺术风格强度
          example: 1
          maximum: 1000
          minimum: 0
          type: integer
        variety:
          description: 多样性（可选，范围 0-100，步长5）- 内容多样性
          example: 10
          maximum: 100
          minimum: 0
          type: integer
        version:
          description: 版本（可选）- Midjourney 模型版本
          enum:
            - '7'
            - '6.1'
            - '6'
            - '5.2'
            - '5.1'
            - niji6
          example: '7'
          type: string
        waterMark:
          description: 水印（可选）- 水印标识
          example: my_watermark
          type: string
        weirdness:
          description: 怪异度（可选，范围 0-3000）- 创意独特性
          example: 1
          maximum: 3000
          minimum: 0
          type: integer
      required:
        - 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 进行认证

````