Open History to see the last commit
1/**
2 * World Labs Marble model ids for `worldlabsWorld('marble-1.1')`.
3 */
4
5export const WORLDLABS_WORLD_MODELS = [
6 'marble-1.1-plus',
7 'marble-1.1',
8 'marble-1.0',
9 'marble-1.0-draft',
10] as const
11
12export type WorldLabsWorldModel = (typeof WORLDLABS_WORLD_MODELS)[number]
13
14export function isWorldLabsWorldModel(
15 model: string,
16): model is WorldLabsWorldModel {
17 return (WORLDLABS_WORLD_MODELS as ReadonlyArray<string>).includes(model)
18}
19
20export interface WorldLabsMediaRef {
21 /** Public URL for the media. */
22 uri?: string
23 /** Id from a previous media-asset upload. */
24 mediaAssetId?: string
25 /** Base64-encoded file bytes. */
26 dataBase64?: string
27 /** File extension without a dot, used with `dataBase64`. */
28 extension?: string
29}
30
31export interface WorldLabsLocatedImageRef extends WorldLabsMediaRef {
32 /** Horizontal angle in degrees. 0 is front, 90 is right, 180 is back. */
33 azimuth?: number
34}
35
36/**
37 * Provider options for World Labs world generation.
38 *
39 * `createWorld` sends these on the generate request. Image, multi-image, and
40 * video inputs select the matching World Labs prompt type. Text-only calls
41 * use `generateWorld({ prompt })`.
42 */
43export interface WorldLabsWorldProviderOptions {
44 /** Optional title stored on the world. Max 64 characters. */
45 displayName?: string
46 /** Random seed for generation. */
47 seed?: number
48 /** Optional tags. Max 10 tags, each up to 32 characters. */
49 tags?: Array<string>
50 /** If true, use the text prompt as-is without recaptioning. */
51 disableRecaption?: boolean
52 /**
53 * How to treat a single image as a panorama. `auto` detects equirectangular
54 * panos. `true` always treats the image as a pano. `false` treats it as a
55 * standard image.
56 */
57 isPano?: 'auto' | true | false
58 /** Single image input. Do not combine with `images` or `video`. */
59 image?: WorldLabsMediaRef
60 /** Multiple images of the same scene. Do not combine with `image` or `video`. */
61 images?: Array<WorldLabsLocatedImageRef>
62 /** Video input. Do not combine with `image` or `images`. */
63 video?: WorldLabsMediaRef
64 /** World visibility. Default is private. */
65 permission?: {
66 public?: boolean
67 }
68 /**
69 * When false, return after the generate call with `status: 'waiting'` and
70 * `operationId`. Default is true: poll until the world is ready.
71 */
72 wait?: boolean
73 /** Poll interval in milliseconds when `wait` is true. Default 2000. */
74 pollIntervalMs?: number
75}
76
77export type WorldLabsWorldModelProviderOptionsByName = {
78 [M in WorldLabsWorldModel]: WorldLabsWorldProviderOptions
79}