---
title: "Upload a mask image"
method: POST
path: "/api/upload/mask"
tags: ["file"]
---

# Upload a mask image

`POST /api/upload/mask`

Upload a mask image to be applied to an existing image.

Image limits apply to both the uploaded mask and the referenced
original image:
  - Maximum file size: 50 MB
  - Maximum width/height per edge: 16384 px
  - Maximum total pixel count: 64 megapixels (67108864 pixels)

Uploads that exceed any of these limits are rejected with HTTP 400.

## Response `200`

Mask uploaded successfully

- object
  - `name` string — Filename of the uploaded mask
  - `subfolder` string — Subfolder path where mask was saved
  - `type` string — Type of upload (e.g., "output")

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `500` — Internal server error

---

[API](https://skmtc.net/comfy-org/apis/comfyui-api.md) · [All operations](https://skmtc.net/comfy-org/apis/comfyui-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/comfy-org/comfyui-api/versions/9fb6092a836d/schema)
