Nodes/ComfyUI-GiftHelperSuite/Gift Chroma Master · 高级去溢色
ComfyUI Node

Gift Chroma Master · 高级去溢色

The green that sneaks onto your subject, removed properly

By lingziwyh·Created 5 months ago·Updated 11 days ago· 7
Gift Chroma Master · 高级去溢色
  • cleaner_state
  • despill_bias
  • protect_color
  • effect_mask
  • foreground_rgb
  • foreground_alpha
  • final_state
modestandard
amount0.82
range0.55
desaturate0.20
spill1.00
luma_restore1.00
edge_recovery0.35
use_despill_biasfalse
use_protect_colorfalse
protect_strength0.85
skin_protection0.55
highlight_protection0.50
key_color_protection0.80

Even a clean key leaves a calling card: green or blue spill bleeding into the edges of your subject - around hair, shoulders, anything glossy. Keying removes the screen; despill removes the screen color that the screen lit onto your subject. GiftChromaMasterDespill is the third and final stage of the suite's chroma chain, the direct descendant of the "Advanced Spill Suppressor" role in the AE trio this pack is modeled on. It's the node that turns a technically-correct key into one that doesn't look wrong the second you composite onto a bright background.

Why it's "advanced" and not a simple desaturate

The naive fix - desaturate the screen color channel - also drains skin tones and wardrobe that legitimately contain green. This node does despill in linear light, against an arbitrary hue (not just green or blue), and it knows how to protect things you care about. The real trick in the code: it reconstructs what the foreground must have looked like before the screen color was mixed in, per pixel, using the screen color it inherited through the state chain. spill_range decides how close to the screen color a pixel has to be to get treated as spill; amount scales how hard the correction bites.

The protection group is where beginners usually start and where this node shines:

  • skin_protection (default 0.55) - keeps flesh tones from going gray/green-chalky. This is the one that makes or breaks a person key.
  • highlight_protection (default 0.5) - guards bright areas, which are the ones most likely to get wrongly corrected.
  • key_color_protection (default 0.8) - the opposite instinct: keeps the strongest screen-color pixels firmly suppressed.
  • use_protect_color + protect_color - an explicit color to shield, for when the auto-protection isn't enough (say, a prop that's legitimately green).
  • use_despill_bias + despill_bias - bias the correction direction if the screen color is off-tint.

Plus the mode switch: mode=standard vs ultra (harder suppression, for stubborn fringe), and desaturate, luma_restore, edge_recovery for the edge band's color and brightness balance.

Inputs, outputs, wiring

Required input is cleaner_state - the state object from GiftChromaMasterCleaner. This node is the end of the expert chain, and it's the first one in the chain that emits finished RGB: outputs are foreground_rgb (straight, unpremultiplied - the despilled foreground color) and foreground_alpha (1=foreground, 0=transparent), plus final_state if you want to hand the whole result to the diagnostics node. As with every node in the suite, that alpha is foreground-opacity polarity, the opposite of a Load Image transparency mask - pack it with GiftChromaMasterPackRGBA rather than wiring it into mask-hungry nodes.

Tuning that's actually grounded

The suite's README recipe for leftover green/blue on outlines: despill_amount 0.90–1.00, spill_range 0.65–0.85, spill_mode=ultra, edge_recovery 0.25–0.45. The recurring warning, repeated because it's real: crank everything and you'll strip legitimate color - hair, semi-transparent material, even the subject's clothing if it's near the screen color. Go one notch at a time and judge against an actual composite, not against the matte.

For long video, the README's honest advice stands: use the all-in-one GiftChromaMaster, not this expert chain - the expert nodes keep analysis state around and are meant for short diagnostic batches. This node exists so you can see and control the final color stage in isolation when a shot needs it. Install is the pack standard: ComfyUI Manager ("ComfyUI-GiftHelperSuite") or clone https://github.com/lingziwyh/ComfyUI-GiftHelperSuite.git into custom_nodes, restart, no pip dependencies.

CategoryGiftHelperSuite/Chroma

Inputs (17)

NameTypeDefaultDescription
cleaner_stateGIFT_CHROMA_MASTER_STATE
modeCOMBOstandard2 options: standard, ultra
amountFLOAT0.820–1
rangeFLOAT0.550–1
desaturateFLOAT0.200–1
spillFLOAT1.000–1
luma_restoreFLOAT1.000–1
edge_recoveryFLOAT0.350–1
despill_biasCOLOR#c08060
use_despill_biasBOOLEANfalse
protect_colorCOLOR#c08060
use_protect_colorBOOLEANfalse
protect_strengthFLOAT0.850–1
skin_protectionFLOAT0.550–1
highlight_protectionFLOAT0.500–1
key_color_protectionFLOAT0.800–1
effect_maskoptMASK

Outputs (3)

NameTypeDescription
foreground_rgbIMAGEStraight / 未预乘的去溢色前景 RGB。
foreground_alphaMASK前景不透明度:1=前景,0=透明。
final_stateGIFT_CHROMA_MASTER_STATE仅在需要诊断视图时连接;批量视频优先使用日用一体化节点。