Gift Chroma Master · 屏幕键控
The screen key, without the rest of the pipeline glued on
- image
- screen_color
- alpha_bias_color
- source_mask
- inside_mask
- outside_mask
- keyer_state
- keyed_matte
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) plusscreen_color(only read inmanual) - 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_lockedpins the color from frame one, which is right for a static studio setup;batch_sharedaverages over the whole batch. For unrelated images,per_frame_smoothedwithtemporal_smoothinglow 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.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| screen_mode | COMBO | auto | 4 options: auto, green, blue, manual |
| screen_color | COLOR | #00ff00 | — |
| sampling_mode | COMBO | per_frame_smoothed | per_frame_smoothed 对连续镜头稳定取色并自动检测明显幕色切换。 |
| border_fraction | FLOAT | 0.0800.01–0.5 | — |
| temporal_smoothing | FLOAT | 0.820–1 | — |
| screen_gain | FLOAT | 1.100–3 | — |
| screen_balance | FLOAT | 0.800–1 | — |
| alpha_bias_color | COLOR | #808080 | — |
| use_alpha_bias | BOOLEAN | false | — |
| preblur_px | FLOAT | 0.600–12 | — |
| clip_black | FLOAT | 0.0600–0.95 | — |
| clip_white | FLOAT | 0.9850.05–1 | — |
| clip_rollback | FLOAT | 0.250–1 | — |
| shrink_grow_px | FLOAT | -0.20-32–32 | — |
| softness_px | FLOAT | 0.450–32 | — |
| source_alpha_mode | COMBO | multiply | 3 options: multiply, ignore, add_inside |
| source_mask_polarity | COMBO | transparency | 2 options: transparency, alpha |
| source_maskopt | MASK | — | |
| inside_maskopt | MASK | — | |
| outside_maskopt | MASK | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| keyer_state | GIFT_CHROMA_MASTER_STATE | 传给 Gift Chroma Master Cleaner/诊断节点的轻量状态。 |
| keyed_matte | MASK | 1=前景的基础不透明度遮罩。 |