Nodes/ComfyUI-Majoor-ImageOps/〽️ ImageOps Keyer
ComfyUI Node

〽️ ImageOps Keyer

Chroma keying with an eyedropper — pull a matte by sampling, not by guessing

By MajoorWaldi·Created 8 months ago·Updated 8 days ago· 11
〽️ ImageOps Keyer
  • key_color
  • image
  • mask
  • image
  • mask
bypassfalse
modecolor
key_colors
tolerance0.25
softness0.10
gain1.00
blur0.0
invertfalse
invert_maskfalse

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.

Categoryimage/imageops

Inputs (12)

NameTypeDefaultDescription
bypassBOOLEANfalse
modeCOMBOcolor2 options: color, luma
key_colorCOLOR#00ff00
key_colorsSTRING
toleranceFLOAT0.250–1
softnessFLOAT0.100–1
gainFLOAT1.000–4
blurFLOAT0.00–64
invertBOOLEANfalse
invert_maskBOOLEANfalse
imageoptIMAGE,VIDEOImages/Video input. Accepts IMAGE batches and VIDEO frame sources.
maskoptMASKOptional matte multiplied into the key.

Outputs (2)

NameTypeDescription
imageIMAGE
maskMASK