Nodes/ComfyUI-enricos-nodes/πŸ’œ Compositor Masks Output V4
ComfyUI Node

πŸ’œ Compositor Masks Output V4

Same unpacking job, waiting on V4 to turn its output back on

By erosDiffusionΒ·Created 2 years agoΒ·Updated 2 months agoΒ· 635
πŸ’œ Compositor Masks Output V4
  • 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_masks toggle 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.

Categoryimage

Inputs (1)

NameTypeDefaultDescription
layer_outputsCOMPOSITOR_OUTPUT_MASKSβ€”

Outputs (16)

NameTypeDescription
image_1IMAGEβ€”
image_2IMAGEβ€”
image_3IMAGEβ€”
image_4IMAGEβ€”
image_5IMAGEβ€”
image_6IMAGEβ€”
image_7IMAGEβ€”
image_8IMAGEβ€”
mask_1MASKβ€”
mask_2MASKβ€”
mask_3MASKβ€”
mask_4MASKβ€”
mask_5MASKβ€”
mask_6MASKβ€”
mask_7MASKβ€”
mask_8MASKβ€”