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

# 새 에셋 업로드

> 새로운 에셋을 관련 메타데이터와 함께 시스템에 업로드합니다.
두 가지 업로드 방법을 지원합니다:
1. 직접 파일 업로드 (multipart/form-data)
2. URL 기반 업로드 (application/json, source: "url")

동일한 해시의 에셋이 이미 존재하는 경우, 기존 에셋을 반환합니다.




## OpenAPI

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

    **실험적 API:** 이 API는 실험적이며 변경될 수 있습니다. 

    엔드포인트, 요청/응답 형식 및 동작은 사전 통지 없이 수정될 수 있습니다.

    </Warning>


    Comfy Cloud용 API - 클라우드 인프라에서 ComfyUI 워크플로를 실행합니다.


    이 API를 사용하여 Comfy Cloud와 프로그래밍 방식으로 상호작용할 수 있습니다:

    - 워크플로 제출 및 관리

    - 파일 업로드 및 다운로드

    - 작업 상태 및 진행 상황 모니터링


    ## Cloud vs OSS ComfyUI 호환성


    Comfy Cloud는 최대 호환성을 위해 OSS ComfyUI와 동일한 API 인터페이스를 구현하지만,

    일부 필드는 호환성을 위해 허용되지만 다르게 처리되거나 무시됩니다:


    | 필드 | 엔드포인트 | Cloud 동작 |

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

    | `subfolder` | `/api/view`, `/api/upload/*` | **무시됨** - Cloud는 콘텐츠 주소 지정
    저장소(해시 기반)를 사용합니다. 클라이언트 측 구성을 위해 응답에 반환됩니다. |

    | `type` (input/output/temp) | `/api/view`, `/api/upload/*` | 부분적으로 사용됨 - 모든
    파일은 디렉토리 구조 대신 태그 기반 조직으로 저장됩니다. |

    | `overwrite` | `/api/upload/*` | **무시됨** - 콘텐츠 주소 지정 저장소는 동일한 콘텐츠가 항상 동일한
    해시를 갖도록 합니다. |

    | `number`, `front` | `/api/prompt` | **무시됨** - Cloud는 사용자별로 자체 공정 실행 대기열
    스케줄링을 사용합니다. |

    | `split`, `full_info` | `/api/userdata` | **무시됨** - Cloud는 항상 전체 파일 메타데이터를
    반환합니다. |


    이러한 필드는 기존 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:
    post:
      tags:
        - asset
      summary: 새 에셋 업로드
      description: |
        새로운 에셋을 관련 메타데이터와 함께 시스템에 업로드합니다.
        두 가지 업로드 방법을 지원합니다:
        1. 직접 파일 업로드 (multipart/form-data)
        2. URL 기반 업로드 (application/json, source: "url")

        동일한 해시의 에셋이 이미 존재하는 경우, 기존 에셋을 반환합니다.
      operationId: uploadAsset
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: 업로드할 에셋 파일
                tags:
                  type: array
                  items:
                    type: string
                  description: >-
                    에셋의 자유 형식 태그. 일반적인 유형으로는 "모델", "입력", "출력" 및 "임시"가 포함되지만, 모든
                    태그를 어떤 순서로든 사용할 수 있습니다.
                id:
                  type: string
                  format: uuid
                  description: 멱등 생성을 위한 선택적 에셋 ID. 제공되고 에셋이 존재하는 경우 기존 에셋을 반환합니다.
                preview_id:
                  type: string
                  format: uuid
                  description: 선택적 미리보기 에셋 ID. 제공되지 않은 경우 이미지는 자체 ID를 미리보기로 사용합니다.
                name:
                  type: string
                  description: 에셋의 표시 이름
                mime_type:
                  type: string
                  description: '에셋의 MIME 유형 (예: "image/png", "video/mp4")'
                user_metadata:
                  type: string
                  description: 문자열 형태의 사용자 정의 JSON 메타데이터
          application/json:
            schema:
              type: object
              required:
                - url
                - name
              properties:
                url:
                  type: string
                  format: uri
                  description: 에셋을 다운로드할 HTTP/HTTPS URL
                name:
                  type: string
                  description: 에셋의 표시 이름 (파일 확장자 결정에 사용됨)
                tags:
                  type: array
                  items:
                    type: string
                  description: >-
                    에셋의 자유 형식 태그. 일반적인 유형으로는 "모델", "입력", "출력" 및 "임시"가 포함되지만, 모든
                    태그를 어떤 순서로든 사용할 수 있습니다.
                user_metadata:
                  type: object
                  additionalProperties: true
                  description: 에셋과 함께 저장할 사용자 정의 메타데이터
                preview_id:
                  type: string
                  format: uuid
                  description: 선택적 미리보기 에셋 ID
      responses:
        '200':
          description: 에셋이 이미 존재함 (기존 에셋 반환)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetCreated'
        '201':
          description: 에셋 생성 성공
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetCreated'
        '400':
          description: 잘못된 요청 (잘못된 파일, 유효하지 않은 URL, 잘못된 콘텐츠 유형 등)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 인증되지 않음
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: 소스 URL에 인증이 필요하거나 액세스가 거부됨
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: 소스 URL을 찾을 수 없음
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: 파일이 너무 큼
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '415':
          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: 이것이 새 에셋 생성(참)인지 아니면 기존 항목 반환(거짓)인지 여부
    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 헤더에
        키를 전달하세요.

````