Nodes/ComfyUI-GiftHelperSuite/Gift Chroma Master · 打包 RGBA
ComfyUI Node

Gift Chroma Master · 打包 RGBA

The two-minute fix for the alpha polarity trap

By lingziwyh·Created 5 months ago·Updated 11 days ago· 7
Gift Chroma Master · 打包 RGBA
  • image
  • mask
  • image_rgba

This is the smallest node in the chroma family and the one that saves the most people from a genuinely confusing hour. GiftChromaMaster and the expert chain output their alpha as a separate MASK with foreground-opacity polarity - 1=foreground, 0=transparent. ComfyUI's built-in Load Image MASK is the reverse: 1=transparent. If you've ever keyed something, wired foreground_alpha into a node expecting a transparency mask, and watched the whole frame vanish or turn to grey mush, you've met this mismatch. GiftChromaMasterPackRGBA exists so you never have to think about it: it takes the keyed RGB and the keyed alpha and packs them into a single four-channel RGBA IMAGE.

How it works

Two inputs, one output, nothing to configure. image (the straight RGB from a keyer output like foreground_rgb) and mask (the alpha from foreground_alpha) go in; image_rgba comes out - a proper RGBA image where the transparency is baked into the alpha channel. Because the output is a normal IMAGE, everything downstream that understands RGBA - compositing nodes, encoders, previews - just works, and you don't have to babysit mask polarity through the rest of the graph.

Honestly, that's the whole node. It's a utility, and it's meant to be.

Where you'll use it

The README's recommended chroma branch spells it out:

video frame batch
    ↓
GiftChromaMaster
    ├─ foreground_rgb ────────────→ downstream composite / encoder
    └─ foreground_alpha ─→ GiftChromaMasterPackRGBA → RGBA layer

The foreground_rgb output is straight/unpremultiplied - transparent areas aren't zeroed, so you should never composite it by itself; the alpha has to travel with it. Pack it here and you've got a single RGBA layer you can hand to the suite's own AE Alpha Over RGBA or any other compositor.

The gotcha to remember

The pack works fine on any mask you hand it, which is also how it bites you: it doesn't know or care about polarity, it just copies the mask into the alpha channel. If you feed it a mask with Load Image transparency polarity (1=transparent), you get an inverted key and won't immediately see why. That's not a bug - it's why the chroma nodes default source_mask_polarity to transparency on input and why the outputs are consistently foreground-opacity. Feed this node the outputs of the Gift Chroma chain, not masks scavenged from elsewhere, and you're fine.

Install is the pack's standard: ComfyUI Manager (search "ComfyUI-GiftHelperSuite") or git clone https://github.com/lingziwyh/ComfyUI-GiftHelperSuite.git into custom_nodes, restart, no extra pip dependencies. If you're just checking a key quickly, GiftChromaMasterPreview gives you the checkerboard look without needing a separate RGBA step - but for anything that gets saved or composited, pack it.

CategoryGiftHelperSuite/Chroma

Inputs (2)

NameTypeDefaultDescription
imageIMAGE
maskMASK

Outputs (1)

NameTypeDescription
image_rgbaIMAGE