Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

Segment from source image, not OffscreenCanvas, in selfie refine

qhqfb9b47fec3ad5
diff --git a/src/selfie-refine.js b/src/selfie-refine.js
index 27045d2c7..9a6e2efea 100644
--- a/src/selfie-refine.js
+++ b/src/selfie-refine.js
@@ -509,7 +509,12 @@ export async function refineSelfie(bitmap, opts = {}) {
onStep('Isolating subject…');
const segmenter = await loadSegmenter();
if (segmenter) {
- const result = segmenter.segment(frame);
+ // Segment the original source, not the OffscreenCanvas working frame:
+ // MediaPipe accepts ImageBitmap/HTMLImageElement everywhere, whereas
+ // OffscreenCanvas input isn't supported across all builds. The mask
+ // covers the same aspect ratio either way, so the work-space sampling
+ // below is unaffected.
+ const result = segmenter.segment(bitmap);
const conf = result?.confidenceMasks?.[0];
if (conf) {
const maskW = conf.width;