メインコンテンツへスキップ
POST
Upload a new asset

承認

X-API-Key
string
header
必須

API key authentication. Generate an API key from your account settings at https://platform.comfy.org/profile/api-keys. Pass the key in the X-API-Key header.

ボディ

file
file
必須

The asset file to upload

tags
string[]

Freeform tags for the asset. Common types include "models", "input", "output", and "temp", but any tag can be used in any order.

id
string<uuid>

Optional asset ID for idempotent creation. If provided and asset exists, returns existing asset.

preview_id
string<uuid>

Optional preview asset ID. If not provided, images will use their own ID as preview.

name
string

Display name for the asset

mime_type
string

MIME type of the asset (e.g., "image/png", "video/mp4")

user_metadata
string

Custom JSON metadata as a string

レスポンス

Asset already exists (returned existing asset)

id
string<uuid>
必須

Unique identifier for the asset

name
string
必須

Name of the asset file

size
integer<int64>
必須

Size of the asset in bytes

created_at
string<date-time>
必須

Timestamp when the asset was created

updated_at
string<date-time>
必須

Timestamp when the asset was last updated

created_new
boolean
必須

Whether this was a new asset creation (true) or returned existing (false)

asset_hash
string

Blake3 hash of the asset content

Pattern: ^blake3:[a-f0-9]{64}$
mime_type
string

MIME type of the asset

tags
string[]

Tags associated with the asset

user_metadata
object

Custom user metadata for the asset

preview_url
string<uri>

URL for asset preview/thumbnail

preview_id
string<uuid> | null

ID of the preview asset if available

prompt_id
string<uuid> | null

ID of the job/prompt that created this asset, if available

last_access_time
string<date-time>

Timestamp when the asset was last accessed

is_immutable
boolean

Whether this asset is immutable (cannot be modified or deleted)