Marble 2 beta

TypeScript quickstart

Turn a photo into a new viewpoint with Atlas. Run this on your server with Node.js 24 and a Developer API key.

For CLI installation, the bundled SKILL.md, and agent usage, see CLI.

Read How To Use Atlas before choosing model inputs or combining tasks. For coordinate calculations, use Cameras and posed images.

1. Install

Install the latest tag of the public TypeScript client.

bash
mkdir atlas-demo && cd atlas-demonpm init -ynpm pkg set type=modulenpm install @worldlabsai/client@latest

Create .env with WLT_API_KEY=your_key_here and add .env to .gitignore.

2. Generate a view

Save as generate.ts. The sample photo of a torii gate is by Daniel Erlandson on Pexels.

ts
import { createClient } from "@worldlabsai/client";
const apiKey = process.env.WLT_API_KEY;if (!apiKey) throw new Error("Set WLT_API_KEY in .env");const wl = createClient({ apiKey });const signal = AbortSignal.timeout(300_000);const imageUrl =  "https://images.pexels.com/photos/31252468/pexels-photo-31252468.jpeg?auto=compress&cs=tinysrgb&w=1280";
const posing = await wl.tasks.images2PosedRGBD(  { frames: [{ imageAsset: { url: imageUrl } }], targetResolution: [1280, 720] },  { signal },);const posed = await wl.operations.wait(posing, { signal });if (posed.error) throw new Error(posed.error.message ?? "Posing failed");const context = posed.response?.frames[0];if (!context) throw new Error("Posing returned no frame");
const { imageAsset, camera, depth } = context;const target = structuredClone(camera);target.extrinsics.position[0] += 0.25;const generation = await wl.tasks.atlasGenerate(  {    contextFrames: [{ imageAsset, camera, depth }],    targetCameras: [target],    prompt: "The same scene from a nearby viewpoint",  },  { signal },);const generated = await wl.operations.wait(generation, { signal });if (generated.error) throw new Error(generated.error.message ?? "Generation failed");const outputUrl = generated.response?.frames?.[0]?.imageAsset.url;if (!outputUrl) throw new Error("Atlas returned no image URL");console.log(outputUrl);

3. See the result

bash
node --env-file=.env generate.ts

Open the printed URL to see the generated image. The camera moves 0.25 metres along world X in the estimated scene. Metric scale is predicted, so physical distances are approximate.

For a web app, run generation in a backend job and return its status to the browser. Save operation IDs to resume polling and reuse an idempotency key for retries of the same submission. A timeout stops local waiting; it does not cancel the server task. See How To Use Atlas for camera controls and depth output.

For CPU processing of depth with Three.js, apply the EXR row mapping before unprojecting or matching image pixels.