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.

feat(forge): sketch→3D tests, docs, changelog + TripoSG deploy handoff

nirholas601e1f4d127a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 01697b406..3a78b4ea6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **New /launches page: every agent-launched coin in one live feed** — There is now a public feed of every coin launched by a three.ws agent at /launches — live market caps, graduation badges, buyback rates, and a card linking straight to the agent behind each launch. Agent profile pages also gained a launch history: every coin an agent has ever launched is listed on its page with a live market cap and a link into the public feed. Find it in the nav under Discover → Agent Launches. (`/launches`) `[feature]`
- **Pay a real x402 oracle inside the $THREE town** — The $THREE town in /play now has an Intel Kiosk by the plaza: walk up, press E, and buy live $THREE market intel — price, 24 h change, market cap, and a bullish/bearish/neutral signal — for $0.01 USDC paid from your own wallet over x402, settled on-chain on Solana. The oracle behind it (/api/x402/three-intel) is also listed in the bazaar, so any agent can buy the same feed. The Agent Wallet demo is now linked from the /play menu too. (`/play`) `[feature]`
- **Reliability sweep: faster galleries, working voices, sturdier pages** — A pass over every error in the production logs. Avatar thumbnails and 3D models now load through three.ws itself instead of a rate-limited storage domain, so gallery pages stop dropping images under load. Text-to-speech voices are back (the upstream voice service had changed its protocol). Leaving a world on /play no longer hits a crash that could leave the session connected in the background. The homepage 3D demos politely step aside on devices without WebGL instead of breaking, payment demo requests get more time to settle on-chain, and the $THREE market stats failover stops hammering an exhausted data provider. `[fix, improvement, infra]`
+- **Sketch-to-3D comes to the Forge** — Forge gains a third way to make a model: draw it. The new “From a sketch” mode takes one drawing plus a short line saying what it depicts and generates real 3D geometry from it, powered by a self-hosted TripoSG sketch engine — the same research-grade model family behind Tripo. Sketch results are untextured geometry by design, so the existing Stylize and Retexture tools pick up right where it leaves off. The tab appears automatically once the sketch engine is live on the deployment. (`/forge`) `[feature]`
- **The 3D world is back on solid ground — and locked against griefing** — world.three.ws was dropping every visitor into a black void: the shared scene's script file had gone missing, so the ground unloaded the moment you joined. We restored the scene, cleared out broken leftover objects, and the meadow, sky, and sunlight are back. Building in the world now requires an admin code, so visitors can no longer delete the ground or fill the space with broken uploads, and the upload size cap was tightened. A new automated health check watches the world's assets so this class of breakage gets caught before anyone falls through the floor again. `[fix, security, infra]`
- **zauth's security agent moves into the $THREE town** — A new character stands in the $THREE town plaza on /play: the security agent from zauth, the x402 trust company. Walk up and it calls zauth's live paid API on the spot, quoting the real on-chain price for a RepoScan — name any GitHub repository and for $0.05 USDC, paid from your own wallet straight to zauth on Solana or Base, it scans the code for provenance, contributor verification, and vulnerabilities, then hands back a 0–100 trust score with a full written report. Scans keep running while you play; the agent calls out when your report is ready. (`/play`) `[feature]`
diff --git a/data/changelog.json b/data/changelog.json
index a53344666..f2350381d 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1117,6 +1117,15 @@
"fix"
],
"link": "/forge"
+ },
+ {
+ "date": "2026-06-12",
+ "title": "Sketch-to-3D comes to the Forge",
+ "summary": "Forge gains a third way to make a model: draw it. The new “From a sketch” mode takes one drawing plus a short line saying what it depicts and generates real 3D geometry from it, powered by a self-hosted TripoSG sketch engine — the same research-grade model family behind Tripo. Sketch results are untextured geometry by design, so the existing Stylize and Retexture tools pick up right where it leaves off. The tab appears automatically once the sketch engine is live on the deployment.",
+ "tags": [
+ "feature"
+ ],
+ "link": "/forge"
}
]
}
diff --git a/docs/roadmap/generation-suite.md b/docs/roadmap/generation-suite.md
index 5555b09ec..a3b4c8ab7 100644
--- a/docs/roadmap/generation-suite.md
+++ b/docs/roadmap/generation-suite.md
@@ -68,8 +68,8 @@ Everything here is written and containerized; it needs deployment + env wiring.
`model-text2motion` from their existing Dockerfiles/cloudbuild.yaml, and print the URL +
key pairs for Vercel env.
2. **Set the env vars** (names): `GCP_REMESH_URL`, `GCP_STYLIZE_URL`, `GCP_SEGMENT_URL`,
- `GCP_REMBG_URL`, `GCP_TEXTURE_URL`, `GCP_TEXT2MOTION_URL` (+ shared
- `GCP_RECONSTRUCTION_KEY`), `LONGCAT_WORKER_URL`/`LONGCAT_WORKER_KEY`.
+ `GCP_REMBG_URL`, `GCP_TEXTURE_URL`, `GCP_TEXT2MOTION_URL`, `GCP_TRIPOSG_URL`
+ (+ shared `GCP_RECONSTRUCTION_KEY`), `LONGCAT_WORKER_URL`/`LONGCAT_WORKER_KEY`.
3. **Auto-rig**: deploy `workers/unirig` (or pin a Replicate UniRig build) and set
`REPLICATE_RERIG_MODEL` / route through the GCP pipeline. Rig is the gateway to the
avatar/animation economy — it unlocks `/forge-motion` clips on generated meshes.
@@ -96,8 +96,14 @@ What they have that we don't (or that we hide). Ordered by user impact.
expose a format picker on download instead of GLB-only.
4. **PBR material controls.** High tier claims PBR; expose map outputs (albedo/normal/
roughness/metallic) and a re-bake option in the result panel.
-5. **Sketch→3D.** Accept a drawing/sketch as the reference image with a controlnet-style
- preprocessing pass (line-art conditioning) before reconstruction. Tripo headline feature.
+5. **Sketch→3D.** ✅ Built 2026-06-12 on TripoSG-scribble (VAST AI, MIT) — a native
+ sketch+prompt→geometry model, not a controlnet preprocessing hack. New
+ `workers/model-triposg` GPU worker (also added to the avatar pipeline's mesh pool as
+ the TripoSR quality successor), `sketch` path through forge-tiers / gcp provider /
+ `/api/forge`, and a "From a sketch" mode on `/forge` that only appears when the
+ engine is live. ❌ Not deployed: stage weights (`stage-weights.sh`, key `triposg`),
+ deploy the worker (`deploy-all.sh`), set `GCP_TRIPOSG_URL` in Vercel. Output is
+ untextured geometry — pairs with retexture/stylize (item 1).
6. **Job webhooks + public API docs.** Replicate webhook plumbing exists for avatars; extend
to forge jobs and publish the endpoint contract (we already sell it via x402 — document it
like a product, with examples).
diff --git a/public/changelog.json b/public/changelog.json
index 9ee52bae1..2815fe4a6 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-12T06:06:04.920Z",
+ "generated_at": "2026-06-12T06:13:01.713Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -110,6 +110,16 @@
"infra"
]
},
+ {
+ "date": "2026-06-12",
+ "type": "update",
+ "title": "Sketch-to-3D comes to the Forge",
+ "summary": "Forge gains a third way to make a model: draw it. The new “From a sketch” mode takes one drawing plus a short line saying what it depicts and generates real 3D geometry from it, powered by a self-hosted TripoSG sketch engine — the same research-grade model family behind Tripo. Sketch results are untextured geometry by design, so the existing Stylize and Retexture tools pick up right where it leaves off. The tab appears automatically once the sketch engine is live on the deployment.",
+ "link": "/forge",
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-06-12",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 00f1db125..e9abeca2c 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -86,6 +86,14 @@
<category>fix</category>
<description>A pass over every error in the production logs. Avatar thumbnails and 3D models now load through three.ws itself instead of a rate-limited storage domain, so gallery pages stop dropping images under load. Text-to-speech voices are back (the upstream voice service had changed its protocol). Leaving a world on /play no longer hits a crash that could leave the session connected in the background. The homepage 3D demos politely step aside on devices without WebGL instead of breaking, payment demo requests get more time to settle on-chain, and the $THREE market stats failover stops hammering an exhausted data provider.</description>
</item>
+ <item>
+ <title>Sketch-to-3D comes to the Forge</title>
+ <link>https://three.ws/forge</link>
+ <guid isPermaLink="false">2026-06-12:Sketch-to-3D comes to the Forge</guid>
+ <pubDate>Fri, 12 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Forge gains a third way to make a model: draw it. The new “From a sketch” mode takes one drawing plus a short line saying what it depicts and generates real 3D geometry from it, powered by a self-hosted TripoSG sketch engine — the same research-grade model family behind Tripo. Sketch results are untextured geometry by design, so the existing Stylize and Retexture tools pick up right where it leaves off. The tab appears automatically once the sketch engine is live on the deployment.</description>
+ </item>
<item>
<title>The 3D world is back on solid ground — and locked against griefing</title>
<link>https://three.ws/changelog</link>
diff --git a/public/features.json b/public/features.json
index c50067ac2..417a60130 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-12T06:06:04.907Z",
+ "generated_at": "2026-06-12T06:13:01.691Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/tests/api/forge-sketch.test.js b/tests/api/forge-sketch.test.js
new file mode 100644
index 000000000..30d4f0056
--- /dev/null
+++ b/tests/api/forge-sketch.test.js
@@ -0,0 +1,181 @@
+// Sketch→3D (TripoSG) — registry + provider routing contract.
+//
+// Covers the path added for sketch-conditioned generation:
+// • forge-tiers registers a sketch path with TripoSG as its self-host
+// default, configured only when GCP_TRIPOSG_URL (+ shared key) is set,
+// and never disturbs the image/geometry defaults.
+// • The GCP provider's `sketch` mode posts the drawing + prompt to the
+// TripoSG worker's /infer in scribble mode, carries the tier's poly
+// budget, and resolves the finished GLB from result_gcs_url on poll.
+//
+// We stub global fetch to capture the worker submit body and to model the
+// worker's task responses; no network, no mocked product data.
+
+import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
+
+const ORIGINAL_FETCH = globalThis.fetch;
+const ENV_KEYS = ['GCP_TRIPOSG_URL', 'GCP_RECONSTRUCTION_KEY', 'NVIDIA_API_KEY'];
+const ORIGINAL_ENV = Object.fromEntries(ENV_KEYS.map((k) => [k, process.env[k]]));
+
+const WORKER_URL = 'https://model-triposg-test.a.run.app';
+
+beforeEach(() => {
+ process.env.GCP_TRIPOSG_URL = WORKER_URL;
+ process.env.GCP_RECONSTRUCTION_KEY = 'test-shared-key';
+ delete process.env.NVIDIA_API_KEY;
+});
+
+afterEach(() => {
+ globalThis.fetch = ORIGINAL_FETCH;
+ for (const k of ENV_KEYS) {
+ if (ORIGINAL_ENV[k] === undefined) delete process.env[k];
+ else process.env[k] = ORIGINAL_ENV[k];
+ }
+});
+
+describe('forge-tiers — sketch path registration', () => {
+ it('registers sketch as a first-class path with TripoSG as its default', async () => {
+ const { PATHS, BACKENDS, DEFAULT_BACKEND_FOR_PATH, resolveBackendId } = await import(
+ '../../api/_lib/forge-tiers.js'
+ );
+ expect(PATHS).toContain('sketch');
+ expect(DEFAULT_BACKEND_FOR_PATH.sketch).toBe('triposg');
+ expect(resolveBackendId({ path: 'sketch', tier: 'standard' })).toBe('triposg');
+
+ const b = BACKENDS.triposg;
+ expect(b.provider).toBe('gcp');
+ expect(b.byok).toBe(false);
+ expect(b.paths).toEqual(['sketch']);
+ expect(b.requiresEnv).toEqual(['GCP_TRIPOSG_URL', 'GCP_RECONSTRUCTION_KEY']);
+ // The worker decimates to the tier's budget — poly control is real here.
+ expect(b.polyControl).toBe(true);
+ });
+
+ it('is configured only when the worker URL + shared key are present', async () => {
+ const { backendIsConfigured } = await import('../../api/_lib/forge-tiers.js');
+ expect(backendIsConfigured('triposg')).toBe(true);
+ delete process.env.GCP_TRIPOSG_URL;
+ expect(backendIsConfigured('triposg')).toBe(false);
+ });
+
+ it('never serves the image or geometry paths, even when explicitly named', async () => {
+ const { resolveBackendId } = await import('../../api/_lib/forge-tiers.js');
+ // An explicit backend is honored only when it serves the requested path —
+ // a photo/text submission naming triposg falls back to that path's default.
+ expect(resolveBackendId({ path: 'image', tier: 'standard', backend: 'triposg' })).toBe('trellis');
+ expect(resolveBackendId({ path: 'geometry', tier: 'standard', backend: 'triposg' })).toBe('meshy');
+ // And the standing defaults are untouched.
+ expect(resolveBackendId({ path: 'image', tier: 'standard' })).toBe('trellis');
+ expect(resolveBackendId({ path: 'geometry', tier: 'draft' })).toBe('meshy');
+ });
+
+ it('surfaces the sketch lane in the public catalog with per-tier estimates', async () => {
+ const { buildCatalog } = await import('../../api/_lib/forge-tiers.js');
+ const cat = buildCatalog();
+ expect(cat.paths).toContain('sketch');
+ expect(cat.default_backend.sketch).toBe('triposg');
+ expect(cat.default_backend_for_tier.standard.sketch).toBe('triposg');
+
+ const lane = cat.backends.find((b) => b.id === 'triposg');
+ expect(lane).toBeTruthy();
+ expect(lane.configured).toBe(true);
+ expect(lane.byok).toBeNull();
+ expect(lane.user_images).toBe(true);
+ const est = lane.estimates.sketch.find((e) => e.tier === 'standard');
+ expect(est.eta_seconds).toBeGreaterThan(0);
+ expect(est.credits).toBeNull(); // self-host — bills GPU time, not credits
+ });
+});
+
+describe('gcp provider — sketch mode routing', () => {
+ async function freshProvider() {
+ const mod = await import('../../api/_providers/gcp.js?t=' + Math.random());
+ return mod.createRegenProvider();
+ }
+
+ it('supports the sketch mode only when GCP_TRIPOSG_URL is set', async () => {
+ let provider = await freshProvider();
+ expect(provider.supportsMode('sketch')).toBe(true);
+ delete process.env.GCP_TRIPOSG_URL;
+ provider = await freshProvider();
+ expect(provider.supportsMode('sketch')).toBe(false);
+ });
+
+ it('posts the drawing + prompt to /infer in scribble mode with the poly budget', async () => {
+ const calls = [];
+ globalThis.fetch = vi.fn(async (url, opts) => {
+ calls.push({ url: String(url), body: JSON.parse(opts.body), headers: opts.headers });
+ return new Response(JSON.stringify({ task_id: 'task-abc', status: 'queued' }), {
+ status: 202,
+ headers: { 'content-type': 'application/json' },
+ });
+ });
+
+ const provider = await freshProvider();
+ const job = await provider.submit({
+ mode: 'sketch',
+ sourceUrl: 'https://cdn.example.com/sketch.png',
+ params: { prompt: 'a cartoon rocket with two tail fins', target_polycount: 30_000 },
+ });
+
+ expect(calls).toHaveLength(1);
+ expect(calls[0].url).toBe(`${WORKER_URL}/infer`);
+ expect(calls[0].headers.authorization).toBe('Bearer test-shared-key');
+ expect(calls[0].body).toEqual({
+ images: ['https://cdn.example.com/sketch.png'],
+ prompt: 'a cartoon rocket with two tail fins',
+ mode: 'scribble',
+ target_polycount: 30_000,
+ });
+ expect(job.extJobId).toBeTruthy();
+ expect(job.backend).toBe('gcp');
+ });
+
+ it('resolves the finished mesh from result_gcs_url on poll', async () => {
+ // Submit first so the job envelope packs the sketch mode + worker URL.
+ globalThis.fetch = vi.fn(async () =>
+ new Response(JSON.stringify({ task_id: 'task-abc', status: 'queued' }), { status: 202 }),
+ );
+ const provider = await freshProvider();
+ const job = await provider.submit({
+ mode: 'sketch',
+ sourceUrl: 'https://cdn.example.com/sketch.png',
+ params: { prompt: 'a glazed ceramic teapot' },
+ });
+
+ const glb = 'https://storage.googleapis.com/bucket/raw-meshes/triposg/task-abc.glb';
+ globalThis.fetch = vi.fn(async (url) => {
+ expect(String(url)).toBe(`${WORKER_URL}/tasks/task-abc`);
+ return new Response(JSON.stringify({ task_id: 'task-abc', status: 'done', result_gcs_url: glb }), {
+ status: 200,
+ headers: { 'content-type': 'application/json' },
+ });
+ });
+
+ const status = await provider.status(job.extJobId);
+ expect(status.status).toBe('done');
+ expect(status.resultGlbUrl).toBe(glb);
+ });
+
+ it('reports a designed failure when the worker errors the task', async () => {
+ globalThis.fetch = vi.fn(async () =>
+ new Response(JSON.stringify({ task_id: 'task-abc', status: 'queued' }), { status: 202 }),
+ );
+ const provider = await freshProvider();
+ const job = await provider.submit({
+ mode: 'sketch',
+ sourceUrl: 'https://cdn.example.com/sketch.png',
+ params: { prompt: 'a vintage film camera' },
+ });
+
+ globalThis.fetch = vi.fn(async () =>
+ new Response(
+ JSON.stringify({ task_id: 'task-abc', status: 'failed', error: 'inference failed' }),
+ { status: 200, headers: { 'content-type': 'application/json' } },
+ ),
+ );
+ const status = await provider.status(job.extJobId);
+ expect(status.status).toBe('failed');
+ expect(status.error).toBe('inference failed');
+ });
+});
diff --git a/workers/README.md b/workers/README.md
index c72fb90f7..5a47d6506 100644
--- a/workers/README.md
+++ b/workers/README.md
@@ -10,7 +10,7 @@ Out-of-process compute for three.ws — the heavy and edge work that does not be
The avatar pipeline turns a photo into a rigged, blendshape-ready 3D GLB by fanning out to single-purpose GPU services, coordinated by a CPU controller. The controller keeps the same HTTP contract as the original reconstruction service so `api/_providers/gcp.js` needs no changes.
### `avatar-pipeline-controller/` (CPU)
-The orchestrator (`main.py`). Exposes `POST /reconstruct` (`{ images: [...], body_type? }` -> `202 { job_id, status }`), `GET /jobs/:id` (`{ status, glb_url?, error?, model }`), and `GET /health`. It picks a mesh backend (Hunyuan3D / TRELLIS / TripoSR) via weighted random, runs reconstruction, then auto-rigs the result through UniRig and uploads the final GLB.
+The orchestrator (`main.py`). Exposes `POST /reconstruct` (`{ images: [...], body_type? }` -> `202 { job_id, status }`), `GET /jobs/:id` (`{ status, glb_url?, error?, model }`), and `GET /health`. It picks a mesh backend (Hunyuan3D / TRELLIS / TripoSR / TripoSG) via weighted random, runs reconstruction, then auto-rigs the result through UniRig and uploads the final GLB.
### `model-hunyuan3d/` (GPU L4)
Hunyuan3D-2.1: single image -> textured 3D mesh. `POST /infer` -> `202 { task_id }`, `GET /tasks/:id` -> `{ status, result_gcs_url?, error? }`.
@@ -21,6 +21,9 @@ Microsoft TRELLIS (MIT): single image -> textured 3D mesh via structured latent
### `model-triposr/` (GPU L4)
TripoSR (VAST-AI, MIT): fast single-image -> 3D mesh (~5–15 s, baked single texture). Used as a fast-path / fallback. Same `/infer` contract.
+### `model-triposg/` (GPU L4)
+TripoSG (VAST-AI Research, MIT): 1.5B rectified-flow transformer, single image or sketch -> high-fidelity 3D shape (geometry only — no textures; pair with `texture/`). Two modes on the same `/infer` contract: `mode: "image"` (RMBG-1.4 background removal + recenter, 50 steps — the quality successor to TripoSR in the avatar pipeline pool) and `mode: "scribble"` (drawing + required prompt via the CFG-distilled TripoSG-scribble pipeline, 16 steps — powers the `/forge` sketch→3D path). Decimates to `target_polycount` via pymeshlab when supplied. Weights: `VAST-AI/TripoSG` + `VAST-AI/TripoSG-scribble` + `briaai/RMBG-1.4` (staged by `deploy/stage-weights.sh`, service key `triposg`). Routed two ways: through the controller (`MODEL_TRIPOSG_URL`) for avatar reconstruction, and directly via `api/_providers/gcp.js` (`sketch` mode, `GCP_TRIPOSG_URL`) for forge sketch→3D.
+
### `unirig/` (GPU L4)
UniRig (VAST-AI-Research, MIT): takes a raw generated mesh and adds a humanoid skeleton, per-vertex skinning weights, and ARKit-52 blendshapes — turning a static mesh into a riggable avatar.
diff --git a/workers/deploy/deploy-all.sh b/workers/deploy/deploy-all.sh
index 42513b13f..f8f936604 100755
--- a/workers/deploy/deploy-all.sh
+++ b/workers/deploy/deploy-all.sh
@@ -189,6 +189,16 @@ log "controller health:"
curl -fsS -H "authorization: Bearer ${API_KEY_VALUE}" "${CONTROLLER_URL}/health" || warn "health check did not return 200 yet (cold start) — retry in a minute"
echo
+# The forge sketch→3D lane talks to the TripoSG worker directly (not through
+# the controller), so its URL is a separate Vercel env var.
+TRIPOSG_HANDOFF=""
+if [ -n "${SERVICE_URL[triposg]:-}" ]; then
+ TRIPOSG_HANDOFF=" GCP_TRIPOSG_URL = ${SERVICE_URL[triposg]}
+
+ vercel env add GCP_TRIPOSG_URL production # paste the TripoSG URL (forge sketch→3D)
+"
+fi
+
cat <<EOF
────────────────────────────────────────────────────────────────────────
@@ -197,7 +207,7 @@ cat <<EOF
AVATAR_REGEN_PROVIDER = gcp
GCP_RECONSTRUCTION_URL = ${CONTROLLER_URL}
GCP_RECONSTRUCTION_KEY = ${API_KEY_VALUE}
-
+${TRIPOSG_HANDOFF}
vercel env add AVATAR_REGEN_PROVIDER production # paste: gcp
vercel env add GCP_RECONSTRUCTION_URL production # paste the URL above
vercel env add GCP_RECONSTRUCTION_KEY production # paste the key above