---
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

---

[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)
