Run the example
The recorded-control cookbook example generates test depth video, connects to the hosted model, waits for the upload to be accepted, and saves a preview snapshot. Start with the supplied test video, then substitute your own simulator output.Upload and render
- Export a supported control video from your simulator or preparation tool.
- Connect a Reactor session and upload the complete control clip using the SDK upload API.
- Wait for source readiness, then send
generatewith a scene caption and output settings. - Inspect
main_videoand wait fordoneorfailed. - While idle, reuse the same source with another caption to compare appearance variants.
Prepare the input
Upload a complete video with a video MIME type, up to 128 MiB. It must contain at least the requested number of frames at 30 or 29.97 FPS. That rate describes the input and playback, rather than how fast the model generates frames. Prepare the video asdepth, edge, blur, or seg
(segmentation) before uploading it. Start with depth exported from your simulator.
What control means
control declares the representation already present in your uploaded video. It does not extract
that representation from ordinary RGB footage. Prepare the matching pixels before uploading:
These are learned visual constraints, not guarantees of exact geometry or label preservation.
Selecting
seg does not perform segmentation, and selecting depth does not estimate depth.
The incremental episode interface accepts depth only; these four choices apply to generate.
After uploading, wait for a new state_update reporting has_source: true and generating: false.
Then send generate with this JSON payload through the SDK:
Output sizes are respectively 832×480, 736×544, 640×640, 544×736, and 480×832. Uploaded controls are
directly resized. Their aspect ratio must match the selected output within 3%; mismatches are
rejected. Account for resizing when comparing labels.
Export metric simulator depth
For a concrete conversion, use the cookbook depth-preparation example. It accepts ordered 2D floating-point camera-depth arrays in meters and writes RGB8 PNGs plus 30 FPS video. It includes synthetic metric inputs so you can try it before connecting a simulator. Choose the nearest and farthest distances to include, and use those same bounds for every frame. The example maps near to white and far to black, clips values outside the bounds, and treats invalid pixels as background. Changing the bounds for each frame would make the same distance appear at different brightnesses over time. If your simulator returns a nonlinear depth buffer, convert it to distances in meters first. Render at the selected output size with consistent camera projection; the converter does not resize images. Test whether this preparation produces useful observations for your simulator.Follow generation
Themain_video track carries RGB preview frames as they become available. state_update reports
source readiness and whether generation is active. done reports how many generated frames were
queued for playback; some may still be waiting to stream. failed reports an input problem discovered
during generation. Invalid commands are refused, including busy, missing_control, and
invalid_input.
Upload only while idle and validate the video type and 128 MiB size limit locally. With Python SDK
1.10.0, upload_file can return a file reference even when the model rejects an upload, without
reliably reporting that rejection to the caller. Confirm acceptance through a new state_update
after the upload, with a timeout. An earlier has_source: true value may refer to the previous
video, which can remain loaded if its replacement is rejected.
Generation can still emit failed if the video cannot be decoded or its frame count, FPS, or aspect
ratio is invalid. Handle that message as well as command refusals. The cookbook example resets
before uploading so it cannot silently reuse an earlier video.
Wait until the request is no longer generating before starting another run. You can reuse the
uploaded control with a different prompt. reset stops generation at a safe boundary, clears the
control, and flushes pending playback; upload again before the next request. There is no pause
command.