Skip to main content
The scene model builds an explorable 3D scene — a Gaussian splat in .spz format — from a text prompt or a 360° panorama. This guide runs the whole loop:
  1. Create a scene from a prompt with POST /v1/scenes/pano. You get the .spz, the generated panorama, and an initial batch of posed images.
  2. Generate new images from a camera you choose with POST /v1/scenes/generate. They become a generated batch.
  3. Reconstruct the scene from both batches with POST /v1/scenes/reconstruct, for an updated .spz.
Each step is an asynchronous task: it answers at once with a scn_ task ID, and you poll GET /v1/scenes/{task_id} while it’s queued or processing, until it’s ready. Set VIGGLE_API_KEY and run the example below as-is — it needs no other input.

What you need

  • An API key from the Viggle Dashboard, exported as VIGGLE_API_KEY
  • A text prompt, up to 1000 characters — or a 360° panorama, as a public URL or an image file
  • Credits: 1 credit ($0.01) per view, each time the model runs; a panorama counts as 6 views. The example below builds a scene from a prompt (6 views), generates one perspective view (1), and reconstructs from both batches (7), for 14 credits ($0.14). A task that doesn’t finish ready is refunded in full.

Key ideas

  • Session. Every request carries a sessionId you choose (1–128 letters, digits, _, or -). A session holds one scene and its image batches, and runs one task at a time — wait for a task to finish before submitting the next one in the same session.
  • Batch. A set of posed images in a session. pano makes the initial batch, each generate makes a generated one. Their batchIds are what generate and reconstruct take in referenceBatchIds.
  • Camera. Poses are 4 × 4 camera-to-world matrices (c2w) in the scene’s frame. Every image in a batch comes with its c2w, so the simplest way to pick a new camera is to move an existing one. generate also takes the camera as targetPosition — a position plus yaw and pitch in degrees — instead of a matrix.

Build, extend, and reconstruct

The script creates a scene, saves scene.spz and panorama.png, generates new views from a camera moved 0.3 units sideways from the first view, then reconstructs and saves scene-v2.spz.
Open scene.spz and scene-v2.spz in any viewer that reads SPZ Gaussian splats.

Responses

Every submission answers immediately with a queued task — or processing, if a GPU slot was free. credits is what it reserved, and queuePosition how many tasks are ahead of it:
Poll GET /v1/scenes/{task_id} until status is ready, failed, or cancelled. What a ready result holds depends on the operation: Each outputBatch.views[] entry has the image url, its camera c2w, and intrinsic. Signed URLs last 3 hours — fetch the task again for fresh ones — and a task stays readable for about 72 hours after it finishes. See Get Scene Task for every field.

Start from your own panorama

Replace prompt with panoramaUri in step 1:
Or upload the image itself — JPEG, PNG, or WebP, up to 50 MiB — by sending step 1 as multipart/form-data with a panorama file:
See Upload a panorama file for the form’s rules. To place the panorama at a pose and scale in your own world — so every camera comes back in your coordinates — use POST /v1/scenes/custom-pano with panoramaC2w and metersPerUnit.

Place the camera by position and angles

Instead of editing a c2w matrix in step 2, you can give generate a targetPosition: a position and a yaw and pitch in degrees. Positive yaw turns left and positive pitch looks up; with both 0 the camera looks down −Z.
Send targetC2w or targetPosition, not both. See Target position.

If something fails

  • 402 on submit: the balance can’t cover the task — 1 credit per view it runs on, 6 for a panorama. Top up and submit again.
  • 409 on submit: the session already has a task running. error.details.running_task_id names it; wait for it, then submit again.
  • Task failed or cancelled: its credits are refunded in full; resubmitting reserves them again.
  • Task failed with INVALID_REQUEST: the model rejected the input, for example a batch from another session. Fix it before retrying.
  • Task failed with PROCESSING_FAILED, or cancelled: submit the same request again.
  • 404 on poll: wrong task ID, a task from another account, or past the 72-hour retention.

Create Scene

Prompt, panorama, reference images, and quality.

Generate Scene Views

Cameras, projection, field of view, and seed.

Reconstruct Scene

Rebuild the .spz from your batches.

Get Scene Task

The task object, result fields, and errors.