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} 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 public URL of a 360° panorama
  • Credits: none — scene tasks don’t currently consume credits

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.

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 processing task:
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:
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.

Save results to your own storage

Add spzOutputUrl — or outputUris with spz, preview, or panorama — to any request, and Viggle uploads those files to your URLs with PUT. Presigned S3, R2, or GCS upload URLs work. An .spz sent to your URL isn’t kept by Viggle; the result’s spz.url is then your URL. See Upload to your own storage.

If something fails

  • 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 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.