Keyer(KeyerStage)
The Keyer node (class KeyerStage) is a video keying and compositing stage in the ComfyTV package, grouped under ComfyTV/Keying.
Keyer Stage
Description
The Keyer node (class KeyerStage) is a video keying and compositing stage in the ComfyTV package, grouped under ComfyTV/Keying. It takes a foreground video, a pair of masks that describe which parts of the frame to keep and which to discard, and an optional background video, then produces a single keyed COMFYTV_VIDEO.
Because upstream provides no docstring for this node, the input names are the primary guide to its behavior: in_mask and out_mask split the keying decision into an inside (keep) region and an outside (remove) region, while bg_video supplies the plate that the keyed foreground is composited over.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
video | COMFYTV_VIDEO | No | The foreground video to be keyed. This is the source footage whose subject is isolated and carried through to the output. |
in_mask | COMFYTV_IMAGE | No | Mask describing the inside, or foreground, region of the key. Areas marked by this mask are treated as the subject to retain. |
out_mask | COMFYTV_IMAGE | No | Mask describing the outside, or background, region of the key. Areas marked by this mask are treated as areas to remove or exclude from the foreground. |
bg_video | COMFYTV_VIDEO | No | Background video used behind the keyed foreground. Connecting this composites the isolated subject over a new plate instead of leaving it on its original background. |
All four inputs are optional. This makes the node flexible: it can be wired with only a foreground video and one mask, with both masks for finer edge control, or with a background video when a replacement plate is needed.
Masks are supplied as COMFYTV_IMAGE, which is how ComfyTV carries mask data through the graph. The in_mask and out_mask pair allows a matte to be built from two complementary regions rather than a single matte, which is useful for cleaning up edges, halos, and areas that are ambiguous in a single mask.
Outputs
| Name | Type | Description |
|---|---|---|
COMFYTV_VIDEO | COMFYTV_VIDEO | The keyed result. This carries the foreground subject, optionally composited over bg_video, as a video stream ready for further ComfyTV processing or final output. |
Usage Notes
- Use
in_maskto protect the subject andout_maskto clear the background. Providing both gives the node explicit information about both sides of the key boundary, which generally produces cleaner edges than a single mask alone. - Connect
bg_videowhen the goal is a replacement composite, such as placing a keyed subject over a new scene. If no background is needed, the node can still be used to isolate the foreground fromvideo. - Because every input is optional, the node can serve as a pass-through or as a staging point in a longer keying chain. Wire only the inputs that the current shot requires.
- Keep mask resolution and frame timing aligned with
videowhere possible. Mismatched masks are a common cause of jitter or incorrect keying across frames. - The output is a single
COMFYTV_VIDEO, so the node can be chained directly into other ComfyTV video nodes such as further keying, compositing, or export stages.
Comments
Sign in with GitHub to join the discussion.