# Posed RGBD generation

Generate posed views from image, depth, and camera context.

`atlasGenerate` generates posed RGB views at target cameras from one or more
posed RGBD context frames. Use it to see the same scene from new camera
positions or angles. If you start with RGB images alone, use
[images2PosedRGBD](/images-to-posed-images) to estimate depth and camera poses
first. To render from depth and give the scene a different look, use
[atlasChisel](/depth-guided-generation#restyle-a-scene).

See the [`atlasGenerate` API reference](/api-reference/atlas-generate) for request fields and response details.

## Prepare RGBD context

Every `contextFrames` entry requires an `imageAsset`, `depth`, and `camera`.
Keep those three values aligned to the same view and coordinate system. Target
cameras determine how many frames are generated and their order in the
response. All context cameras must declare the same width and height; that
resolution may differ from the target cameras' resolution.

When using `images2PosedRGBD` output, check the returned image's grid and
framing against its depth and camera before supplying it as context. Omitting
`targetResolution` can retain the original RGB beside lower-resolution depth.
See [Choose the output grid](/images-to-posed-images#choose-the-output-grid).
Keep each context image and its maps on the grid described by its camera.
Target cameras specify the generated output size. The aspect-ratio requirement
for `returnDepth` is described below.

Use undistorted pinhole images. Rectify fisheye or lens-distorted images before
upload, align their depth to the rectified grid, and update the camera
intrinsics. Atlas does not accept lens-distortion coefficients or automatically
undistort uploaded images. See
[Cameras and posed images](/cameras-and-posed-images#resizing-without-changing-the-rays).

`depth` takes the same two encodings as `atlasChisel` target-frame depth: a
linear-depth EXR in `depthAsset`, or an 8- or 16-bit inverted log-depth PNG
in `logDepthAsset` with its `zMin` and `zMax`. Mark sky and other pixels with no
surface as `0` (or `NaN` or infinity in an EXR), not as a distant surface; any
finite positive depth is read as geometry. See
[Encode depth](/depth-guided-generation#encode-depth).

All target cameras must share one size: 1280 × 720, 960 × 720, 528 × 704, or
720 × 1280 (width × height). Atlas selects the model; `atlasGenerate` does
not accept a `model` selector.

![The four supported Atlas Generate target sizes drawn at the same scale: 1280 by 720, 960 by 720, 528 by 704, and 720 by 1280.](/media/atlas-diagrams/atlas-target-resolutions.svg "All targets in one request use the same size. Context views may use a different resolution.")

Context depth is required even when `returnDepth` is `false`.

Describe the scene's content and appearance in `prompt`, for example
"A quiet stone courtyard at blue hour." Do not use editing instructions such
as "add a car to the scene" or camera-trajectory descriptions such as
"rotate around the person." Define camera movement with `targetCameras`;
use [masked editing](/inpainting) to change part of a scene.

Prompt enhancement is enabled by default. Atlas writes a scene description from
your prompt and context images before generating. Preserve `promptUsed` from the
response to audit the description, or reuse it with `enhancePrompt: false` on a
later request. You can also pass a structured Atlas scene description as
`prompt` with `enhancePrompt: false`. Keep the complete JSON string intact.

Omit `modelParameters.numSteps` to use the selected model's default number of
generation steps.

## Explore generation settings

Change the counts, target size, and flags to see how they affect generation,
output depth, and whether a request can finish during submission. Select a
step in the request path for details. This illustration does not submit a
request or validate your camera geometry.

The [interactive generation explorer](/atlas-generate#explore-generation-settings) shows the effect of context count, target count, output size, and request flags. Atlas validates the request and resolves assets, then either completes an eligible request during submission or returns an operation to follow. Prompt enhancement is optional. Generation is followed by depth reconstruction when requested, either in the generation call or in a separate step. The illustration does not check camera translation or principal points; see the output-depth requirements below.

## Generate a video or camera path

To start from recorded footage, prepare still-image context using
[Using video footage with Atlas](/using-video-footage). It also covers how to
insert a frozen-time camera move between synchronized recordings.

[Make a video](/scene-to-video) walks through a complete example. Sample the
camera path at the final frame rate and submit the complete ordered
trajectory as `targetCameras` in one `atlasGenerate` request. Atlas handles the
sequence internally, generating keyframes and using them as context for the
frames between them. Assemble the returned images in response order at that
frame rate. Set `returnDepth: false` when only video frames are needed.

Do not split a continuous trajectory into independent frame requests or small
batches as a performance optimization. Separate requests do not share generated
sequence context, and changing the target count can change model routing.
Reusing the same seed does not make separate requests equivalent to one sequence;
stitching their outputs can introduce flicker and layout jumps. The number of
target cameras one request can hold depends on its context frames: with 8
context frames, about 1,500. A request over the limit is rejected at
submission with HTTP `422`. If a trajectory exceeds the limit, shorten it or
plan separate shots rather than assuming independently rendered batches will
join continuously.

Use sparse preview renders to inspect framing, then regenerate those camera
positions as part of the complete final sequence. Do not splice preview outputs
into the final video. If waiting times out, resume the existing operation rather
than resubmitting its frames separately; see [Operations](/operations).

Choose context views for consistent geometry and useful coverage of the path.
One posed image is valid context. Add generated RGBD views when they reveal
needed areas and remain consistent with the scene; do not automatically include
every generated view. More context is not a guarantee of better continuity.

## Request output depth

Set `returnDepth: true` to reconstruct depth for the generated views and attach
it to each returned frame. The depth scale comes from the camera centers, so a
request whose context and target cameras all share one center (a pure-rotation
rig) is rejected with HTTP `422` at submission. Translate at least one camera,
or set `returnDepth` to `false`.

Atlas chooses how to generate the views and reconstruct their depth from the
context count, target count, and output size. With `returnDepth: true`, depth
is reconstructed in the generation call
when there are at most 11 context frames, at most 32 targets, and the target
size is not 720 × 1280. Other requests use a separate depth step.

When a separate depth step is needed, the context images and cameras anchor
the reconstruction; their supplied depth is not used in that step. The context
aspect ratio must match the target cameras' (a 1920 × 1080 context image works
with 1280 × 720 targets, a 1280 × 720 one does not work with 960 × 720 targets),
and every target camera's principal point must be within 5% of the image
center. Violating either requirement rejects the request with HTTP `422` at
submission. A context frame helps this reconstruction only when its camera's
principal point is centered.

These aspect-ratio and principal-point restrictions do not apply when depth
is reconstructed in the generation call. The camera-translation requirement
applies to both paths. Oversized requests can still exceed the generation
budget and be rejected; submitting more views does not guarantee acceptance.

Returned depth can contain `NaN` where the reconstruction found no reliable
geometry; see
[Missing values in returned depth](/cameras-and-posed-images#missing-values-in-returned-depth).

## Reconstruct splats from generated views

`atlasGenerate` returns images, cameras, and optional reconstructed depth for
individual views. Views can look plausible on their own while disagreeing on
surface depth or object placement. Combining those views into one 3D scene can
expose seams, doubled surfaces, or flicker as the viewing camera moves.

Use [posedImages2Splats](/posed-images-to-splats) to reconstruct a Gaussian
splat asset from consistent posed RGBD views. Reconstruction and refinement do
not guarantee that conflicting geometry or objects across inputs will be fixed.

### Generate and inspect the views

Use the [TypeScript client setup](/web-quickstart). In this example, `wl` is
your configured client, `contextFrames` contains your posed RGBD references,
and `targetCameras` contains overlapping views of the scene at 1280 × 720.
For a single room, start with 8–16 well-distributed views. Include translated
camera positions so output depth can recover scale.

```ts
const generation = await wl.tasks.atlasGenerate({
  contextFrames,
  targetCameras,
  returnDepth: true,
});
console.log("Generation operation:", generation.id);
const generated = await wl.operations.wait(generation, {
  signal: AbortSignal.timeout(15 * 60_000),
});
if (generated.error) throw new Error(generated.error.message ?? "Generation failed");
const frames = generated.response?.frames;
if (!frames || frames.length < 2) throw new Error("At least two views are required");
console.log(frames);
```

Before submitting the reconstruction, inspect the returned images and their
aligned depth from neighboring cameras. Check that shared objects agree in
position and shape, views overlap, and important surfaces have valid depth.
Replace inconsistent views or improve the context coverage before proceeding.
Keep each returned image, camera, and depth together in the same coordinate
system and scale. See [Splat best practices](/splat-best-practices).

### Submit the reconstruction

After inspecting the frames, pass their images, cameras, and linear depth to
`posedImages2Splats`. Each successful task is billed separately; see
[splat pricing](/posed-images-to-splats).

```ts
const posedFrames = frames.map((frame) => {
  if (!frame.depth || !("depthAsset" in frame.depth)) {
    throw new Error("Each view needs linear depth; use returnDepth: true");
  }
  return {
    imageAsset: frame.imageAsset,
    camera: frame.camera,
    depth: { depthAsset: frame.depth.depthAsset },
  };
});
const reconstruction = await wl.tasks.posedImages2Splats({ posedFrames });
console.log("Splat operation:", reconstruction.id);
const splats = await wl.operations.wait(reconstruction, {
  signal: AbortSignal.timeout(30 * 60_000),
});
if (splats.error) throw new Error(splats.error.message ?? "Reconstruction failed");
if (!splats.response) throw new Error("Reconstruction returned no result");
console.log(splats.response.refinedSplats);
```

The result maps splat counts to downloadable SPZ assets. Save both operation
IDs. If waiting times out, resume the existing operation using
[Operations](/operations) rather than submitting the same task again.

## Get the frames in the submission response

A request sent with `?wait=true` and `enhancePrompt` set to `false` can come
back from its submission already `done: true`. By default that response names
each output file by `assetId` and `url`. Set `base64Outputs` to `true` to
receive each file in that response as a base64 data URL instead. The service
then skips storing the files before it answers, and you skip downloading them. A
later read of the operation names the files by `assetId` and `url` either way.
Frames are JPEG in both cases. Depth answered at submission is half-float EXR,
which reads any depth above 65504 as infinity; depth the operation produces
later is float32 EXR. See [Operations](/operations).

Submission completion requires `?wait=true` and `enhancePrompt: false`.
It is available for requests with at most 16 context frames, at most 16
targets, and a target size other than 720 × 1280. With `returnDepth: true`,
the limits are 11 context frames and 4 targets. Eligibility does not guarantee
completion before the wait deadline; keep the operation ID and follow it.

## Example completed output

After the operation reports `done: true`, its task-specific result is in
`operation.response`. This example requested output depth:

```json
{
  "frames": [
    {
      "imageAsset": {
        "assetId": "asset_generated_view_0",
        "url": "https://example.com/generated-view-0.jpg"
      },
      "camera": {
        "extrinsics": {
          "position": [0.5, 1.6, -1.2],
          "quaternion": [0, 0, 0, 1],
          "coordinateSystem": "rub"
        },
        "intrinsics": {
          "width": 1280,
          "height": 720,
          "fx": 900,
          "fy": 900,
          "cx": 640,
          "cy": 360
        }
      },
      "depth": {
        "depthAsset": {
          "assetId": "asset_generated_depth_0",
          "url": "https://example.com/generated-view-0.exr"
        },
        "confidenceAsset": {
          "assetId": "asset_generated_confidence_0",
          "url": "https://example.com/confidence-0.png"
        }
      }
    }
  ],
  "promptUsed": "A quiet stone courtyard at blue hour",
  "requestId": "request_example"
}
```

When `returnDepth` is false, each frame contains only its generated
`imageAsset` and `camera`. Open the
[atlasGenerate reference](/api-reference/atlas-generate) for
the live request limits and complete schemas.