Nodes/ComfyTV/PIK Keyer
ComfyUI Node

PIK Keyer

The IBK-style keyer for green screens even a simple chroma key can't hold

By jtydhr88·Created 3 months ago·Updated about 16 hours ago· 725
PIK Keyer
  • video
  • clean_plate_video
  • clean_plate
  • in_mask
  • out_mask
  • bg_video
  • video
force_run_token0
project_id
parent_output_id0
screengreen
pick_color#00FF00
red_weight0.50
blue_green_weight0.50
alpha_bias#808080
despill_bias#808080
use_alpha_biastrue
screen_subtractiontrue
clip_black0.00
clip_white1.00
replace_modesoft
replace_color#808080
outputalpha

PIK Keyer is the pack's heavyweight for green/blue screen work, modeled on the classic IBK (image-based keyer) / Primatte approach used in pro compositing. The difference from a plain chroma key: instead of judging every pixel by a single screen color, it can compare your footage against a clean plate (a shot of the empty screen) and use garbage masks to force regions fully in or fully out. That's how you get edges on hair, translucency, and spill that a one-color key just eats.

It also handles the two things that usually follow a key - despill (removing the green glow from your subject's edges) and replace (filling the removed spill with a chosen color or the background) - so it's a full keying bench in one node.

How the two modes work

There are two operating modes, chosen automatically by what you wire in:

  • Full clean-plate mode - wire any side input (clean_plate_video, clean_plate, in_mask, out_mask, or bg_video) and it runs the complete IBK pipeline: screen subtraction, clean-plate comparison, garbage masks, despill, replace.
  • Fast single-image mode - leave all side inputs empty and it falls back to a quick, live-previewable key using just the screen color. Great for roughing a key before committing to the full pass.

Side inputs, for reference: video (the plate to key), clean_plate_video / clean_plate (empty screen as video or still), in_mask (force opaque), out_mask (force transparent), bg_video (background when output is composite).

The parameters that matter

  • screen - green (default), blue, or pick with your own pick_color (hex, default #00FF00).
  • red_weight / blue_green_weight - how the screen channel separates from the rest. Both default 0.5, range -1..2. Nudge to firm up the matte without eating the subject.
  • alpha_bias / despill_bias - neutral-color references (default #808080 gray). Set them toward your subject's neutral tone to cut spill. use_alpha_bias (on by default) makes the alpha bias also drive despill.
  • screen_subtraction - on by default; subtracts the screen contribution for a cleaner core matte.
  • clip_black / clip_white - matte clip points, 0–1. Pull them in slightly to crush noise in the matte.
  • replace_mode - none, source, hard, or soft (default); replace_color is the fill for hard/soft.
  • output - alpha (real transparency, default), matte (grayscale mask), premult, or composite (rendered over the background).

One output: video (COMFYTV_VIDEO).

The troubleshooting note worth memorizing

The pack's docs flag this explicitly: alpha output needs the VP9 encoder - if it errors, switch output to matte. That's the kind of error message that looks like an install problem and isn't. And remember the pack rule: native ComfyUI video in/out requires a Bridge node.

Install

Pack-wide one-liner:

cd ComfyUI/custom_nodes
git clone https://github.com/jtydhr88/ComfyTV

Restart ComfyUI - Desktop/macOS users: clone into the running instance by absolute path, verify __init__.py at the top level, and restart the backend fully. ComfyUI Manager finds it as "ComfyTV". No extra Python dependencies.

Realistic advice: for a solid green screen with flat lighting, the fast single-image mode is genuinely enough - don't over-build. Break out the clean plate and garbage masks when you're fighting hair, motion blur, or a wrinkled backdrop. That's what this node is for.

CategoryComfyTV/Keying

Inputs (22)

NameTypeDefaultDescription
force_run_tokenINT00–2147483647Internal — bumped on Run to invalidate ComfyUI's input cache.
project_idSTRINGInternal — populated by the projectStore on the frontend.
parent_output_idINT00–2147483647Internal — lineage parent set by spawn handlers on the frontend.
screenCOMBOgreen3 options: green, blue, pick
pick_colorSTRING#00FF00
red_weightFLOAT0.50-1–2
blue_green_weightFLOAT0.50-1–2
alpha_biasSTRING#808080
despill_biasSTRING#808080
use_alpha_biasBOOLEANtrue
screen_subtractionBOOLEANtrue
clip_blackFLOAT0.000–1
clip_whiteFLOAT1.000–1
replace_modeCOMBOsoft4 options: none, source, hard, soft
replace_colorSTRING#808080
outputCOMBOalpha4 options: alpha, matte, premult, composite
videooptCOMFYTV_VIDEO
clean_plate_videooptCOMFYTV_VIDEO
clean_plateoptCOMFYTV_IMAGE
in_maskoptCOMFYTV_IMAGE
out_maskoptCOMFYTV_IMAGE
bg_videooptCOMFYTV_VIDEO

Outputs (1)

NameTypeDescription
videoCOMFYTV_VIDEO