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

# Midjourney V8.2 アップロードペイント

> - 画像をアップロードしてキャンバス上で高度な編集を行い、マスク領域の指定と位置調整をサポートします
- mj-v8.2-editに似ていますが、既存のタスクに依存せず、画像を直接入力します
- upload-paint タスクの結果は、バリエーション / リミックス / 編集のソース（`task_id`）として使用できません。上流はその結果のアップスケールのみを許可しており、本ルートでは公開していません
- 非同期処理モード、返されたタスクIDで[ステータスを照会](/ja/api-manual/task-management/get-task-detail)

<Note>
  Midjourney にはコンテンツ審査機能が組み込まれています。審査は画像ごとに行われ、フィルタリングされた画像は結果に含まれず、残りの画像は通常どおり返されるため、受け取る画像の枚数が通常より少なくなる場合があります。1 枚でも審査を通過すればタスクは `completed` となり、通常どおり課金されます。すべての画像がフィルタリングされた場合、タスクは `failed` となり、予約されたクレジットは全額返金されます。プロンプトと参考画像がコンテンツガイドラインに準拠しているかご確認ください。
</Note>


## OpenAPI

````yaml ja/api-manual/image-series/midjourney/mj-v8-2-upload-paint.json POST /v1/images/generations
openapi: 3.1.0
info:
  title: mj-v8.2-upload-paint インターフェース
  description: Midjourney V8.2 高度な編集インターフェース
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.evolink.ai
    description: 本番環境
security:
  - bearerAuth: []
tags:
  - name: 画像生成
    description: AI画像生成関連インターフェース
paths:
  /v1/images/generations:
    post:
      tags:
        - 画像生成
      summary: mj-v8.2-upload-paint インターフェース
      description: >-
        - 画像をアップロードしてキャンバス上で高度な編集を行い、マスク領域の指定と位置調整をサポートします

        - mj-v8.2-editに似ていますが、既存のタスクに依存せず、画像を直接入力します

        - upload-paint タスクの結果は、バリエーション / リミックス /
        編集のソース（`task_id`）として使用できません。上流はその結果のアップスケールのみを許可しており、本ルートでは公開していません

        -
        非同期処理モード、返されたタスクIDで[ステータスを照会](/ja/api-manual/task-management/get-task-detail)
      operationId: createImageGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerationRequest'
            examples:
              upload_paint_example:
                summary: 高度な編集
                value:
                  model: mj-v8.2-upload-paint
                  prompt: Beautiful mountain scenery background
                  image_urls:
                    - >-
                      https://cdn.evolink.ai/model-cards/midjourney-v8-2/midjourney-v8-2-og-v1.jpg
                  model_params:
                    mask:
                      areas:
                        - width: 1200
                          height: 630
                          points:
                            - 100
                            - 100
                            - 400
                            - 100
                            - 400
                            - 400
                            - 100
                            - 400
                    canvas:
                      width: 1200
                      height: 630
                    img_pos:
                      width: 1200
                      height: 630
                      x: 0
                      'y': 0
                    speed: fast
      responses:
        '200':
          description: タスク作成成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationResponse'
        '400':
          description: 無効なリクエストパラメータ
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: invalid_request
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: 未認証、トークン無効または期限切れ
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: unauthorized
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: クォータ不足、チャージしてください
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: insufficient_quota
                  message: Insufficient quota. Please top up your account.
                  type: insufficient_quota
        '403':
          description: アクセス拒否
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: model_access_denied
                  message: 'Token does not have access to model: mj-v8.2-upload-paint'
                  type: invalid_request_error
        '429':
          description: レート制限超過
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: rate_limit_exceeded
                  message: Too many requests, please try again later
                  type: rate_limit_error
        '500':
          description: 内部サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: internal_error
                  message: Internal server error
                  type: api_error
components:
  schemas:
    ImageGenerationRequest:
      type: object
      required:
        - model
        - prompt
        - image_urls
        - model_params
      properties:
        model:
          type: string
          description: モデル名
          enum:
            - mj-v8.2-upload-paint
          default: mj-v8.2-upload-paint
          example: mj-v8.2-upload-paint
        prompt:
          type: string
          description: 編集プロンプト
          maxLength: 8100
          example: Beautiful mountain scenery background
        image_urls:
          type: array
          description: >-
            入力画像URL（最初の1件が使用されます）。1024 文字以内の公開 HTTP(S)
            URL。対応フォーマット：.png、.gif、.webp、.jpg、.jpeg
          items:
            type: string
            format: uri
          maxItems: 1
          example:
            - >-
              https://cdn.evolink.ai/model-cards/midjourney-v8-2/midjourney-v8-2-og-v1.jpg
        model_params:
          type: object
          description: 高度な編集パラメータ
          required:
            - mask
            - canvas
            - img_pos
          properties:
            mask:
              type: object
              description: >-
                再描画するマスク領域（ポリゴン座標またはマスク画像）


                **方式1 - ポリゴン座標：**

                ```json

                { "areas": [{ "width": 100, "height": 100, "points": [10, 10,
                10, 100, 100, 100, 100, 10] }] }

                ```


                **方式2 - マスク画像（白黒 2 値、白 = 再描画。ソース画像と同じサイズ。URL または base64 data
                URI）：**

                ```json

                { "url":
                "https://cdn.evolink.ai/model-cards/midjourney-v8-2/midjourney-v8-2-og-v1.jpg"
                }

                ```


                （上記の URL はプレースホルダーです。ご自身の白黒 2 値マスク画像に置き換えてください。）
              properties:
                areas:
                  type: array
                  description: ポリゴン領域リスト
                  items:
                    type: object
                    properties:
                      width:
                        type: integer
                        description: 基準幅（ソース画像のピクセル単位、`points` の座標基準）
                      height:
                        type: integer
                        description: 基準高さ（ソース画像のピクセル単位、`points` の座標基準）
                      points:
                        type: array
                        description: 多角形の頂点座標 (x1,y1,x2,y2,...)。ソース画像のピクセル単位で、左上原点から時計回りに指定
                        items:
                          type: integer
                url:
                  type: string
                  format: uri
                  description: >-
                    マスク画像の URL または data URI。ソース画像と同じピクセルサイズの白黒 2 値画像：**白 = 再描画、黒
                    = 保持**。Base64 は data
                    URI（`data:image/png;base64,...`）として受け付けます。マスクに PNG
                    の透明度を使用しないでください：透明なピクセルは白（再描画）として扱われます。
            canvas:
              type: object
              description: >-
                キャンバスサイズ。キャンバスの縦横比（width/height）はアップロードした画像の縦横比と一致している必要があります。一致しない場合、タスクは失敗します（status:
                failed、実行エラー）。
              required:
                - width
                - height
              properties:
                width:
                  type: integer
                  description: キャンバスの幅
                  example: 1200
                height:
                  type: integer
                  description: キャンバスの高さ
                  example: 630
            img_pos:
              type: object
              description: >-
                キャンバス内における画像の位置とサイズ。画像がキャンバスを埋める場合（img の幅/高さ = canvas の幅/高さ）=
                純粋な編集/再描画。画像がキャンバスより小さい場合 =
                外側への拡張描画（outpaint。周囲の空白領域はプロンプトに基づいて生成されます）。
              required:
                - width
                - height
                - x
                - 'y'
              properties:
                width:
                  type: integer
                  description: レンダリング幅
                  example: 1200
                height:
                  type: integer
                  description: レンダリング高さ
                  example: 630
                x:
                  type: integer
                  description: 左上の水平オフセット
                  example: 0
                'y':
                  type: integer
                  description: 左上の垂直オフセット
                  example: 0
            speed:
              type: string
              description: |-
                速度モード

                - `fast`：標準モード（デフォルト）、1 倍
              enum:
                - fast
              default: fast
              example: fast
        callback_url:
          type: string
          description: >-
            タスク完了後のHTTPSコールバックアドレス


            **コールバックタイミング：**

            - タスクが完了（completed）または失敗（failed）したときにトリガー

            - 課金確認完了後に送信


            **セキュリティ制限：**

            - HTTPSプロトコルのみ対応

            -
            プライベートIPアドレスへのコールバックは禁止（127.0.0.1、10.x.x.x、172.16-31.x.x、192.168.x.xなど）

            - URLの長さは`2048`文字以下


            **コールバックメカニズム：**

            - タイムアウト：`10`秒

            - 失敗後最大`3`回リトライ（それぞれ失敗の`1`秒/`2`秒/`4`秒後にリトライ）

            - コールバックレスポンスのフォーマットはタスク照会インターフェースの戻り値と同一

            - コールバックアドレスが2xxステータスコードを返した場合は成功、その他のステータスコードはリトライをトリガー
          format: uri
          example: https://your-domain.com/webhooks/image-task-completed
    ImageGenerationResponse:
      type: object
      properties:
        created:
          type: integer
          description: タスク作成タイムスタンプ
          example: 1757165031
        id:
          type: string
          description: タスクID
          example: task-unified-1757165031-mjv82
        model:
          type: string
          description: 実際に使用されたモデル名
        object:
          type: string
          enum:
            - image.generation.task
          description: タスクタイプ
        progress:
          type: integer
          description: タスク進捗率 (0-100)
          minimum: 0
          maximum: 100
          example: 0
        status:
          type: string
          description: タスクステータス
          enum:
            - pending
            - processing
            - completed
            - failed
          example: pending
        task_info:
          $ref: '#/components/schemas/TaskInfo'
        type:
          type: string
          enum:
            - text
            - image
            - audio
            - video
          example: image
        usage:
          $ref: '#/components/schemas/Usage'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: エラーコード識別子
            message:
              type: string
              description: エラーメッセージ
            type:
              type: string
              description: エラータイプ
    TaskInfo:
      type: object
      properties:
        estimated_time:
          type: integer
          description: 推定完了時間（秒）
          minimum: 0
          example: 45
    Usage:
      type: object
      properties:
        billing_rule:
          type: string
          enum:
            - per_call
            - per_token
            - per_second
          example: per_call
        credits_reserved:
          type: number
          description: 推定消費クレジット
          minimum: 0
          example: 1.8
        user_group:
          type: string
          example: default
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##全てのインターフェースはBearer Token認証が必要です##

        **API Keyの取得：**

        [API Key管理ページ](https://evolink.ai/dashboard/keys)にアクセスしてAPI Keyを取得してください

        **リクエストヘッダーに追加：**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.