ꘇ mediapipe.segments
A person mask and a cutout, straight from the browser
- image
- mask
- cutout
- observations
Everybody's background-removal workflow goes: download a 1GB matting model, wait for a load, get a beautiful cutout with perfect hair. This node is the opposite trade. It runs MediaPipe's selfie segmentation in your browser and gives you a mask and an alpha cutout at interactive rates, on a model measured in kilobytes to a few megabytes. The edges are the weak part. The liveness is the point.
It's the segmentation half of ꘇ Genereti's Perception family (languel/genereti, by Liuboto, MIT, super-alpha). Worth placing against the KB's background-removal essay, which is honest that this problem "looks solved until you hit hair, fur or anything semi-transparent" - segmentation models label pixels foreground/background, and matting models predict fractional alpha. MediaPipe's selfie segmenter is the first kind. Treat it accordingly: great for a live silhouette driving visuals, not the tool for compositing a model against a new background.
Inputs
image is the source frame - a live IMAGE from a stream, webcam capture, screen capture, or Livecode. stream (default segments) is the name this node publishes its observations under, so readers and event rules can subscribe to it. model is a combo: segment (the float16 selfie segmenter, ~250 KB) or multiclass (the 256×256 six-category selfie model, ~16.4 MB). regions (default person) names the region or category union you want - with the multiclass model that means you can select things like hair, clothes or body skin rather than just "the person." threshold (0.5) and softness (0.1) shape the mask ramp: threshold is where the decision flips, softness is how wide the transition band is. invert flips it, and max_fps (15, range 1–60) caps the inference rate.
Outputs
Two images and a DAT, and the docs say something specific about the images that's easy to miss: both retain source geometry - there's no implicit cover crop. The mask output is a grayscale mask; cutout is the source with that mask applied as alpha. observations is the structured DAT the perception service always attaches, with source association and timings.
Because the mask keeps the source aspect and framing, you can composite it or feed it to TOP operators without re-aligning anything. That sounds like a small thing and saves a lot of pain.
Live versus Queue
Like the whole perception family, this is browser state. The node's execute path raises: segmentation runs in browser Live, download/load/start are explicit, and camera capture is started separately. There's no headless fallback - the docs state plainly that a worker error unloads and requires an explicit reload.
Per-frame behaviour is bounded by design: one worker inference plus one newest waiting canvas per provider, no FIFO backlog, and a 1024 px per side source cap (oversize input asks for an explicit upstream resize). So you get current results or none, rather than a growing queue of late frames.
Using it in a graph
The intended pattern is the same as the rest of the family: get a live image in, start the provider, then consume the mask or cutout downstream. Both outputs are normal IMAGE sockets, so they go into any TOP operator - mask a composite, displace something by the silhouette, or use the cutout as a texture. The stream name is what makes the numbers available too: segment.coverage and segment.mean_confidence are named features other nodes can read, so you can gate an effect on "how much of the frame is person" without reading pixels.
That coverage number is underrated. It's a cheap, robust presence signal - more stable than landmark counts, and it works even when the person is out of pose-detection range.
Install
Manager → search "Genereti" → install ꘇ Genereti → restart ComfyUI → refresh the browser page. Manual:
git clone https://github.com/languel/genereti.git custom_nodes/genereti
./.venv/bin/python -m pip install -r custom_nodes/genereti/requirements.txt
No Python MediaPipe package. The runtime and the selected model download on request - verified by size and SHA-256, into models/genereti/browser-perception, over loopback-only routes - with the shared runtime around 22.65 MB plus 22.9 MB for segmentation or a few megabytes more for the multiclass model. ComfyUI 0.38.2+, Python 3.11+, modern browser.
Gotchas
Explicit start, always. ↓ download, ↑ load, ▶ start. Subscribing never starts a camera, and neither does opening the workflow.
WASM CPU, not GPU. The pack says the explicit backend is WASM CPU and does not claim GPU execution. The author measured around 11 ms per segmentation inference on one Mac - an order of magnitude, not a promise.
Hard-ish edges. Don't ship this as your final matte for hair or semi-transparent material. Its strength is that it's live; if quality matters more than latency, a proper matting model wins, which is exactly the tradeoff the background-removal literature keeps pointing at.
The region you name has to exist in the model. person on the single-class model, richer categories on the multiclass one. Selecting a category the loaded model doesn't have gives you a mask that isn't what you asked for.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| stream | STRING | segments | — |
| model | COMBO | segment | 2 options: segment, multiclass |
| regions | STRING | person | — |
| threshold | FLOAT | 0.500–1 | — |
| softness | FLOAT | 0.100–1 | — |
| invert | BOOLEAN | false | — |
| max_fps | FLOAT | 15.001–60 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| mask | IMAGE | — |
| cutout | IMAGE | — |
| observations | GENERETI_DAT | — |