Detect Remove SolidBG UnMult
The background remover with no model inside it
- image
- image
- mask
Almost every "remove background" node in ComfyUI is a segmentation model. BiRefNet, InSPyReNet, RMBG, rembg's u2net family - you download a few hundred megabytes, it runs a forward pass, and it hands you a mask that's mostly right on clean edges and completely wrong on a veil, a wine glass or motion blur. That's not those models being bad - it's segmentation doing a matting job, and the failure is predictable: great on a grey preview, falls apart the moment you put colour behind it.
Detect Remove SolidBG UnMult is the other family. There is no model. No weights, no download. The author's docs say it plainly - pure tensor math - and the source backs that up. It's a keyer, and it works on exactly one kind of footage: a subject on a flat backdrop. Studio white, a black sweep, a greenscreen you lit properly, a product render with a plain fill behind it.
For that footage it does what the segmentation models structurally can't: fractional alpha. A strand of hair at 40% coverage comes out at 40% alpha, not a hard edge nobody can rescue later.
How it works
"UnMult" is old compositing jargon - obscure enough that the term barely exists in the ComfyUI vocabulary. The source credits a port of the MekajikiUnMult core from ComfyUI-RH-Nodes. The idea: if you know the background colour, you can invert the compositing equation pixel by pixel instead of guessing at edges.
First it estimates that background. It samples border strips (about a fiftieth of the short side, capped at 32px), quantises every border pixel into a coarse per-channel cube, and counts which cube cell wins. A cell only wins if it holds at least 20% of the border samples and is supported on opposite sides or on three or more sides - so a subject bleeding off one edge doesn't poison the vote. Ties go to the darker candidate; the median of the winning cluster is your background.
Then it unmultiplies per channel: how far each pixel has travelled from that background toward white, and how far toward black - the stronger of the two wins. If the background is dark it only trusts the toward-white direction, which is what stops dark sweeps from eating your subject. On a near-pure-white background it applies an adaptive alpha gain (up to 2.5x, median-driven) so translucent edges don't come out at 10% when they should be 30%. A gamut guard keeps the unpremultiplied colour from going negative - the usual source of black fringes in homebrew keyers.
The three inputs, and what to actually set
image- the batch. 1, 2, 3 or 4 channels are all accepted; if your input already has alpha, that alpha is multiplied into the final mask rather than thrown away.threshold- an 8-bit alpha black point, default0(off). This is the only knob most people touch. Nudge it up in steps of 5–10 when grey haze hangs around the subject; it remaps remaining alpha with(a - t) / (1 - t)and zeroes anything under the line.255makes the whole thing transparent, which is a decent sanity check and a terrible final setting.background_color- a post-processing composite target, not part of the estimate. Empty keeps a transparent RGBA image.smsmart-picks black, white or#808080per image. Anything else uses the same colour syntax as the pack'sImage Alpha Split: names, hex,r,g,b.
Two outputs: image (RGBA when background_color is empty, RGB composite when it isn't) and mask, the float alpha. Wire mask into Mask To Image or your compositing stack; send image straight through if you want the foreground too.
Installing it
Through ComfyUI Manager, search ComfyUI 1hewNodes. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/1hew/ComfyUI-1hewNodes
Restart ComfyUI. Be warned: you're installing a whole pack and its requirements.txt is not small - opencv-python, scikit-image, scikit-learn, ultralytics, rembg, transparent-background, onnxruntime, av, torchaudio, color-matcher, psd-tools. None of it is needed by this node; it's there for the pack's detector and video nodes. pip doesn't care and will pull all of it.
Where it goes wrong
The big one is a background that isn't flat. Gradients, multi-colour backdrops, a lighter floor meeting a darker wall - the estimator picks one colour and the rest of the frame keys badly. Not a bug you can tune out.
Bright subject, bright background is the second: a white shirt on a white sweep has almost no colour delta to invert, so alpha collapses there whatever you do with threshold. Same when the subject fills all four borders - no clean border left to sample.
And the classic: this node wants footage that was made flat. Feed it a person in a kitchen and BiRefNet beats it in one second. Keep both - a segmentation model for anything organic, this for anything you can shoot on a sweep.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| threshold | INT | 00–255 | 8-bit alpha black point. 0 disables cleanup; higher values suppress low alpha and remap remaining alpha. |
| background_color | STRING | Post-processing background: use Image Alpha Split color syntax, 'sm' to smart-select per image, or leave empty to retain transparent RGBA. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |