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

# Редактирование изображения

> Создать четыре изображения на основе изображения и описания, **асинхронная задача**

<Note>
  Официальная функция редактирования изображений Midjourney включает встроенное кадрирование, поэтому редактируемые изображения должны использовать поддерживаемые соотношения сторон. Сейчас поддерживаются соотношения 1:1, 1:2, 2:1, 2:3, 3:2, 3:4, 4:3, 9:16 и 16:9. Если загруженное изображение не соответствует одному из этих соотношений, система автоматически скорректирует его перед генерацией нового изображения.
</Note>


## OpenAPI

````yaml openapi/ru/midjourneyedit.json POST /midjourney/image-edits/submit
openapi: 3.1.0
info:
  title: Документация API редактирования Midjourney
  version: 1.0.0
  description: Midjourney Интерфейсы, связанные с редактированием изображений
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /midjourney/image-edits/submit:
    post:
      description: >-
        Создать четыре изображения на основе изображения и описания,
        **асинхронная задача**
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageeditsRequest'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    ImageeditsRequest:
      type: object
      properties:
        prompt:
          type: string
          description: >-
            Предлагает изменить изображения. Лучше всего подходит английский
            язык.
        image:
          type: string
          description: >-
            Файлы изображений поддерживают URL и Base64, разрешены только
            форматы png, jpg, jpeg, bmp, webp. <br/> Примечание. Области
            изображения, подлежащие редактированию, должны быть прозрачными.
        mode:
          type: string
          description: Режим скорости для редактирования изображений
          enum:
            - relax
            - fast
            - turbo
          default: fast
        type:
          type: string
          description: Тип редактирования
          enum:
            - edit
            - retexture
          default: edit
        hookUrl:
          type: string
          description: >-
            Обратный вызов URL. Когда задача будет завершена или не выполнена,
            этот URL будет уведомлен. Если не установлено, необходимо запросить
            интерфейс статуса задачи <a href="fetch" target="_self">Получение
            статуса</a>.
      required:
        - prompt
        - image
  responses:
    SuccessResponse:
      description: Запрос выполнен успешно
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: SUCCESS
              message:
                type: string
                example: success
              data:
                type: object
                example:
                  jobId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            required:
              - status
              - message
              - data
    400Response:
      description: Ошибка параметров
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: '"prompt" cannot be empty.'
              data:
                type: object
            required:
              - status
              - message
    401Response:
      description: Ошибка авторизации
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: Wrong TT-API-KEY or email is not activated.
            required:
              - status
              - message
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        Вы можете получить API-ключ в <a href='https://dashboard.ttapi.io'
        target='_blank'>панель управления TTAPI</a>.

````