> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-feat-openapi-i18n.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 大きなファイルのバックグラウンドダウンロードを開始

> HuggingfaceまたはCivitaiからの大きなファイルのバックグラウンドダウンロードジョブを開始します。

ファイルがストレージに既に存在する場合、アセットレコードが即座に作成され、返されます (200 OK)。
ファイルが存在しない場合、バックグラウンドタスクが作成され、タスクIDが返されます (202 Accepted)。
フロントエンドはGET /api/tasks/{task_id}を使用して進捗を追跡できます。




## OpenAPI

````yaml /openapi/cloud.ja.yaml post /api/assets/download
openapi: 3.0.3
info:
  title: Comfy Cloud API
  description: >
    <Warning>

    **実験的API:** このAPIは実験的であり、変更される可能性があります。

    エンドポイント、リクエスト/レスポンス形式、および動作は予告なく変更される場合があります。

    </Warning>


    Comfy CloudのAPI - クラウドインフラ上でComfyUIワークフローを実行します。


    このAPIを使用すると、Comfy Cloudとプログラムで連携できます。内容は次のとおりです。

    - ワークフローの送信と管理

    - ファイルのアップロードとダウンロード

    - ジョブの状態と進捗の監視


    ## クラウド vs OSS ComfyUI 互換性


    Comfy Cloudは最大限の互換性のためにOSS
    ComfyUIと同じAPIインターフェースを実装していますが、一部のフィールドは互換性のために受け入れられますが、異なる処理が行われたり無視されたりします。


    | フィールド | エンドポイント | クラウドの動作 |

    |-------|-----------|----------------|

    | `subfolder` | `/api/view`, `/api/upload/*` | **無視** -
    クラウドはコンテンツアドレスストレージ（ハッシュベース）を使用します。クライアント側の整理のためにレスポンスで返されます。 |

    | `type` (input/output/temp) | `/api/view`, `/api/upload/*` | 部分的に使用 -
    すべてのファイルはディレクトリ構造ではなくタグベースの整理で保存されます。 |

    | `overwrite` | `/api/upload/*` | **無視** -
    コンテンツアドレスストレージでは、同一のコンテンツは常に同じハッシュを持ちます。 |

    | `number`, `front` | `/api/prompt` | **無視** - クラウドはユーザーごとに独自の公平キュー
    スケジューリングを使用します。 |

    | `split`, `full_info` | `/api/userdata` | **無視** -
    クラウドは常に完全なファイルメタデータを返します。 |


    これらのフィールドは、既存のComfyUIクライアントやワークフローとのドロップイン互換性のためにAPIスキーマに保持されています。
  version: 1.0.0
  license:
    name: GNU General Public License v3.0
    url: https://github.com/Comfy-Org/ComfyUI/blob/master/LICENSE
servers:
  - url: https://cloud.comfy.org
    description: Comfy Cloud API
security:
  - ApiKeyAuth: []
tags:
  - name: workflow
    description: |
      ワークフローを実行のために送信し、実行キューを管理します。
      これはクラウド上でComfyUIワークフローを実行するための主要な方法です。
  - name: job
    description: |
      ジョブステータスを監視し、実行履歴を表示し、実行中のジョブを管理します。
      ジョブはPOST /api/promptを介してワークフローを送信するときに作成されます。
  - name: asset
    description: |
      永続的なアセット（画像、モデル、出力）をアップロード、ダウンロード、管理します。
      アセットはタグ付けとメタデータサポートを備えた耐久性のあるストレージを提供します。
  - name: file
    description: |
      ローカルのComfyUIと互換性のあるレガシーファイルのアップロードおよびダウンロードエンドポイント。
      新しい統合には、代わりにAssets APIの使用を検討してください。
  - name: model
    description: |
      利用可能なAIモデルをブラウズします。モデルはクラウドインフラストラクチャにプリロードされています。
  - name: node
    description: |
      利用可能なComfyUIノードとその入力/出力に関する情報を取得します。
      動的なワークフローインターフェースの構築に役立ちます。
  - name: user
    description: |
      ユーザーアカウント情報と個人データの保存。
  - name: system
    description: |
      サーバーステータス、ヘルスチェック、システム情報。
paths:
  /api/assets/download:
    post:
      tags:
        - asset
      summary: 大きなファイルのバックグラウンドダウンロードを開始
      description: |
        HuggingfaceまたはCivitaiからの大きなファイルのバックグラウンドダウンロードジョブを開始します。

        ファイルがストレージに既に存在する場合、アセットレコードが即座に作成され、返されます (200 OK)。
        ファイルが存在しない場合、バックグラウンドタスクが作成され、タスクIDが返されます (202 Accepted)。
        フロントエンドはGET /api/tasks/{task_id}を使用して進捗を追跡できます。
      operationId: createAssetDownload
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - source_url
              properties:
                source_url:
                  type: string
                  format: uri
                  description: >-
                    ダウンロードするファイルのURL
                    (huggingface.coまたはcivitai.comからのものでなければなりません)
                  example: >-
                    https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors
                tags:
                  type: array
                  items:
                    type: string
                  description: 'アセットのオプションタグ（例: ["モデル", "checkpoint"]）'
                user_metadata:
                  type: object
                  additionalProperties: true
                  description: アセットに添付するオプションのユーザー定義メタデータ
                preview_id:
                  type: string
                  format: uuid
                  description: ダウンロードしたアセットに関連付けるオプションのプレビューアセットID
                  example: 550e8400-e29b-41d4-a716-446655440000
      responses:
        '200':
          description: 'ストレージにファイルが既に存在します: アセットが即座に作成/返されます'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetCreated'
        '202':
          description: '受理されました: ダウンロードタスクが作成され、バックグラウンドで処理中'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetDownloadResponse'
        '400':
          description: 無効なURLまたはサポートされていないソース
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 認証されていません
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: 検証エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 内部サーバーエラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AssetCreated:
      allOf:
        - $ref: '#/components/schemas/Asset'
        - type: object
          required:
            - created_new
          properties:
            created_new:
              type: boolean
              description: これが新しいアセットの作成であるか（true）または既存のものが返されたか（false）
    AssetDownloadResponse:
      type: object
      required:
        - task_id
        - status
      properties:
        task_id:
          type: string
          format: uuid
          description: GET /api/tasks/{task_id} を介したダウンロード進行状況追跡用のタスクID
        status:
          type: string
          enum:
            - created
            - running
            - completed
            - failed
          description: 現在のタスクステータス
        message:
          type: string
          description: 人間が読めるメッセージ
          example: Download task created. Use task_id to track progress.
    ErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
    Asset:
      type: object
      required:
        - id
        - name
        - size
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
          description: アセットの一意な識別子
        name:
          type: string
          description: アセットファイルの名前
        asset_hash:
          type: string
          description: アセットコンテンツのBlake3ハッシュ
          pattern: ^blake3:[a-f0-9]{64}$
        size:
          type: integer
          format: int64
          description: アセットのサイズ（バイト単位）
        mime_type:
          type: string
          description: アセットのMIMEタイプ
        tags:
          type: array
          items:
            type: string
          description: アセットに関連付けられたタグ
        user_metadata:
          type: object
          description: アセットのカスタムユーザーメタデータ
          additionalProperties: true
        preview_url:
          type: string
          format: uri
          description: アセットのプレビュー/サムネイルのURL
        preview_id:
          type: string
          format: uuid
          description: 利用可能な場合のプレビューアセットのID
          nullable: true
        prompt_id:
          type: string
          format: uuid
          description: このアセットを作成したジョブ/プロンプトのID（利用可能な場合）
          nullable: true
        created_at:
          type: string
          format: date-time
          description: アセット作成時のタイムスタンプ
        updated_at:
          type: string
          format: date-time
          description: アセットの最終更新時刻のタイムスタンプ
        last_access_time:
          type: string
          format: date-time
          description: アセットの最終アクセス時刻のタイムスタンプ
        is_immutable:
          type: boolean
          description: このアセットが不変であるかどうか（変更または削除不可）
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: |
        APIキー認証。アカウント設定からAPIキーを生成します
        （https://platform.comfy.org/profile/api-keys）。X-API-Keyヘッダーでキーを渡します。

````