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.

fix(forge): cut the backdrop out of text-to-3D references so figures stop fusing to a slab

nirholasb142d91890a8
diff --git a/api/_lib/render-clip.js b/api/_lib/render-clip.js
index c59f1a470..352ee967c 100644
--- a/api/_lib/render-clip.js
+++ b/api/_lib/render-clip.js
@@ -321,7 +321,13 @@ export async function renderClip({
// back blank.
const { base: threeBase } = await resolveThreeCdn(THREE_VERSION);
const html = viewerHtml({ glbBase64, width: W, height: H, background, pose, cameraOrbit, expression, threeBase });
- await page.setContent(html, { waitUntil: 'domcontentloaded' });
+ // The GLB rides into the page as base64 inside this HTML, so `html` is
+ // routinely several megabytes. Puppeteer's default 30s cap on setContent
+ // applied to that payload on its own budget, and on a loaded machine it was
+ // the first thing to blow, reporting "Navigation timeout of 30000 ms
+ // exceeded" for a page that never navigates anywhere. It gets the same
+ // budget as the render it is part of.
+ await page.setContent(html, { waitUntil: 'domcontentloaded', timeout: RENDER_TIMEOUT_MS });
try {
await page.waitForFunction(
'window.__renderDone === true || window.__renderError !== null',
diff --git a/api/forge.js b/api/forge.js
index 326417270..15be852c1 100644
--- a/api/forge.js
+++ b/api/forge.js
@@ -2069,15 +2069,24 @@ async function startJob(req, res) {
// texture resolution) instead of only a bigger advertised polycount.
quality: selfhostQualityForTier(tier.id),
// Background pre-matting via the worker's sibling rembg service
- // (RMBG-2/isnet), for real user photos only. A photo carries a
- // busy background (the classroom behind the subject) that TRELLIS's
- // internal cutout separates poorly, bleeding the backdrop into the
- // fused geometry; a clean alpha cutout of every view before fusion
- // removes that. Skipped for text→3D, whose FLUX/Vertex reference is
- // already synthesized on a plain background. Worker-side it's
- // best-effort: a rembg miss falls back to the original image, never
- // failing the generation. draft stays fast (single view, no matte).
- matte: isImageMode && tier.id !== 'draft',
+ // (RMBG-2/isnet). A busy background (the classroom behind the
+ // subject) separates poorly in TRELLIS's internal cutout and bleeds
+ // into the fused geometry; a clean alpha cutout of every view before
+ // fusion removes that.
+ //
+ // This used to be gated to real user photos, on the reasoning that a
+ // text→3D reference is "already synthesized on a plain background".
+ // Measured on 2026-09-08, that premise is false: plain is not
+ // transparent, and the reconstruction happily fuses the plain
+ // backdrop in as geometry. Six text personas rendered through this
+ // exact path produced a figure standing on a full-footprint slab of
+ // reconstructed backdrop in four of six cases, twice losing the
+ // figure entirely (bbox 0.966 x 0.01 x 1: a bare plane, no person).
+ // Evidence: prompts/quality-bar/_generated/10/pass-2026-09-08/.
+ // So text→3D gets the same cutout; draft stays fast (single view,
+ // no matte). Worker-side it is best-effort either way: a rembg miss
+ // falls back to the original image, never failing the generation.
+ matte: tier.id !== 'draft',
},
});
} catch (err) {
diff --git a/api/gpt-forge.js b/api/gpt-forge.js
index a36f541b2..424ca46d8 100644
--- a/api/gpt-forge.js
+++ b/api/gpt-forge.js
@@ -2005,15 +2005,21 @@ async function startJob(req, res) {
// texture resolution) instead of only a bigger advertised polycount.
quality: selfhostQualityForTier(tier.id),
// Background pre-matting via the worker's sibling rembg service
- // (RMBG-2/isnet), for real user photos only. A photo carries a
- // busy background (the classroom behind the subject) that TRELLIS's
- // internal cutout separates poorly, bleeding the backdrop into the
- // fused geometry; a clean alpha cutout of every view before fusion
- // removes that. Skipped for text→3D, whose FLUX/Vertex reference is
- // already synthesized on a plain background. Worker-side it's
- // best-effort: a rembg miss falls back to the original image, never
- // failing the generation. draft stays fast (single view, no matte).
- matte: isImageMode && tier.id !== 'draft',
+ // (RMBG-2/isnet). A busy background (the classroom behind the
+ // subject) separates poorly in TRELLIS's internal cutout and bleeds
+ // into the fused geometry; a clean alpha cutout of every view before
+ // fusion removes that.
+ //
+ // This used to be gated to real user photos, on the reasoning that a
+ // text→3D reference is "already synthesized on a plain background".
+ // Measured on 2026-09-08, that premise is false: plain is not
+ // transparent, and the reconstruction fuses the plain backdrop in as
+ // geometry (a figure standing on a full-footprint slab, and twice no
+ // figure at all). Same change and same evidence as api/forge.js; see
+ // prompts/quality-bar/_generated/10/pass-2026-09-08/. draft stays
+ // fast (single view, no matte), and a rembg miss still falls back to
+ // the original image rather than failing the generation.
+ matte: tier.id !== 'draft',
},
});
} catch (err) {