---
title: "Get related mask layer filenames"
method: GET
path: "/api/files/mask-layers"
tags: ["assets"]
---

# Get related mask layer filenames

`GET /api/files/mask-layers`

[cloud-only] Given a mask file (any of the 4 layers), returns all related mask layer filenames. Used by the mask editor to load the paint, mask, and painted layers when reopening a previously edited mask.

## Query parameters

- `filename` string, required

## Response `200`

Related mask layers

- object
  - `mask` string, nullable — Filename of the mask layer
  - `paint` string, nullable — Filename of the paint strokes layer
  - `painted` string, nullable — Filename of the painted image layer
  - `painted_masked` string, nullable — Filename of the final composite layer

## Other responses

- `401` — Unauthorized
- `404` — File not found or not a mask file

## Changes

- **2026-05-08** `c9640fded659` — 1 info
  - endpoint added
- **2026-04-24** `a66055fa384e` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/comfy-org/apis/comfyui-api/changes/api/files/mask-layers/get.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/c4db9e1283df/schema)
