Nodes/ComfyUI-GiftHelperSuite/Gift Chroma Master · 屏幕键控
ComfyUI Node

Gift Chroma Master · 屏幕键控

The screen key, without the rest of the pipeline glued on

By lingziwyh·Created 5 months ago·Updated about 23 hours ago· 7
Gift Chroma Master · 屏幕键控
  • image
  • screen_color
  • alpha_bias_color
  • source_mask
  • inside_mask
  • outside_mask
  • keyer_state
  • keyed_matte
screen_modeauto
sampling_modeper_frame_smoothed
border_fraction0.080
temporal_smoothing0.82
screen_gain1.10
screen_balance0.80
use_alpha_biasfalse
preblur_px0.60
clip_black0.060
clip_white0.985
clip_rollback0.25
shrink_grow_px-0.20
softness_px0.45
source_alpha_modemultiply
source_mask_polaritytransparency

GiftChromaMasterKeyer is stage one of the suite's chroma chain, pulled out so you can see and tune it in isolation. Where the flagship GiftChromaMaster runs screen key → edge cleaner → despill in one shot, this node just does the keying: it samples the screen color and produces the base matte. It's the "expert chain" node the README points you to for short diagnostic batches, and it exists because the all-in-one is great until a shot misbehaves and you need to know which stage is eating your hair.

The output worth understanding is keyer_state - a GIFT_CHROMA_MASTER_STATE that carries the sampled screen color, the raw matte, and the analysis state forward to GiftChromaMasterCleaner or the diagnostics node. That's the design: each expert node hands a state object to the next, so you can inspect at every boundary. You also get keyed_matte, the base opacity mask (1=foreground), which is handy if you only need a quick look at what the keyer thinks is foreground.

What you'll actually touch

  • screen_mode (auto/green/blue/manual) plus screen_color (only read in manual) - the same screen-selection logic as the main node.
  • sampling_mode - this is where the keyer differs from the one-button node. per_frame_smoothed (default) stabilizes color sampling across a continuous shot and auto-detects obvious screen-color switches; first_frame_locked pins the color from frame one, which is right for a static studio setup; batch_shared averages over the whole batch. For unrelated images, per_frame_smoothed with temporal_smoothing low is the safe pick.
  • border_fraction (default 0.08) - how much of the frame edge is sampled to estimate the screen color. If your subject fills the frame, this is the knob that decides whether auto even stands a chance.
  • screen_gain, clip_black/clip_white, shrink_grow_px/softness_px - the same matte-shaping controls the flagship exposes, and they default to the same values, so whatever you tune here transfers cleanly to a production workflow.
  • alpha_bias_color + use_alpha_bias - an advanced escape hatch: bias the matte toward a given color when the screen and subject colors are uncomfortably close.

Wiring and gotchas

Feed it an IMAGE batch; it runs on the tensor's existing device (expert nodes don't do the flagship's auto chunking - that's a batch-video optimization, and this is a debugging node). The mask polarity convention is the same everywhere in the suite: 1=foreground, 0=transparent, and ComfyUI's Load Image MASK is the opposite, so keep source_mask_polarity=transparency when you feed in a source mask, and don't feed the resulting mask to a node expecting transparency semantics.

Install is the pack's standard: Manager (search "ComfyUI-GiftHelperSuite") or git clone https://github.com/lingziwyh/ComfyUI-GiftHelperSuite.git into custom_nodes, restart. No extra pip packages.

Where people get burned: treating this as a one-node keying solution. It isn't - it's deliberately stage one of three. A raw keyed_matte is still hard-edged and spill-heavy until it goes through the cleaner and despill. If you just want a finished key on a long video, use GiftChromaMaster. Reach for this node when auto screen detection picks the wrong color (common when edge lights or shadows pollute the border) and you need to see and pin the matte before the rest of the chain runs.

CategoryGiftHelperSuite/Chroma

Inputs (21)

NameTypeDefaultDescription
imageIMAGE
screen_modeCOMBOauto4 options: auto, green, blue, manual
screen_colorCOLOR#00ff00
sampling_modeCOMBOper_frame_smoothedper_frame_smoothed 对连续镜头稳定取色并自动检测明显幕色切换。
border_fractionFLOAT0.0800.01–0.5
temporal_smoothingFLOAT0.820–1
screen_gainFLOAT1.100–3
screen_balanceFLOAT0.800–1
alpha_bias_colorCOLOR#808080
use_alpha_biasBOOLEANfalse
preblur_pxFLOAT0.600–12
clip_blackFLOAT0.0600–0.95
clip_whiteFLOAT0.9850.05–1
clip_rollbackFLOAT0.250–1
shrink_grow_pxFLOAT-0.20-32–32
softness_pxFLOAT0.450–32
source_alpha_modeCOMBOmultiply3 options: multiply, ignore, add_inside
source_mask_polarityCOMBOtransparency2 options: transparency, alpha
source_maskoptMASK
inside_maskoptMASK
outside_maskoptMASK

Outputs (2)

NameTypeDescription
keyer_stateGIFT_CHROMA_MASTER_STATE传给 Gift Chroma Master Cleaner/诊断节点的轻量状态。
keyed_matteMASK1=前景的基础不透明度遮罩。