メインコンテンツへスキップ
POST
/
api
/
upload
/
mask
Upload a mask image
curl --request POST \
  --url https://cloud.comfy.org/api/upload/mask \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-API-Key: <api-key>' \
  --form image='@example-file' \
  --form 'original_ref=<string>'
{
  "name": "<string>",
  "subfolder": "<string>",
  "type": "<string>",
  "metadata": {
    "is_mask": true,
    "original_hash": "<string>",
    "mask_type": "<string>",
    "related_files": {
      "mask": "<string>",
      "paint": "<string>",
      "painted": "<string>"
    }
  }
}

承認

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.

ボディ

multipart/form-data
image
file
必須

The mask image file to upload

original_ref
string
必須

JSON string containing reference to the original image

レスポンス

Mask uploaded successfully

name
string

Filename of the uploaded mask

subfolder
string

Subfolder path where mask was saved

type
string

Type of upload (e.g., "output")

metadata
object

Additional metadata for mask detection and re-editing