〽️ ImageOps Keyer
Chroma keying with an eyedropper — pull a matte by sampling, not by guessing
- key_color
- image
- mask
- image
- mask
ImageOps Keyer is the node that pulls an alpha matte out of an image based on color or brightness - chroma keying for people who aren't running a broadcast studio. You pick a key color with an actual eyedropper on the live preview, set tolerance and softness, and out comes a matte of everything that matches. It's from the ComfyUI-Majoor-ImageOps pack, and it's the practical middle ground between a dedicated chroma-key extension and hand-painting a mask.
How it works
mode switches between color (distance from the key color) and luma (brightness-based keying - useful when the thing you're keying out is a dark or bright region rather than a colored screen). In color mode, the node computes each pixel's color distance to the key and applies a soft threshold: tolerance sets the hard key threshold, softness the width of the transition band around it. Then gain boosts the resulting matte (0–4) and blur softens it (0–64 pixels) - the classic cleanup stack: key, then de-spike the edges with a small blur.
The best part is the picker. Hit the Pick button and the eyedropper samples colors from any visible preview canvas - and it accumulates multiple samples into key_colors, the UI-managed list. That's the secret to clean keys on footage where the green isn't one uniform green (lighting falloff, shadows, wrinkles). One sample gets you 70% of the way; three samples across the different greens get you a matte that doesn't eat the subject.
An optional mask input multiplies into the generated matte - use it to protect a region (tell the keyer "hands are not keyable") or to limit keying to a portion of the frame. invert flips the resulting matte. invert_mask flips the input mask before it's multiplied in.
Outputs
image (the keyed image, i.e. with the transparency applied) and mask (the matte). Wire the mask into a merge or comp to place the subject over a new background - that's the whole point. Batch-first, so a video clip keys frame by frame, which is where the multi-sample key_colors really pays off because the screen doesn't look the same in every frame.
Install
ComfyUI Manager (search "ComfyUI-Majoor-ImageOps"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/MajoorWaldi/ComfyUI-Majoor-ImageOps
Restart and hard-refresh the browser (Ctrl+F5 / Cmd+Shift+R). No models, no extra deps.
The gotchas
The classic beginner move: crank tolerance until the screen is gone - and the subject's edges go with it. Raise tolerance slowly and lean on multiple samples instead; it's almost always the better trade. Second, softness is what saves you from crunchy edges - a small band of softness beats a hard key every time. And if the matte has noisy speckles, that's the blur knob's job, not more tolerance. Expect to iterate: keying is never one-shot, and this node is built for the loop of sample → check → sample again.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| bypass | BOOLEAN | false | — |
| mode | COMBO | color | 2 options: color, luma |
| key_color | COLOR | #00ff00 | — |
| key_colors | STRING | — | |
| tolerance | FLOAT | 0.250–1 | — |
| softness | FLOAT | 0.100–1 | — |
| gain | FLOAT | 1.000–4 | — |
| blur | FLOAT | 0.00–64 | — |
| invert | BOOLEAN | false | — |
| invert_mask | BOOLEAN | false | — |
| imageopt | IMAGE,VIDEO | Images/Video input. Accepts IMAGE batches and VIDEO frame sources. | |
| maskopt | MASK | Optional matte multiplied into the key. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |