π Compositor Masks Output V4
Same unpacking job, waiting on V4 to turn its output back on
- 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
Compositor4MasksOutput is the V4 twin of CompositorMasksOutputV3: it takes a COMPOSITOR_OUTPUT_MASKS bundle and unpacks it into image_1βimage_8 plus mask_1βmask_8, each matching the layer's position, scale and rotation on the canvas. Same code shape, same purpose - pull every layer back out as individual tensors so you can feed them into per-layer controlnets, inpainting or edit models.
But here's the thing you'll hit immediately: the V4 Compositor node currently doesn't emit a layer_outputs socket at all. In the 4.0.x source that output is commented out - the README says mask output and advanced outputs were "temporarily removed" during the V4 alpha rewrite. So this node's only input (layer_outputs, a COMPOSITOR_OUTPUT_MASKS object) has nothing to plug into if you're using pure V4 nodes. It exists for when the output comes back, and for anyone who wires a V3-style producer into a V4-style unpacker.
If you need per-layer outputs today, the honest recommendation is to use the V3 line: Compositor V3 β layer_outputs β CompositorMasksOutputV3. V4's alpha status is the reason, not a preference.
Installing
Standard pack install, no models, no extra deps:
cd ComfyUI/custom_nodes
git clone https://github.com/erosDiffusion/ComfyUI-enricos-nodes.git
or ComfyUI Manager β search "Compositor" β erosDiffusion. Restart.
What to know
- The 16 outputs are all always present - empty slots come back as a blank image and a fully transparent mask, so downstream graphs don't break on missing layers.
- There's a hidden
subtract_maskstoggle in the code for stacking (higher layers' masks subtracted from lower ones), but the author hasn't shipped it as a full feature - don't build a workflow around it. - Mask convention is ComfyUI-standard; if things look inverted, the fix lives in the Config node's
invertMask, not here.
Short version: bookmark this node for when V4's layer output returns; run V3 if you need masks out of the compositor this week.
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 | β |