Models

Longpipe is a video-effects SDK: a worker, per-browser frame transport, WebGPU and WebGL2 backends with a zero-copy input path, a compositor (blur, image, video and colour backgrounds) and a set of effects. The segmentation model inside it is a choice:

new EffectsPipeline(stream, { model: 'longpipe' })          // default
new EffectsPipeline(stream, { model: 'mediapipe-selfie' })  // Google's selfie segmenter
'longpipe' (default)'mediapipe-selfie'
NetworkLongpipe hydranet, 5 tiers (xs–xl)MediaPipe Selfie Segmenter (MobileNetV3-style), square 256×256 or landscape 256×144
Background blur / image / video / colour✓✓
Touch-up✓✗ (throws)
Auto-reframe✓✗ (throws)
Temporal stabilizationoptical-flow head + gated stabilizernone (per-frame mask)
Presets, autotune, adaptive✓✗ — one fixed model
Weights licenceMITApache-2.0 (© Google)

Why there are two

Longpipe’s own models are the reason the SDK exists: one encoder pass drives the matte, the face keypoints (touch-up, reframe) and the optical flow (temporal stability), so adding an effect doesn’t add an inference. They are also more accurate per frame — on the P3M-10k benchmark even the xs tier has a lower mean absolute error than either MediaPipe variant — and faster: on an Apple M4 at 360p, the xs preset as shipped runs at 344 fps on WebGPU, against 123 fps for MediaPipe’s own tasks-vision library (MediaPipe’s model on Longpipe’s engine: 379 fps) (performance & quality).

model: 'mediapipe-selfie' is for when you specifically want MediaPipe’s model — to match an existing MediaPipe deployment’s output, or for a like-for-like comparison — while still getting Longpipe’s pipeline. It runs on the same backends, input path and compositor as Longpipe’s tiers; the network is the only difference. Compared with running it through @mediapipe/tasks-vision, it skips MediaPipe’s own runtime and its full-resolution mask resample, and it can use WebGPU.

MediaPipe selfie