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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
Text & Image to 3D (Forge)
This atlas entry traces the "Text/Image-to-3D (Forge)" cluster end-to-end from real source. Routes are resolved through vercel.json rewrites (not the default pages/<route>.html convention in every case).
Routing facts (from vercel.json):
/forge→pages/forge.html(loadssrc/forge.js+ 29 siblingsrc/forge-*.jsmodules)./image-to-3d→pages/forge.html(same app; lands with the photos tab preselected and its own document title;?mode=imageon any forge URL does the same)./forge-max→pages/forge.html(same app; lands with the High tier pinned and "Forge Max" header copy;?tier=draft|standard|highpresets the selector on any forge URL)./forge/share/<id>→api/forge-share.js(SSR page that bakes OG/Twitter/Farcaster preview meta plus a schema.org3DModelJSON-LD node for crawlers (built byapi/_lib/creation-jsonld.js: the GLB, a poster rendered by/api/render/glb, the creator, the date); stored preview-image URLs pass throughnormalizeStoredUrl()before they reach a browser, so a rawr2.devURL never lands in the OG/Twitter/Farcaster tags, then JS-redirects browsers to/forge?share=<id>, which opens the creation in the viewer; a private or unknown id redirects to/forgeinstead)./features/forge→pages/features/forge.html(static marketing landing, no app module)./create/prompt→pages/create-prompt.html→src/create-prompt.js(text → rigged avatar, a different backend from Forge)./tutorials/text-to-3dand/tutorials/image-to-3d→pages/tutorial.html(one shared template) whichfetches/docs/tutorials/<slug>.mdand renders it with marked.js. Read-only content pages.
Forge (Text / Photos / Sketch → 3D) at /forge
- Source:
pages/forge.html(~4800 lines: full composer/stage markup + styles)src/forge.js(~4400 lines: main controller, catalog, engine/tier selection, job submit, polling, result, gating; importssrc/forge-timeline.jsfor the generation stage timeline andsrc/forge-compare.jsfor side-by-side compare)src/forge-prompt-studio.js(Surprise-me + prompt coach; prompts come from the slot-grammar generatorsrc/forge-prompt-gen.js),src/forge-enhance.js(AI prompt rewrite →/api/forge-enhance),src/forge-directed-prompt.js(reveals the server's art-director rewrite from thedirected_promptresponse field, with copy, "use as my prompt", and a one-click "Try a variation" that re-fires the generation on the unchanged brief, since the director and the reference painter are stochastic and resolve it differently each run)src/forge-dropzone.js(paste/drop image handling),src/forge-reveal.js(WebGL "materialize" dissolve overlay),src/forge-wait.js(rotating craft tips while generating)src/forge-refine.js(in-browser geometry refine, no API),src/forge-stylize.js(→/api/forge-stylize),src/forge-optimize.js(→/api/forge-remesh, and mounts the in-browser mesh tools fromsrc/mesh-ops/),src/forge-gameready.js(→/api/forge-gameready)src/forge-rig.js(auto-rig →POST /api/forge?action=rig),src/forge-materials.js(PBR material restyle →POST /api/material-studio?action=restyle),src/forge-conversational-refine.js(free-text shape iteration →POST /api/forge-iterate),src/forge-more-like-this.js(one-tap material/finish variation chips),src/forge-segment.jssrc/forge-export.js(the download format menu: in-browser OBJ/STL/PLY/USDZ export, GitHub README 3D copy, server-side FBX/3MF, and the slicer and Craftcloud print rows),src/forge-reel.js(client-side looping video + hero still + transparent-PNG cutout capture),src/forge-embed-panel.js,src/forge-ar.js,src/forge-showcase.js(community feed with upvotes)src/forge-modly.js(the opt-in "Use your GPU" panel, transport insrc/modly-local.js),src/forge-pay.js(pay-per-generation $THREE rail →src/token-pay.js→/api/token/quote|settle)
- Entry point: Direct nav to
/forge,/image-to-3d(photo tab preselected), or/forge-max(High tier pinned); CTAs from/features/forge("Open Forge →"), the two tutorial pages, blogtext-to-3d-is-live, gallery, and the/forgeempty-state idle viewer. Also reachable as the "make an object/prop" alternative linked from/create/prompt. - Prerequisites / gates:
- None for the default lane. Draft/Standard tiers on the free NVIDIA-hosted engine require no auth, no wallet, no payment ("No account required for your first model").
- BYOK engines (Fast, Meshy, Tripo, Rodin, Stability, Replicate) require the user to paste their own provider API key (kept in-browser, sent as
x-forge-provider-keyheader). Tripo is the exception: when the deployment setsTRIPO_API_KEYit is a house lane that needs no key from the user, and the result card and exported GLB name Tripo and its model version. - High quality tier is gated: it is a
$THREEholder perk (hold-OR-pay). A holder clears it with a tier pass (attachTierPass); a non-holder gets a402 three_hold_requiredand may pay-per-generation in $THREE viaforge-pay.js, or hold $THREE. BYOK High is server-exempt (no pass needed). A server-side comp allowlist (api/_lib/comp-access.js, wired intorequireFeatureAccessandGET /api/three/access) clears an allowlisted account through every $THREE gate (forge.high,forge.gameready, and any gate added later) with no holding, wallet, or payment. - Rate limiting applies on the paid lane (server-side, surfaced as a recoverable
429state).
- Steps (core text→3D path):
- User lands on
/forge;forge.jsfetches the engine/tier catalog (GET /api/forge?catalog=1) and live backend health (GET /api/forge?health=1), then builds the tier buttons (Draft/Standard/High) and the per-mode engine selector. The empty stage (#state-empty) shows an idle community/sample model. - Mode tab defaults to Describe it (text). Tabs: Describe it, From photos, From a sketch (the sketch tab stays
hiddenuntil the catalog reports a live TripoSG sketch engine). - (text) User types a prompt in
#prompt(max 1000 chars). Live: a character counter, a prompt coach grading the prompt (tip/warn/strong, fromforge-prompt-studio.js; its empty-prompt message is shipped inline inforge.htmland markeddata-no-i18n, because an empty span that filled in on boot wrapped onto its own line and pushed the tiles, composer and chips down 38px), and example chips with a "↻ More ideas" swap. The static chip labels inforge.htmlare written at the generator's 64-character cap ("a low-poly red fox sitting upright, matte fur, soft studio light", etc.) and carry nodata-i18n; on every JS visitforge-prompt-studio.jsswaps them for generated prompts (generateForgeChipSet) whose combined width never exceeds the labels they replace, so the flex-wrapped row cannot gain a line and shift the page. - (optional) User clicks Surprise me to fill a random vivid prompt, or Enhance (injected by
forge-enhance.js) to rewrite their text viaPOST /api/forge-enhanceinto a sharper single-subject FLUX→TRELLIS prompt. - (optional) User picks a Quality tier (Draft / Standard / High). Selecting High while locked reveals the in-place lock panel + holder note linking to
/three; a wallet-aware perk line / "Connect wallet" chip may appear under Generate. - (optional) User picks an Engine. Engines are filtered by mode (text/photo/sketch input). BYOK engines show a key glyph; choosing one reveals the
#byok-rowAPI-key input with a provider-specific hint. Health-degraded engines show an amber dot; down/unconfigured ones show a red dot, are disabled, and carry the reason in the tooltip; a legend under the picker decodes both dots and the FREE/key pills. - (optional) User sets the reference-image aspect ratio (1:1 / 4:3 / 3:4 / 16:9), shown only when relevant to the mode/engine. A live estimate line (
#estimate) shows the catalog's real cost/time for the current tier+engine, and a quote line under it (#forge-quote, rendered bysrc/forge-keep.jsfrom the public, no-spendGET /api/forge-quote) prices the generation for the current path, tier, engine and options from the same tier and pricing-catalog code the generator charges from. - User clicks Generate (or ⌘/Ctrl+Enter).
collectComposerCfg()validates (text ≥ 3 chars). If High is locked and submitted via keyboard, the gate/upsell opens instead of firing. startJob()POSTs to/api/forgewith{ prompt, aspect_ratio, path, tier, backend }plus headers (client id, BYOK key if any, $THREE tier pass if eligible/needed, minted/awaited before the request whenhighTierNeedsPass()). Stage switches to#state-generating.- Generating state: a named stage timeline (
#gen-stages, rendered byforge-timeline.js) animates; every row and state change is driven by a real/api/forgesignal, so the lane decides which stages exist (a no-reference-image engine never shows one). Below it: an honest elapsed-vs-typical progress bar (asymptotic, never fakes 100%, recolors amber past the catalog ETA), a "feel free to leave this page" hint, and a Cancel button. When the API reportscold_startfor a scale-to-zero self-hosted GPU lane, a "Waking up a GPU" warming card appears and is dismissed by the first real running poll, never by a timer (a keep-warm cron,/api/cron/gpu-keepwarm, holds allowlisted GPU workers open during peak hours; every routed scale-to-zero lane is registered there, includinghunyuan3d, the High image tier's default engine and the fleet's longest spin-up at 75 s, though it stays off by default because the region's L4 grant is already spoken for). While waiting,forge-wait.jsrotates curated craft tips. The reference image no longer waits for the job id: the page mints a trace id, sends it with the submit, and pollsGET /api/forge?progress=<traceId>while its own POST is still open, so the director's rewrite, the reference view and the extra view count paint as the server passes each real milestone (api/_lib/forge-progress.jswrites the crumbs). It is fail-open, with no timers and no guessed crumbs: without a trace id, or on a deployment that does not serve the channel, the submit response's ownpreview_image_urlstill paints the reference pane a moment later. - If the engine is the synchronous free draft lane, the POST returns the finished
glb_urldirectly; otherwiseforge.jspollsGET /api/forge?job=<id>every interval untilstatus:"done"(withglb_url),failed, or timeout. The loop is built onsrc/shared/resilient-poll.js, so a backgrounded phone tab, a dropped radio, or the odd edge502is retried and woken on visibility rather than read as a dead job, with the give-up budget counted in attempts. A free-text NVIDIA job the lane never resolves gets one automatic resubmit, and a stall the cron observes cools that lane's circuit breaker so new free-text requests stop landing on it. When an async lane fails after accepting the job, the server's poll-time failover (api/_lib/forge-failover.js) continues it on the next configured lane under the same id and the generating panel says so (" hit a snag. Continuing on , no action needed."); TripoSG is the last photo rung, after every textured lane, and the note adds that it returns the shape without textures. - On done:
showResult()sets the<model-viewer src>, plays the WebGL materialize reveal (forge-reveal.js, skipped under reduced-motion), shows the result bar, wires the Download GLB anchor, and (ifcreation_id) shows a "Saved ✓" auto-save chip. Underprefers-reduced-motionthe result viewer dropsauto-rotate(camera controls stay, so the model is still fully inspectable by drag, pinch and arrow key), and the "Nice model. What now?" handoff card retracts on its own instead of sitting over the result bar's own next-step buttons. The result action row carries seventeen tools and wraps, so every one of them stays clickable at 320px. Geometry-first/sketch results with no reference image get a captured poster frame (POST /api/forge-poster). - (optional) User rates the model: 👍 Keep / 👎 Discard (verdict) →
POST /api/forge-feedback; or tags a category (Avatar/Creature/Item/Accessory/Scene/Vehicle) →POST /api/forge-categorize. A Making this for: chip row (Game / Web / Avatar / Simulation / Print / AR / Just playing, fromsrc/shared/forge-destinations.js) asks once what the model is for: the answer is written onto the model on screen viaPOST /api/forge-feedbackand remembered per browser, so every later generation sends it asdestination. (Data flywheel.) - (optional) Refine → : re-runs the exact same prompt/views one quality tier higher (re-enters step 9). Shown only when a higher tier exists and the job is re-runnable. Every user-initiated generation is stamped with a random seed that rides on the stored job, and Refine, Retry, "Generate anyway" and an automatic lane hop all replay it, so Refine returns this model at higher quality instead of a different object; only a fresh submit (and "Make another") mints a new seed.
- (optional) Refine panel (
forge-refine.js), instant in-browser geometry passes (weld/smooth/relax/decimate/subdivide), non-destructive, no API call, no rate limit. Download the refined GLB. - (optional) Iterate (
forge-conversational-refine.js): a free-text instruction against the model on screen ("make the helmet red", "add a cape") viaPOST /api/forge-iterate(polled). The only post-result action that changes the model's shape from natural language; same core as the MCPrefine_modeltool. - (optional) Stylize (
forge-stylize.js): voxels/bricks/lattice/low-poly geometric filters viaPOST /api/forge-stylize(worker job, polled), with a resolution slider, download, and revert. - (optional) Restyle materials (
forge-materials.js): free-text or preset-chip PBR re-skin (chrome, brushed gold, weathered wood, ...) via synchronousPOST /api/material-studio?action=restyle; geometry untouched. Same pipeline as the paidrestyle_materialMCP tool. - (optional) Rig for animation (
forge-rig.js): adds a humanoid skeleton + skin weights to the current GLB viaPOST /api/forge?action=rig(rigging runs on platform-paid capacity, so it is behind the same global hourly ceiling and per-client daily paid limit as the reconstruction lanes: a429withdaily_limit_reachedor an at-capacity message) (the self-hosted GCP model-rig worker, falling back to the configured Replicate rerig model), polled through the sameGET /api/forge?job=contract. - (optional) Optimize topology (
forge-optimize.js): tri/quad/low-poly remesh viaPOST /api/forge-remesh(polled). Above the server remesh sit the in-browser mesh tools (src/mesh-ops/): repair, smooth and decimate run in a browser worker with undo, no upload. - (optional) Game-Ready (
forge-gameready.js): retopologize to a poly budget and export a textured GLB + FBX for Unity/Unreal viaPOST /api/forge-gameready(polled), with budget slider + wireframe preview. Gated on the same $THREE hold-or-pay model as High tier: the panel resolves the viewer's real entitlement first (a signed-in holding or a connected wallet, viagetAccess/attachTierPass), a verified holder exports free, and a non-holder gets a server-quoted pay-per-export price in $THREE. - (optional) Split into parts → links to
/segment?mesh=<glb>(Parts Studio). Compose →/compose?glb=<glb>(Scene Composer / attach to avatar). Place IRL →/irl?avatar=<glb>(anchor the model in a real room). - (optional) Export (
forge-export.js): the download split-button's format menu carries GLB, OBJ, STL, PLY, USDZ, FBX, 3MF and GitHub README 3D (copies markup that GitHub renders as an interactive model; it works from the saved model URL, so an unsaved in-browser edit cannot use it). OBJ / STL / PLY / USDZ convert in the browser (lazy three.js exporters, no upload); FBX and 3MF have no browser exporter and are converted server-side by the remesh worker (POST /api/forge-remeshwithoperation:"convert"), which re-containers the mesh without touching geometry so a rigged model keeps its skeleton. A server format is a real polled job: it reports queued/converting, relays the converter's own reason on failure, and leaves a download-again link for a minute; starting a new generation retires a conversion still polling for the previous model. For a saved model the menu also offers Open in OrcaSlicer and Open in Bambu Studio (orcaslicer://andbambustudio://links to a sized STL served by/api/slicer; PrusaSlicer is download-only because it only accepts a fixed host allowlist) and Get it printed, live prices from Craftcloud's print network where the buyer pays Craftcloud directly (src/craftcloud-print.js). A footer credits meshoptimizer and glTF-Transform. - (optional) Reel (
forge-reel.js): fully client-side cinematic capture of the model into a looping video (MP4 or WebM), a hero still, and a transparent-PNG cutout; no upload, no worker. - (optional) Embed (
forge-embed-panel.js): generate an embeddable web-component snippet for the model. - (optional) View in AR (
forge-ar.js) / model-viewer'sar(webxr/scene-viewer/quick-look): place the model in the room. The AR panel also links to the multi-model AR Studio (/ar/studio?src=<glb>). - (optional) Share →
forge-share-btn: when the creation was persisted server-side it shares a real permalink,/forge/share/<id>, that unfurls with a preview card (an Xplayercard pointing at/forge/embedfor a finished creation,summary_large_imageotherwise); otherwise it falls back to a remix link (/forge?prompt=). Cinema mode (fullscreen turntable for screen recording, F/Esc). More like this (forge-more-like-this.js): one-tap chips that re-run the same subject with a different material/finish via theforge:run-promptevent (text results only). - User clicks Download GLB: first, for a saved creation,
ensureKept()(src/forge-keep.js) asksGET /api/forge-keep?creation_id=<uuid>whether the original file may be released. Pay-to-keep is off unless the owner setsFORGE_PAY_TO_KEEP=on(npm run forge:pay-to-keep -- on|off|status); while off, every creation answerskept:trueand Download behaves as it always did. When on, a $THREE holder keeps free, High is already paid or held at generation time, and everyone else pays theforge.keep.<tier>price once through the $THREE quote/sign/settle rail (POST /api/forge-keep,402 three_hold_requiredwith the price when unpaid); a refusal shows its message in the quote line and the download does not proceed, while a server fault fails open. Then the anchor fetches + "stamps" the GLB (#download[data-stamping]), reportsdownloaded:truefeedback, and saves the file. OR clicks Make another to reset to the idle composer.
- User lands on
- Photo / multi-view branch (steps 3-11 differ): "From photos" tab shows up to 6 view slots (Front/Back/Left/Right/Top/3-4) with a live "N of 6 views" counter + pips. Each photo is uploaded via presign
POST /api/forge-upload→PUTto object storage; the public URL is recorded. Drag-to-reorder, paste (⌘V/Ctrl+V), drop, or click-to-browse (PNG/JPG/WebP, ≤8MB). An optional guidance prompt is allowed. Submit posts{ image_urls, prompt?, ... }. A server-side vision pre-check can reject an unusable photo (422 image_not_usable) → recoverable "Generate anyway" override. - Use your GPU branch (photos tab, opt-in): the Use your GPU panel (
forge-modly.js) probes a local Modly app on loopback only when the user presses Connect, never on page load. Its downloaded image-to-3D models join the engine picker badged "Your GPU, free"; the timeline shows Modly's real percent and step text, Cancel calls Modly's own cancel endpoint, and the finished GLB is copied to storage through/api/scene-glb-uploadso rig, optimize, AR and embed get a public URL (a save row writes it to the avatar library via/api/avatars/from-forge). Not running, browser blocked (Chrome Local Network Access, Safari mixed content), no models and custom-port states are designed. - Sketch branch: "From a sketch" tab (only when a live sketch engine exists) takes one drawing + a required description; outputs untextured geometry (user is told to Stylize/Retexture after).
- Decision points / branches:
- Mode: text vs photos vs sketch (gates which engines/inputs are valid).
- Tier: Draft/Standard (free) vs High ($THREE hold-or-pay or BYOK-exempt).
- Engine: free NVIDIA lane vs BYOK engines (reveals key field; text-only engines disabled when photos are attached).
- High gate resolution: hold $THREE (tier pass) → pay-per-generation ($THREE via
forge-pay.js) → drop to Draft/Standard. - Sync draft (POST returns done) vs async poll loop.
- Post-result fork: Refine-tier / Refine-local / Iterate / Stylize / Restyle-materials / Rig / Optimize / Game-Ready / Export / Reel / Embed / AR / Place-IRL / Share / More-like-this / Compose / Segment / Download / Make another.
- Gallery: side-by-side Compare mode (
forge-compare.js) when the same prompt was forged on 2+ engines; showcase cards are upvotable (auth-free, one vote per browser; the Forge-Off board) with a latest / top-this-week sort.
- External calls / dependencies:
- Catalog/health:
GET /api/forge?catalog=1,GET /api/forge?health=1 - Submit/poll:
POST /api/forge,GET /api/forge?job=<id> - Uploads:
POST /api/forge-upload(presign) +PUTobject storage. The presign check is the only size gate at request time (the 8 MB image ceiling comes fromANON_UPLOAD_LIMITS['forge/uploads/']inapi/_lib/anon-upload-limits.js), so the hourly cronapi/cron/anon-upload-sweep.jsdeletes anonymous objects that exceed their prefix ceiling after the fact. The presign handlers (forge-upload,scene-glb-upload) look the content type up withObject.hasOwn, so an inherited key such asconstructoris a400 invalid_content_type. - Cost preview and keep:
GET /api/forge-quote(public, read-only,?table=1for all tiers);GET|POST /api/forge-keep(pay-to-keep, below) - Flywheel:
POST /api/forge-feedback,POST /api/forge-categorize,POST /api/forge-poster - Galleries:
GET /api/forge-gallery?limit=24(your creations),GET /api/forge-gallery?scope=community&limit=24(showcase, plus&sort=for the Forge-Off board),POST /api/forge-vote(showcase upvotes),GET /api/forge-creation?id=(share open); gallery and showcase card previews are requested throughresizedImageUrl()(src/shared/image-url.js→/api/img), which asks for a 480px-wide server-resized WebP tile (20 to 40 KB) instead of the full-resolution render; same-origin,data:andblob:sources are passed through untouched.DELETE /api/forge-creation?id=(each "Your creations" card carries a two-tap arm-then-confirm delete, scoped to the owningx-forge-client; it erases the stored GLB, preview, and every recorded source photo upload, so an image-to-3D run's reference pictures leave object storage with it) - Post-processing jobs:
POST /api/forge-stylize,POST /api/forge-remesh,POST /api/forge-gameready,POST /api/forge-enhance,POST /api/forge-iterate(all polled by?job=);POST /api/forge?action=rig(auto-rig, polled byGET /api/forge?job=);POST /api/material-studio?action=restyle(synchronous) - Payment:
forge-pay.js→src/token-pay.js→/api/token/quote+/api/token/settle($THREE) - Access/tier pass:
/api/three/access(read) + tier-pass mint (referenced viaattachTierPass/getTierPass) - Generation engines: FLUX (image) → TRELLIS (mesh) free lane; BYOK Meshy / Tripo / Rodin / Stability / Replicate; Hunyuan3D / TripoSG (sketch). Hosted on NVIDIA NIM / providers; same pipeline exposed to agents over MCP at
/api/mcp-3d. - Photoreal reference-image path (the realism lever): the final mesh reads as real only if the reference image the reconstructor sees is a photoreal, single-subject, plain-seamless-background, evenly-lit photograph. Two pieces drive that:
POST /api/forge-enhance(director): rewrites the raw prompt into one centered real-world subject with material + surface micro-detail + neutral studio-lighting cues. It classifies the subject (person / animal / vehicle / food / object) and returns asubject-awarenegative_prompttargeting that class's failure modes (hands/faces for people, wheel-count/panel symmetry for vehicles, plastic-replica sheen for food). It prefers a Vertex Gemini rewrite (GCP credits) and falls through to the free-first LLM chain automatically, so it never hard-depends on Vertex. Response schema is unchanged apart from the additivesubjectfield.api/_lib/forge-reference-image.js→generateReferenceImage(directedPrompt, { aspectRatio, negativePrompt?, seed, skipNim }): generates the reconstruction reference image on the Vertex Gemini 2.5 Flash Image lane (imageConfig.imageSize:"2K"), tuned as a plain-background studio photo, with the director's negatives folded in as natural-language avoidance. Automatic fallthrough to the existing provider chain (textToImage: NIM FLUX free → Vertex Imagen → Replicate), returning{ imageUrl, model, lane }(generated base64 output is persisted through the sharedimage-persistlib). The same directed prompt + aspect + negatives within 24h reuses its cached reference set instead of re-spending a Vertex generation. WhennegativePromptis omitted it derives subject-aware negatives from the prompt itself, so a caller gets them for free.api/forge.jsimports it on the text→3D path (dynamic import withtextToImageas the fallback). The whole reference step (the Vertex lane, its QA score and corrective retry, and the fallthrough ladder) runs under one shared budget,TEXT_TO_IMAGE_BUDGET_MS(default 60 s), so a stalled image provider can no longer hold a submit open for minutes before a job exists. Separately from the client-side Enhance button,api/forge.jsruns its own art-director rewrite on every text prompt by default (senddirector: falseto skip it; it fails soft to the raw prompt).
- 3rd-party viewer: model-viewer 4.4.0, loaded by
src/shared/model-viewer-loader.jsfrom the googleapis CDN with jsDelivr and unpkg as fallbacks.
- Catalog/health:
- Success state: A textured GLB standing in the in-page
<model-viewer>(orbit/AR), auto-saved to "Your creations", with a downloadable file and all post-processing/export/embed/share actions enabled. Optional converted formats (OBJ/STL/PLY/USDZ/FBX) and a community showcase entry. - Empty / error states:
- Empty/idle (
#state-empty): isometric wireframe art + "Enter a prompt to generate", with a live sample/community model in the viewer. - Unconfigured (
#state-unconfigured): only for theunconfigurederror (no 3D engine reachable: none ofNVIDIA_API_KEY,HF_TOKEN, orREPLICATE_API_TOKENset); it names the env vars to set and offers no retry. - Generation failed (
#state-error): generic failure with "Try again", plus contextual recovery buttons: "Refine current model instead" (rate-limited fallback), "Generate anyway" (vision override). - BYOK errors:
needs_key/invalid_keyreveal + focus the key field;insufficient_creditsexplains provider is out of credits. 429/limiter-unavailable, and any other503(generation_unavailable: a worker still warming or a free lane that shed the request): the recoverable countdown state carrying the server's own message andretry_after(20 s when absent) + local-refine escape hatch.- Explicitly picked free engine unavailable (
503 provider_busy, e.g. the Hugging Face lane, which pauses for 300 s after a chain-wide Space failure and reads as down in?health=1so the picker disables it): when the response namesretry_backends, the page hops once automatically to the first one (the picker flips and the panel says " hit a snag. Retrying on "), and if that hop fails too it shows one-click engine switches; without suggestions it falls back to the recoverable countdown. - High gate
402 three_hold_required: designed upsell (held vs required, Get $THREE, Pay-per-use). - Payment errors:
payment_invalid/payment_expiredre-offer Pay;payment_already_usedclears the stale proof; a settle call that cannot be reached after the $THREE transfer already confirmed surfacessettle_unreachablewith the transaction signature, so the payment is reconciled rather than sent twice. - Upload errors: per-slot states (503 uploads unavailable, 429 rate-limited, too-large/empty/wrong-type, network).
POST /api/forge-uploadnow asks whether storage will accept the bytes (objectStorageUsable(), a cached signed one-key list) rather than whether the credential vars merely exist, so a rotated or whitespace-only R2 token answers503 storage_unavailable(or503 unconfigured, which falls the page back to accepting a public image URL) instead of handing out a signed URL whose CORS-less403 SignatureDoesNotMatchthe browser could only report as "Network error during upload". - Viewer load failure:
#viewer-load-erroroverlay → "use the download button to save the file directly".
- Empty/idle (
- Step count: ~12 required (text path, entry → download) + ~16 optional (surprise/enhance, tier/engine/aspect choices, refine-tier, refine-local, iterate, stylize, restyle-materials, rig, optimize, game-ready, export, reel, embed, AR, share/cinema/compare/compose/segment/verdict/category).
Forge marketing landing at /features/forge
- Source:
pages/features/forge.html(static; no app JS module, only nav/footer + an inline FAQ accordion script and model-viewer for the hero sample). Stylesheets:features-landing.css. - Entry point:
/featuresindex, SEO/search, social cards. - Prerequisites / gates: None, read-only marketing page.
- Steps (3):
- User reads the hero ("Type a description. Get a 3D model.", Flux + TRELLIS) and orbits the sample GLB (
/animations/robotexpressive.glb) in the hero model-viewer. - User reads the "Three steps from prompt to model" how-it-works, the highlight cards (AR inspection, agent avatar, shareable link, data flywheel), and expands FAQ items (inline
aria-expandedtoggle script). - User clicks Open Forge → (to
/forge) or Try Scan instead (/features/scan).
- User reads the hero ("Type a description. Get a 3D model.", Flux + TRELLIS) and orbits the sample GLB (
- Decision points / branches: Open Forge vs Try Scan vs All features; FAQ expand/collapse.
- External calls / dependencies: model-viewer CDN only. No API calls. (FAQ schema mentions Flux + TRELLIS; advertises GLB output and commercial-use rights.)
- Success state: User navigates into
/forge. - Empty / error states: None (static content). FAQ items collapsed by default.
- Step count: 3 required (read + click through) + 0 optional (FAQ expansion is incidental).
Describe it to 3D (prompt → rigged avatar) at /create/prompt
- Source:
pages/create-prompt.html+src/create-prompt.js. The page has a real light theme (:root[data-theme='light']) with AA-contrast secondary copy in both themes. Overlap note: this is the onboarding/avatar-creation cluster, not Forge. It shares the same conceptual "type a prompt → 3D" pattern but uses an entirely different backend: the selfie/avatar reconstruction + auto-rig pipeline, not the Forge engine catalog. It explicitly cross-links to/forgefor "making an object, prop, or scene piece instead of a character." Entry points include/create,/create-agent, dashboard avatars/agents pages, and the gallery. - Entry point: From
/create(andcreate.js), the create-agent flow, dashboard, and gallery "make one" CTAs. - Prerequisites / gates: Sign-in required ("Sign-in required" chip). A
401on submit or poll redirects to/login?next=/create/prompt?prompt=<typed prompt>, so the words already typed come back with the user. No wallet / no $THREE gate. Avatars default toprivatevisibility. - Steps (3 stages):
- Compose: User types a single-subject character description in
#prompt(max 600; counter; Generate disabled under 3 chars). Optional example chips fill the box. A?prompt=query param pre-fills the composer (remix/copy-prompt deep links; nothing auto-submits). Hint: "Single subject, full body works best." Cross-link offered to/forgefor objects. - User clicks Generate avatar (or ⌘/Ctrl+Enter).
start()POSTs/api/avatars/reconstruct{ name (derived from prompt), prompt, visibility:'private' }. UI switches to the Building stage (spinning orb). - Building: Live phased progress, Rendering a reference image… (Flux) → Reconstructing it into 3D… → Adding a skeleton so it can move…, with an elapsed clock. Polls
GET /api/avatars/regenerate-status?jobId=every 3s (up to 8 min). - Done: On
status:"done"+resultAvatarId, fetchesGET /api/avatars/<id>, previews the rigged GLB in the done model-viewer, shows tags (Animation-ready / Static mesh, riggable / Private to you). CTAs: Open in editor (/avatars/<id>/edit) and Make another. If no model URL yet, it redirects straight to the editor.
- Compose: User types a single-subject character description in
- Decision points / branches: Signed-in vs not (login redirect); rigged vs static-mesh tag; open editor vs make another; (offered) divert to
/forgefor non-characters. - External calls / dependencies:
POST /api/avatars/reconstruct,GET /api/avatars/regenerate-status?jobId=,GET /api/avatars/<id>. Flux text→image + reconstruct + auto-rig backend (shared with the selfie pipeline). model-viewer CDN. Dispatchestws:feature-donefor the site discovery layer. - Success state: A rigged GLB avatar saved to the user's account, previewed, ready to open in the avatar editor.
- Empty / error states: Compose inline error ("Add a few words…"). Build error box with friendly mappings: rate-limited (
txt2img_rate_limited/429), unconfigured (regen_unconfigured/txt2img_unconfigured→ suggests/create/selfie), provider billing, unreachable, render error, no-face-detected, NSFW-blocked, timeout, OOM; plus a "Back" recovery button. Each failure carries aretryableflag that decides which recovery buttons render: a full avatar library (402/plan_limit, also detected when a job loses the race mid-build) drops "Try again" and links to/dashboard(delete one) and/pricing(upgrade); an unconfigured engine drops it too; a429quotes the server'sRetry-Afterand holds the retry button for exactly that long. On failure the orb, progress bar and phase line freeze and Cancel goes away; the error box (role="alert") is the only live control. Cancel stays live for the whole building step, and every run holds a monotonic token so a cancelled build can never paint its late result over a newer one. Poll timeout message points the user to their dashboard. - Step count: 3 required (compose → generate → done) + 1 optional (pick an example chip), excludes downstream editor actions.
Tutorial: Text Prompt to 3D Model at /tutorials/text-to-3d
- Source:
pages/tutorial.html(shared template, renders any/tutorials/<slug>) + contentdocs/tutorials/text-to-3d.md. Slug resolved client-side, markdown fetched from/docs/tutorials/text-to-3d.md, rendered with marked.js + highlight.js. The server no longer ships that shell empty:server/crawler-body.mjsrenders the same markdown into the response body (leading title stripped, since the hero already owns theh1), and the client replaces the root wholesale on load, so a crawler that never runs the fetch still reads the whole tutorial instead of the shell's "Tutorial not found" fallback. Metadata/preview model come from/tutorials-manifest.js(window.TUTORIALS). The template also loads/live-steps.js(runnable```liveblocks: real API calls rendered inline) and/tutorial-figures.js(resolvesfigure:directives in the markdown into captured media, live 3D viewers, and a keyboard-navigable lightbox). Relative links in the markdown resolve againstdocs/tutorials/<slug>.md: sibling tutorials go to/tutorials/<slug>, other docs to/docs/<name>(with#sectionpreserved), and repo-only docs (docs/internal,docs/ops,docs/security) or cited source files open on GitHub. - Entry point:
/tutorialsindex,/docs, in-Forge "/docs" hint, blog, search, and cross-links from the image-to-3d and prompts-for-3d tutorials. - Prerequisites / gates: None, read-only content page. (The tutorial itself states: "no account, no wallet, no code.")
- Steps (read-only content page):
- Read intro + hero; orbit the interactive preview model (
<model-viewer>injected from the manifest'spreviewModel). - Read the 6 tutorial steps: Step 1 Open the Forge → Step 2 Describe the object → Step 3 Pick a quality tier → Step 4 Generate → Step 5 Inspect your model → Step 6 Download or share it; plus "Didn't get what you wanted?" troubleshooting and "What's next".
- (optional) Use the auto-generated heading anchors / table of contents; follow inline links to
/forge,/tutorials/image-to-3d,/tutorials/prompts-for-3d. - (optional) Use the prev/next pager (built from
window.TUTORIALS) to move between tutorials.
- Read intro + hero; orbit the interactive preview model (
- Decision points / branches: Navigate to
/forgeto actually do it, or to adjacent tutorials via inline links / pager. - External calls / dependencies:
GET /docs/tutorials/text-to-3d.md; marked.js + highlight.js CDNs; model-viewer CDN;/tutorials-manifest.js;/api/page-og(OG image only). - Success state: User understands the text→3D flow (content consumed); typically clicks through to
/forge. - Empty / error states: Template handles a missing/invalid slug (no entry → redirect/empty handling in
tutorial.html); a failed markdown fetch leaves the article empty. No interactive failure modes. - Step count: 2 required (read content + follow the embedded steps) + 2 optional (TOC anchors, prev/next pager / cross-links). Content covers 6 in-doc instructional steps.
Tutorial: Photos to 3D Model at /tutorials/image-to-3d
- Source:
pages/tutorial.html(same shared template) + contentdocs/tutorials/image-to-3d.md, fetched from/docs/tutorials/image-to-3d.md. - Entry point:
/tutorialsindex, the text-to-3d tutorial's "What's next", Forge photo-mode help, search. - Prerequisites / gates: None, read-only content page ("A phone camera is plenty.").
- Steps (read-only content page):
- Read intro + orbit the manifest preview model.
- Read the 5 tutorial steps: Step 1 Take good photos (1 object, plain bg, even light, fill frame, 4 angles) → Step 2 Open the Forge in photo mode → Step 3 Add guidance (optional) → Step 4 Pick a tier and generate → Step 5 Inspect, download, share; plus Troubleshooting and "What's next".
- (optional) Follow inline links to
/forgeand adjacent tutorials; use the pager.
- Decision points / branches: Go to
/forge(From photos tab) to execute; navigate to adjacent tutorials. - External calls / dependencies:
GET /docs/tutorials/image-to-3d.md; marked.js + highlight.js + model-viewer CDNs;/tutorials-manifest.js;/api/page-og. - Success state: User understands the photo/multi-view→3D flow; clicks through to
/forgephoto mode. - Empty / error states: Same template-level handling as the text-to-3d tutorial (missing slug, failed md fetch). No interactive failure modes.
- Step count: 2 required (read + follow embedded steps) + 2 optional (anchors, pager / cross-links). Content covers 5 in-doc instructional steps.
Notes
- All five routes' sources were located and traced from real code. No missing sources.
/create/promptis included here because it overlaps the "type a prompt → 3D" pattern, but it belongs to the onboarding/avatar cluster and uses the avatar reconstruct + auto-rig backend (/api/avatars/*), distinct from Forge's/api/forgeengine catalog. It is the one route in this cluster that is auth-gated./features/forgeis pure marketing (no app module); the two tutorials are read-only markdown rendered by one sharedtutorial.htmltemplate.