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

# Get related mask layer files

`GET /api/files/mask-layers`

Given a mask file (any of the 4 layers), returns all related mask layer files.
This is 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`

Success - Related mask layers returned

- 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

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

## Changes

- **2026-06-03** `8560879e6188` — 1 breaking, 5 info
  - removed the required property `error` from the response with the `404` status
  - api tag `file` added
  - api tag `assets` removed
  - removed the non-success response with the status `401`
  - …2 more
- **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/da017caf56f1/schema)
