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

# Upload a mask image

`POST /api/upload/mask`

Uploads a mask image associated with a previously-uploaded reference image.

## Response `200`

Upload result

- UploadResult — Response body returned by the image/mask upload endpoints, describing where the uploaded file now lives.
  - `name` string — Saved filename (may be renamed to avoid collisions)
  - `subfolder` string — Subfolder the file was saved to
  - `type` string — Directory type (input, temp)

## Other responses

- `400` — No file provided or invalid request

## Changes

- **2026-04-24** `a66055fa384e` — 3 breaking, 7 info
  - added the new required request property `original_ref/filename`
  - the `original_ref` request property type/format changed from `string`/`` to `object`/``
  - removed the media type `application/json` for the response with the status `400`
  - api tag `upload` added
  - …6 more

[Change history](https://skmtc.dev/comfy-org/apis/comfyui-api/changes/api/upload/mask/post.md)

---

[API](https://skmtc.dev/comfy-org/apis/comfyui-api.md) · [All operations](https://skmtc.dev/comfy-org/apis/comfyui-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/comfy-org/comfyui-api/revisions/a66055fa384e/schema)
