Self-hosting weights
By default Longpipe fetches weights from https://cdn.longpipe.dev/models/v/0.0.5/. To host them yourself — for offline use, locked-down corporate networks, or just to avoid the public CDN dependency — point weightsBaseUrl at your own host.
new EffectsPipeline(stream, {
weightsBaseUrl: 'https://cdn.example.com/longpipe/v0.0.5/',
})
What to host
The SDK fetches files of the form model_${preset}.bin (and .f16.bin for fp16-capable hardware). The full set, with sizes and sha256, is in the CDN’s manifest.json; download each file from the same folder and host them at the URL you set.
If you use touch-up, three more files must sit alongside them — they’re fetched from the same base URL the first time the effect is enabled:
model_landmark_mesh.bin(and.f16.bin)face_topology.jsonweight_mask.png
Miss these and matting still works, but enabling touch-up fails. Auto-reframe needs nothing extra.
MediaPipe selfie weights
If you use model: 'mediapipe-selfie', host these two files in the same folder as everything else (the SDK fetches them from weightsBaseUrl when you set it):
mediapipe_selfie_segmenter.f16.bin(square, 256×256)mediapipe_selfie_segmenter_landscape.f16.bin(landscape, 256×144)
You only need the variant(s) you use: 'mediapipe-selfie' picks landscape for 16:9-ish output and square otherwise. Download them from https://cdn.longpipe.dev/models/mediapipe/selfie/v1/, which also has manifest.json (sizes and sha256), LICENSE and NOTICE.md, or regenerate them from Google’s original .tflite files with scripts/convert_mediapipe_selfie.py. These weights are Google’s, under Apache-2.0: keep the LICENSE and NOTICE.md alongside them when you redistribute.
Without weightsBaseUrl, MediaPipe weights come from https://cdn.longpipe.dev/models/mediapipe/selfie/v1/ (versioned separately from Longpipe’s own weights, since they only change if Google’s model does).
ONNX files
The official ONNX exports (for Python, native apps or onnxruntime-web) live under the same versioned
prefix, at https://cdn.longpipe.dev/models/v/0.0.5/onnx/, and on Hugging Face at
Longpipe/longpipe. The SDK doesn’t use them. See
ONNX & other runtimes.
CORS
Browsers require the weight host to send Access-Control-Allow-Origin: * (or your specific origin). The SDK uses fetch() with default CORS mode.
Versioning
The default URL is versioned in the path (/v/0.0.5/) so SDK upgrades that change weight shapes can move to a new prefix without breaking older SDKs in the wild. Mirror that pattern when self-hosting if you want to stay in sync with future SDK versions.