Nodes/ComfyUI-TextureAlchemy/Multimatte Pass Applicator
ComfyUI Node

Multimatte Pass Applicator

One channel-packed mask, six masked images out

By amtarr·Created 9 months ago·Updated 4 months ago· 58
Multimatte Pass Applicator
  • multimatte_mask
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
channelRed

If you've worked in VFX or rendered in a real engine, you know the multimatte trick: pack multiple selection masks into one image's RGB channels - object A in red, object B in green, object C in blue - and you get all your mattes in a single texture instead of three files. Multimatte Pass Applicator is the node that unpacks that idea for image processing: it pulls one channel out of a multimatte mask (Red, Green, Blue, or a computed Luminance) and applies it as a mask to up to six input images, returning each one masked.

It's the pack's bridge between render-pass discipline and ComfyUI graph work, sitting in Texture Alchemist/Adjustment. The use case is straightforward: you've got a multimatte from a render or a channel-packed mask you made yourself, and you want to selectively mask a stack of maps - albedo, roughness, normal, whatever - with the same region, without wiring six identical mask nodes.

How it works

The multimatte_mask input is an IMAGE (so it plays nicely with anything a renderer or a channel-packer emits). The channel selector decides which slice becomes the mask:

  • Red - the R channel. Most common, since multimattes usually start with object A in red.
  • Green - the G channel.
  • Blue - the B channel.
  • Luminance - a computed grayscale (Rec. 709 weights), for when your "multimatte" is really just a grayscale density mask.

The chosen channel is then multiplied against each of the six optional images (image_1 through image_6), exactly like the pack's Lighting Pass Mask Applicator but with the channel extraction up front and six targets instead of three. Each input is optional - unmasked inputs pass through - and each has a matching output (image_1image_1, etc.), so wiring stays legible.

The mechanism is deliberately simple - extract channel, multiply - but the channel extraction is the part people get wrong by hand, and the luminance option means you can also use it as a generic grayscale mask applicator when you don't have a real multimatte at all.

Where it fits

The cleanest workflow: a render (or a pack's Channel Packer node) gives you one ORM-style texture with multiple masks packed in channels. You feed that to this node with channel: Red, wire your albedo/roughness/metallic into image_1/2/3, and get back three maps masked to just the object that lives in the red channel. Swap to Green, run again, and the same maps come back masked to a different object. Same mask data, no redundant masking, no re-exporting.

Installing it

Ships with ComfyUI-TextureAlchemy. ComfyUI Manager → search "TextureAlchemy" → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/amtarr/ComfyUI-TextureAlchemy

Restart, find it under Texture Alchemist → Adjustment. No pip packages, no model downloads - channel math only.

Common issues

  • "I picked Red but got the wrong region." Check the channel layout of your source mask. If it was packed as a single grayscale mask, only Luminance will behave - RGB modes will grab near-empty or near-full channels.
  • "Output is all black." The chosen channel is empty in your mask, or you're masking everything out. Preview the channel first (the pack's Channel Unpacker can isolate it).
  • "Only some outputs change." Correct - each output only changes if its input was wired. Empty inputs pass through as-is or stay empty depending on what you connected.
  • "Less than 3 channels in the mask." The node warns and falls back to the first channel for non-Luminance modes.

It's a focused utility - if you work with channel-packed mattes it saves real time, and if you don't, the Luminance mode still makes it a decent general-purpose mask multiplier. Just don't expect it to interpret your mattes; it only slices what you tell it to slice.

CategoryTexture Alchemist/Adjustment

Inputs (8)

NameTypeDefaultDescription
multimatte_maskIMAGE
channelCOMBORedWhich channel to use as the mask
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
image_5optIMAGE
image_6optIMAGE

Outputs (6)

NameTypeDescription
image_1IMAGE
image_2IMAGE
image_3IMAGE
image_4IMAGE
image_5IMAGE
image_6IMAGE