π Compositor Masks Output (V3)
Getting each layer and its mask back out of the canvas
- layer_outputs
- image_1
- image_2
- image_3
- image_4
- image_5
- image_6
- image_7
- image_8
- mask_1
- mask_2
- mask_3
- mask_4
- mask_5
- mask_6
- mask_7
- mask_8
The Compositor V3 packs all 8 layers plus their masks into one COMPOSITOR_OUTPUT_MASKS socket on its layer_outputs output. That's a tidy design but useless until someone unpacks it. This node is the unpacker: feed it the layer_outputs socket and you get 16 individual outputs - image_1 through image_8 and mask_1 through mask_8 - each positioned, scaled and rotated to match exactly what's on your canvas.
This is the node that turns the Compositor from "make a picture" into "make a picture and hand every element to other nodes." It's how people split a finished composition back into separate layers for per-element controlnets, inpainting, or feeding individual subjects into an edit model. Each mask is canvas-sized, so the layers all line up when you re-stack them.
The input and outputs
One input: layer_outputs (a COMPOSITOR_OUTPUT_MASKS object) straight from the Compositor V3 node. That's it - no widgets to fiddle with.
Outputs: image_1βimage_8 (IMAGE) and mask_1βmask_8 (MASK). Missing slots come back as a blank image and a fully transparent mask, so downstream nodes don't choke on empty inputs. If you only used 3 images, you still get 8 image and 8 mask outputs - the empty ones are just blank.
Installing
Same pack, same story - no models, no extra dependencies:
cd ComfyUI/custom_nodes
git clone https://github.com/erosDiffusion/ComfyUI-enricos-nodes.git
or ComfyUI Manager β search "Compositor" β erosDiffusion. Restart to see it.
Gotchas
There's a hidden subtract_masks option in the code that, when enabled, subtracts higher layers' masks from lower ones (so layer 5's mask doesn't include what layer 6 covers). It exists for the "stacked cutouts shouldn't overlap" use case, but the README flagged proper mask stacking as still being worked on - don't rely on it for production yet.
One V3 quirk to keep in mind: the mask convention here is ComfyUI's usual one, and whether invertMask is on in the Config node changes what these masks look like. If a mask comes out inverted relative to what you expect, flip invertMask at the config, not here. And remember this is the V3-era node - the V4 version (Compositor4MasksOutput) exists but V4 itself temporarily removed the layer_outputs output while it's in alpha, so for now this pair only truly shines with V3.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| layer_outputs | COMPOSITOR_OUTPUT_MASKS | β |
Outputs (16)
| Name | Type | Description |
|---|---|---|
| image_1 | IMAGE | β |
| image_2 | IMAGE | β |
| image_3 | IMAGE | β |
| image_4 | IMAGE | β |
| image_5 | IMAGE | β |
| image_6 | IMAGE | β |
| image_7 | IMAGE | β |
| image_8 | IMAGE | β |
| mask_1 | MASK | β |
| mask_2 | MASK | β |
| mask_3 | MASK | β |
| mask_4 | MASK | β |
| mask_5 | MASK | β |
| mask_6 | MASK | β |
| mask_7 | MASK | β |
| mask_8 | MASK | β |