@decartai/sdk 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -10
- package/dist/create-client.d.ts +46 -0
- package/dist/create-client.js +208 -0
- package/dist/files/types.js +4 -1
- package/dist/index.d.ts +8 -150
- package/dist/index.js +6 -116
- package/dist/index.react-native.d.ts +36 -0
- package/dist/index.react-native.js +9 -0
- package/dist/package.js +4 -0
- package/dist/process/types.d.ts +2 -2
- package/dist/realtime/browser/frame-metadata-diagnostics.js +90 -0
- package/dist/realtime/browser/frame-metadata-worker.js +2 -0
- package/dist/realtime/browser/index.js +32 -0
- package/dist/realtime/{mirror-stream.js → browser/mirror-stream.js} +2 -2
- package/dist/realtime/{preflight.js → browser/preflight.js} +20 -115
- package/dist/realtime/browser/prepare-connection.js +57 -0
- package/dist/realtime/client.d.ts +11 -4
- package/dist/realtime/client.js +42 -37
- package/dist/realtime/config-realtime.js +51 -0
- package/dist/realtime/livekit.js +26 -0
- package/dist/realtime/media-channel.js +40 -11
- package/dist/realtime/methods.d.ts +1 -1
- package/dist/realtime/methods.js +7 -2
- package/dist/realtime/observability/connection-quality.d.ts +3 -3
- package/dist/realtime/observability/connection-quality.js +3 -1
- package/dist/realtime/observability/g2g.d.ts +14 -0
- package/dist/realtime/observability/realtime-observability.js +8 -32
- package/dist/realtime/observability/webrtc-stats.d.ts +4 -4
- package/dist/realtime/preflight-connectivity.js +102 -0
- package/dist/realtime/preflight-types.d.ts +30 -0
- package/dist/realtime/react-native/index.js +36 -0
- package/dist/realtime/react-native/preflight.js +10 -0
- package/dist/realtime/react-native/prepare-connection.js +26 -0
- package/dist/realtime/signaling-channel.js +3 -1
- package/dist/realtime/stream-session.js +5 -4
- package/dist/realtime/subscribe-client.js +11 -10
- package/dist/shared/model.d.ts +56 -37
- package/dist/shared/model.js +61 -18
- package/dist/shared/request.js +5 -4
- package/dist/shared/types.d.ts +2 -2
- package/dist/shared/types.js +9 -2
- package/dist/utils/errors.d.ts +3 -0
- package/dist/utils/errors.js +16 -1
- package/dist/utils/media.js +1 -1
- package/dist/utils/platform.js +17 -1
- package/dist/utils/runtime.js +13 -0
- package/dist/utils/user-agent.js +1 -1
- package/dist/version.js +9 -4
- package/package.json +10 -3
- package/dist/realtime/observability/glass-to-glass.d.ts +0 -41
- package/dist/realtime/observability/glass-to-glass.js +0 -229
- package/dist/realtime/observability/pixel-marker.js +0 -144
- package/dist/realtime/preflight.d.ts +0 -59
package/dist/shared/model.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ declare const canonicalModelSchema: z.ZodEnum<{
|
|
|
7
7
|
"lucy-2.5": "lucy-2.5";
|
|
8
8
|
"lucy-vton-2": "lucy-vton-2";
|
|
9
9
|
"lucy-vton-3": "lucy-vton-3";
|
|
10
|
+
"lucy-vton-3.5": "lucy-vton-3.5";
|
|
10
11
|
"lucy-restyle-2": "lucy-restyle-2";
|
|
11
12
|
"lucy-clip": "lucy-clip";
|
|
12
13
|
"lucy-image-2": "lucy-image-2";
|
|
@@ -17,7 +18,6 @@ type CanonicalModel = z.infer<typeof canonicalModelSchema>;
|
|
|
17
18
|
* Old names still work but will log a deprecation warning.
|
|
18
19
|
*/
|
|
19
20
|
declare const modelAliases: {
|
|
20
|
-
readonly mirage_v2: "lucy-restyle-2";
|
|
21
21
|
readonly "lucy-2.1-vton-2": "lucy-vton-2";
|
|
22
22
|
readonly "lucy-pro-v2v": "lucy-clip";
|
|
23
23
|
readonly "lucy-restyle-v2v": "lucy-restyle-2";
|
|
@@ -25,10 +25,10 @@ declare const modelAliases: {
|
|
|
25
25
|
};
|
|
26
26
|
/** @internal Test-only helper to reset deprecation warning tracking */
|
|
27
27
|
|
|
28
|
-
declare const realtimeModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-2.1">, z.ZodLiteral<"lucy-2.5">, z.ZodLiteral<"lucy-vton-2">, z.ZodLiteral<"lucy-vton-3">, z.ZodLiteral<"lucy-
|
|
29
|
-
declare const videoModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-clip">, z.ZodLiteral<"lucy-2.1">, z.ZodLiteral<"lucy-2.5">, z.ZodLiteral<"lucy-vton-2">, z.ZodLiteral<"lucy-vton-3">, z.ZodLiteral<"lucy-restyle-2">, z.ZodLiteral<"lucy-latest">, z.ZodLiteral<"lucy-vton-latest">, z.ZodLiteral<"lucy-restyle-latest">, z.ZodLiteral<"lucy-clip-latest">, z.ZodLiteral<"lucy-2.1-vton-2">, z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-restyle-v2v">]>;
|
|
28
|
+
declare const realtimeModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-2.1">, z.ZodLiteral<"lucy-2.5">, z.ZodLiteral<"lucy-vton-2">, z.ZodLiteral<"lucy-vton-3">, z.ZodLiteral<"lucy-vton-3.5">, z.ZodLiteral<"lucy-restyle-2">, z.ZodLiteral<"lucy-latest">, z.ZodLiteral<"lucy-vton-latest">, z.ZodLiteral<"lucy-restyle-latest">, z.ZodLiteral<"lucy-2.1-vton-2">]>;
|
|
29
|
+
declare const videoModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-clip">, z.ZodLiteral<"lucy-2.1">, z.ZodLiteral<"lucy-2.5">, z.ZodLiteral<"lucy-vton-2">, z.ZodLiteral<"lucy-vton-3">, z.ZodLiteral<"lucy-vton-3.5">, z.ZodLiteral<"lucy-restyle-2">, z.ZodLiteral<"lucy-latest">, z.ZodLiteral<"lucy-vton-latest">, z.ZodLiteral<"lucy-restyle-latest">, z.ZodLiteral<"lucy-clip-latest">, z.ZodLiteral<"lucy-2.1-vton-2">, z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-restyle-v2v">]>;
|
|
30
30
|
declare const imageModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-image-2">, z.ZodLiteral<"lucy-image-latest">, z.ZodLiteral<"lucy-pro-i2i">]>;
|
|
31
|
-
declare const modelSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"lucy-2.1">, z.ZodLiteral<"lucy-2.5">, z.ZodLiteral<"lucy-vton-2">, z.ZodLiteral<"lucy-vton-3">, z.ZodLiteral<"lucy-
|
|
31
|
+
declare const modelSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"lucy-2.1">, z.ZodLiteral<"lucy-2.5">, z.ZodLiteral<"lucy-vton-2">, z.ZodLiteral<"lucy-vton-3">, z.ZodLiteral<"lucy-vton-3.5">, z.ZodLiteral<"lucy-restyle-2">, z.ZodLiteral<"lucy-latest">, z.ZodLiteral<"lucy-vton-latest">, z.ZodLiteral<"lucy-restyle-latest">, z.ZodLiteral<"lucy-2.1-vton-2">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-clip">, z.ZodLiteral<"lucy-2.1">, z.ZodLiteral<"lucy-2.5">, z.ZodLiteral<"lucy-vton-2">, z.ZodLiteral<"lucy-vton-3">, z.ZodLiteral<"lucy-vton-3.5">, z.ZodLiteral<"lucy-restyle-2">, z.ZodLiteral<"lucy-latest">, z.ZodLiteral<"lucy-vton-latest">, z.ZodLiteral<"lucy-restyle-latest">, z.ZodLiteral<"lucy-clip-latest">, z.ZodLiteral<"lucy-2.1-vton-2">, z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-restyle-v2v">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-image-2">, z.ZodLiteral<"lucy-image-latest">, z.ZodLiteral<"lucy-pro-i2i">]>]>;
|
|
32
32
|
type Model = z.infer<typeof modelSchema>;
|
|
33
33
|
type RealTimeModels = z.infer<typeof realtimeModels>;
|
|
34
34
|
type VideoModels = z.infer<typeof videoModels>;
|
|
@@ -53,12 +53,12 @@ declare function resolveCanonicalModelAlias(model: string): CanonicalModel | und
|
|
|
53
53
|
declare const modelInputSchemas: {
|
|
54
54
|
readonly "lucy-clip": z.ZodObject<{
|
|
55
55
|
prompt: z.ZodString;
|
|
56
|
-
data: z.ZodUnion<readonly [z.
|
|
56
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
57
57
|
uri: z.ZodString;
|
|
58
58
|
type: z.ZodString;
|
|
59
59
|
name: z.ZodString;
|
|
60
60
|
}, z.core.$strip>]>;
|
|
61
|
-
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
61
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
62
62
|
uri: z.ZodString;
|
|
63
63
|
type: z.ZodString;
|
|
64
64
|
name: z.ZodString;
|
|
@@ -69,12 +69,12 @@ declare const modelInputSchemas: {
|
|
|
69
69
|
}, z.core.$strip>;
|
|
70
70
|
readonly "lucy-image-2": z.ZodObject<{
|
|
71
71
|
prompt: z.ZodString;
|
|
72
|
-
data: z.ZodUnion<readonly [z.
|
|
72
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
73
73
|
uri: z.ZodString;
|
|
74
74
|
type: z.ZodString;
|
|
75
75
|
name: z.ZodString;
|
|
76
76
|
}, z.core.$strip>]>;
|
|
77
|
-
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
77
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
78
78
|
uri: z.ZodString;
|
|
79
79
|
type: z.ZodString;
|
|
80
80
|
name: z.ZodString;
|
|
@@ -88,12 +88,12 @@ declare const modelInputSchemas: {
|
|
|
88
88
|
}, z.core.$strip>;
|
|
89
89
|
readonly "lucy-restyle-2": z.ZodObject<{
|
|
90
90
|
prompt: z.ZodOptional<z.ZodString>;
|
|
91
|
-
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
91
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
92
92
|
uri: z.ZodString;
|
|
93
93
|
type: z.ZodString;
|
|
94
94
|
name: z.ZodString;
|
|
95
95
|
}, z.core.$strip>]>>;
|
|
96
|
-
data: z.ZodUnion<readonly [z.
|
|
96
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
97
97
|
uri: z.ZodString;
|
|
98
98
|
type: z.ZodString;
|
|
99
99
|
name: z.ZodString;
|
|
@@ -104,12 +104,12 @@ declare const modelInputSchemas: {
|
|
|
104
104
|
}, z.core.$strip>;
|
|
105
105
|
readonly "lucy-2.1": z.ZodObject<{
|
|
106
106
|
prompt: z.ZodString;
|
|
107
|
-
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
107
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
108
108
|
uri: z.ZodString;
|
|
109
109
|
type: z.ZodString;
|
|
110
110
|
name: z.ZodString;
|
|
111
111
|
}, z.core.$strip>]>>;
|
|
112
|
-
data: z.ZodUnion<readonly [z.
|
|
112
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
113
113
|
uri: z.ZodString;
|
|
114
114
|
type: z.ZodString;
|
|
115
115
|
name: z.ZodString;
|
|
@@ -120,12 +120,12 @@ declare const modelInputSchemas: {
|
|
|
120
120
|
}, z.core.$strip>;
|
|
121
121
|
readonly "lucy-2.5": z.ZodObject<{
|
|
122
122
|
prompt: z.ZodString;
|
|
123
|
-
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
123
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
124
124
|
uri: z.ZodString;
|
|
125
125
|
type: z.ZodString;
|
|
126
126
|
name: z.ZodString;
|
|
127
127
|
}, z.core.$strip>]>>;
|
|
128
|
-
data: z.ZodUnion<readonly [z.
|
|
128
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
129
129
|
uri: z.ZodString;
|
|
130
130
|
type: z.ZodString;
|
|
131
131
|
name: z.ZodString;
|
|
@@ -136,12 +136,12 @@ declare const modelInputSchemas: {
|
|
|
136
136
|
}, z.core.$strip>;
|
|
137
137
|
readonly "lucy-vton-2": z.ZodObject<{
|
|
138
138
|
prompt: z.ZodString;
|
|
139
|
-
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
139
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
140
140
|
uri: z.ZodString;
|
|
141
141
|
type: z.ZodString;
|
|
142
142
|
name: z.ZodString;
|
|
143
143
|
}, z.core.$strip>]>>;
|
|
144
|
-
data: z.ZodUnion<readonly [z.
|
|
144
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
145
145
|
uri: z.ZodString;
|
|
146
146
|
type: z.ZodString;
|
|
147
147
|
name: z.ZodString;
|
|
@@ -152,12 +152,28 @@ declare const modelInputSchemas: {
|
|
|
152
152
|
}, z.core.$strip>;
|
|
153
153
|
readonly "lucy-vton-3": z.ZodObject<{
|
|
154
154
|
prompt: z.ZodString;
|
|
155
|
-
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
155
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
156
156
|
uri: z.ZodString;
|
|
157
157
|
type: z.ZodString;
|
|
158
158
|
name: z.ZodString;
|
|
159
159
|
}, z.core.$strip>]>>;
|
|
160
|
-
data: z.ZodUnion<readonly [z.
|
|
160
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
161
|
+
uri: z.ZodString;
|
|
162
|
+
type: z.ZodString;
|
|
163
|
+
name: z.ZodString;
|
|
164
|
+
}, z.core.$strip>]>;
|
|
165
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
resolution: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"720p">>>;
|
|
167
|
+
enhance_prompt: z.ZodOptional<z.ZodBoolean>;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
readonly "lucy-vton-3.5": z.ZodObject<{
|
|
170
|
+
prompt: z.ZodString;
|
|
171
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
172
|
+
uri: z.ZodString;
|
|
173
|
+
type: z.ZodString;
|
|
174
|
+
name: z.ZodString;
|
|
175
|
+
}, z.core.$strip>]>>;
|
|
176
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
161
177
|
uri: z.ZodString;
|
|
162
178
|
type: z.ZodString;
|
|
163
179
|
name: z.ZodString;
|
|
@@ -168,12 +184,12 @@ declare const modelInputSchemas: {
|
|
|
168
184
|
}, z.core.$strip>;
|
|
169
185
|
readonly "lucy-latest": z.ZodObject<{
|
|
170
186
|
prompt: z.ZodString;
|
|
171
|
-
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
187
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
172
188
|
uri: z.ZodString;
|
|
173
189
|
type: z.ZodString;
|
|
174
190
|
name: z.ZodString;
|
|
175
191
|
}, z.core.$strip>]>>;
|
|
176
|
-
data: z.ZodUnion<readonly [z.
|
|
192
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
177
193
|
uri: z.ZodString;
|
|
178
194
|
type: z.ZodString;
|
|
179
195
|
name: z.ZodString;
|
|
@@ -184,12 +200,12 @@ declare const modelInputSchemas: {
|
|
|
184
200
|
}, z.core.$strip>;
|
|
185
201
|
readonly "lucy-vton-latest": z.ZodObject<{
|
|
186
202
|
prompt: z.ZodString;
|
|
187
|
-
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
203
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
188
204
|
uri: z.ZodString;
|
|
189
205
|
type: z.ZodString;
|
|
190
206
|
name: z.ZodString;
|
|
191
207
|
}, z.core.$strip>]>>;
|
|
192
|
-
data: z.ZodUnion<readonly [z.
|
|
208
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
193
209
|
uri: z.ZodString;
|
|
194
210
|
type: z.ZodString;
|
|
195
211
|
name: z.ZodString;
|
|
@@ -200,12 +216,12 @@ declare const modelInputSchemas: {
|
|
|
200
216
|
}, z.core.$strip>;
|
|
201
217
|
readonly "lucy-restyle-latest": z.ZodObject<{
|
|
202
218
|
prompt: z.ZodOptional<z.ZodString>;
|
|
203
|
-
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
219
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
204
220
|
uri: z.ZodString;
|
|
205
221
|
type: z.ZodString;
|
|
206
222
|
name: z.ZodString;
|
|
207
223
|
}, z.core.$strip>]>>;
|
|
208
|
-
data: z.ZodUnion<readonly [z.
|
|
224
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
209
225
|
uri: z.ZodString;
|
|
210
226
|
type: z.ZodString;
|
|
211
227
|
name: z.ZodString;
|
|
@@ -216,12 +232,12 @@ declare const modelInputSchemas: {
|
|
|
216
232
|
}, z.core.$strip>;
|
|
217
233
|
readonly "lucy-clip-latest": z.ZodObject<{
|
|
218
234
|
prompt: z.ZodString;
|
|
219
|
-
data: z.ZodUnion<readonly [z.
|
|
235
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
220
236
|
uri: z.ZodString;
|
|
221
237
|
type: z.ZodString;
|
|
222
238
|
name: z.ZodString;
|
|
223
239
|
}, z.core.$strip>]>;
|
|
224
|
-
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
240
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
225
241
|
uri: z.ZodString;
|
|
226
242
|
type: z.ZodString;
|
|
227
243
|
name: z.ZodString;
|
|
@@ -232,12 +248,12 @@ declare const modelInputSchemas: {
|
|
|
232
248
|
}, z.core.$strip>;
|
|
233
249
|
readonly "lucy-image-latest": z.ZodObject<{
|
|
234
250
|
prompt: z.ZodString;
|
|
235
|
-
data: z.ZodUnion<readonly [z.
|
|
251
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
236
252
|
uri: z.ZodString;
|
|
237
253
|
type: z.ZodString;
|
|
238
254
|
name: z.ZodString;
|
|
239
255
|
}, z.core.$strip>]>;
|
|
240
|
-
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
256
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
241
257
|
uri: z.ZodString;
|
|
242
258
|
type: z.ZodString;
|
|
243
259
|
name: z.ZodString;
|
|
@@ -251,12 +267,12 @@ declare const modelInputSchemas: {
|
|
|
251
267
|
}, z.core.$strip>;
|
|
252
268
|
readonly "lucy-2.1-vton-2": z.ZodObject<{
|
|
253
269
|
prompt: z.ZodString;
|
|
254
|
-
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
270
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
255
271
|
uri: z.ZodString;
|
|
256
272
|
type: z.ZodString;
|
|
257
273
|
name: z.ZodString;
|
|
258
274
|
}, z.core.$strip>]>>;
|
|
259
|
-
data: z.ZodUnion<readonly [z.
|
|
275
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
260
276
|
uri: z.ZodString;
|
|
261
277
|
type: z.ZodString;
|
|
262
278
|
name: z.ZodString;
|
|
@@ -267,12 +283,12 @@ declare const modelInputSchemas: {
|
|
|
267
283
|
}, z.core.$strip>;
|
|
268
284
|
readonly "lucy-pro-v2v": z.ZodObject<{
|
|
269
285
|
prompt: z.ZodString;
|
|
270
|
-
data: z.ZodUnion<readonly [z.
|
|
286
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
271
287
|
uri: z.ZodString;
|
|
272
288
|
type: z.ZodString;
|
|
273
289
|
name: z.ZodString;
|
|
274
290
|
}, z.core.$strip>]>;
|
|
275
|
-
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
291
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
276
292
|
uri: z.ZodString;
|
|
277
293
|
type: z.ZodString;
|
|
278
294
|
name: z.ZodString;
|
|
@@ -283,12 +299,12 @@ declare const modelInputSchemas: {
|
|
|
283
299
|
}, z.core.$strip>;
|
|
284
300
|
readonly "lucy-pro-i2i": z.ZodObject<{
|
|
285
301
|
prompt: z.ZodString;
|
|
286
|
-
data: z.ZodUnion<readonly [z.
|
|
302
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
287
303
|
uri: z.ZodString;
|
|
288
304
|
type: z.ZodString;
|
|
289
305
|
name: z.ZodString;
|
|
290
306
|
}, z.core.$strip>]>;
|
|
291
|
-
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
307
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
292
308
|
uri: z.ZodString;
|
|
293
309
|
type: z.ZodString;
|
|
294
310
|
name: z.ZodString;
|
|
@@ -302,12 +318,12 @@ declare const modelInputSchemas: {
|
|
|
302
318
|
}, z.core.$strip>;
|
|
303
319
|
readonly "lucy-restyle-v2v": z.ZodObject<{
|
|
304
320
|
prompt: z.ZodOptional<z.ZodString>;
|
|
305
|
-
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
321
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
306
322
|
uri: z.ZodString;
|
|
307
323
|
type: z.ZodString;
|
|
308
324
|
name: z.ZodString;
|
|
309
325
|
}, z.core.$strip>]>>;
|
|
310
|
-
data: z.ZodUnion<readonly [z.
|
|
326
|
+
data: z.ZodUnion<readonly [z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<ReadableStream<any>, unknown, z.core.$ZodTypeInternals<ReadableStream<any>, unknown>>, z.ZodType<URL, unknown, z.core.$ZodTypeInternals<URL, unknown>>, z.ZodURL, z.ZodObject<{
|
|
311
327
|
uri: z.ZodString;
|
|
312
328
|
type: z.ZodString;
|
|
313
329
|
name: z.ZodString;
|
|
@@ -333,6 +349,7 @@ type ModelDefinition<T extends Model = Model> = {
|
|
|
333
349
|
height: number;
|
|
334
350
|
inputSchema: T extends keyof ModelInputSchemas ? ModelInputSchemas[T] : z.ZodTypeAny;
|
|
335
351
|
};
|
|
352
|
+
declare function resolveFpsNumber(fps: ModelFps, fallback?: number): number;
|
|
336
353
|
/**
|
|
337
354
|
* A model definition with an arbitrary (non-registry) model name.
|
|
338
355
|
* Use this when providing your own model configuration.
|
|
@@ -381,6 +398,7 @@ declare const models: {
|
|
|
381
398
|
* - `"lucy-2.5"` - Lucy 2.5 realtime video editing
|
|
382
399
|
* - `"lucy-vton-2"` - Lucy virtual try-on 2
|
|
383
400
|
* - `"lucy-vton-3"` - Lucy virtual try-on 3
|
|
401
|
+
* - `"lucy-vton-3.5"` - Lucy virtual try-on 3.5 (latest)
|
|
384
402
|
* - `"lucy-restyle-2"` - Realtime video restyling
|
|
385
403
|
*/
|
|
386
404
|
realtime: <T extends RealTimeModels>(model: T) => ModelDefinition<T>;
|
|
@@ -393,6 +411,7 @@ declare const models: {
|
|
|
393
411
|
* - `"lucy-2.5"` - Long-form video editing (Lucy 2.5)
|
|
394
412
|
* - `"lucy-vton-2"` - Virtual try-on 2 video editing
|
|
395
413
|
* - `"lucy-vton-3"` - Virtual try-on 3 video editing
|
|
414
|
+
* - `"lucy-vton-3.5"` - Virtual try-on 3.5 video editing (latest)
|
|
396
415
|
* - `"lucy-restyle-2"` - Video restyling
|
|
397
416
|
*/
|
|
398
417
|
video: <T extends VideoModels>(model: T) => ModelDefinition<T> & {
|
|
@@ -411,4 +430,4 @@ declare const models: {
|
|
|
411
430
|
};
|
|
412
431
|
};
|
|
413
432
|
//#endregion
|
|
414
|
-
export { CanonicalModel, CustomModelDefinition, ImageModelDefinition, ImageModels, ListedModelDefinition, Model, ModelDefinition, ModelInputSchemas, ModelKind, RealTimeModels, VideoModelDefinition, VideoModels, isCanonicalModel, isImageModel, isModel, isRealtimeModel, isVideoModel, listModels, modelAliases, models, resolveCanonicalModelAlias, resolveModelAlias };
|
|
433
|
+
export { CanonicalModel, CustomModelDefinition, ImageModelDefinition, ImageModels, ListedModelDefinition, Model, ModelDefinition, ModelFps, ModelInputSchemas, ModelKind, RealTimeModels, VideoModelDefinition, VideoModels, canonicalModelSchema, imageModels, isCanonicalModel, isImageModel, isModel, isRealtimeModel, isVideoModel, listModels, modelAliases, modelInputSchemas, modelSchema, models, realtimeModels, resolveCanonicalModelAlias, resolveFpsNumber, resolveModelAlias, videoModels };
|
package/dist/shared/model.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createModelNotFoundError } from "../utils/errors.js";
|
|
2
|
+
import { globalInstanceSchema } from "../utils/runtime.js";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
//#region src/shared/model.ts
|
|
4
5
|
const CANONICAL_MODEL_NAMES = [
|
|
@@ -6,6 +7,7 @@ const CANONICAL_MODEL_NAMES = [
|
|
|
6
7
|
"lucy-2.5",
|
|
7
8
|
"lucy-vton-2",
|
|
8
9
|
"lucy-vton-3",
|
|
10
|
+
"lucy-vton-3.5",
|
|
9
11
|
"lucy-restyle-2",
|
|
10
12
|
"lucy-clip",
|
|
11
13
|
"lucy-image-2"
|
|
@@ -15,6 +17,7 @@ const CANONICAL_REALTIME_MODEL_NAMES = [
|
|
|
15
17
|
"lucy-2.5",
|
|
16
18
|
"lucy-vton-2",
|
|
17
19
|
"lucy-vton-3",
|
|
20
|
+
"lucy-vton-3.5",
|
|
18
21
|
"lucy-restyle-2"
|
|
19
22
|
];
|
|
20
23
|
const CANONICAL_VIDEO_MODEL_NAMES = [
|
|
@@ -23,6 +26,7 @@ const CANONICAL_VIDEO_MODEL_NAMES = [
|
|
|
23
26
|
"lucy-2.5",
|
|
24
27
|
"lucy-vton-2",
|
|
25
28
|
"lucy-vton-3",
|
|
29
|
+
"lucy-vton-3.5",
|
|
26
30
|
"lucy-restyle-2"
|
|
27
31
|
];
|
|
28
32
|
const CANONICAL_IMAGE_MODEL_NAMES = ["lucy-image-2"];
|
|
@@ -35,7 +39,6 @@ const canonicalModelSchema = z.enum(CANONICAL_MODEL_NAMES);
|
|
|
35
39
|
* Old names still work but will log a deprecation warning.
|
|
36
40
|
*/
|
|
37
41
|
const modelAliases = {
|
|
38
|
-
mirage_v2: "lucy-restyle-2",
|
|
39
42
|
"lucy-2.1-vton-2": "lucy-vton-2",
|
|
40
43
|
"lucy-pro-v2v": "lucy-clip",
|
|
41
44
|
"lucy-restyle-v2v": "lucy-restyle-2",
|
|
@@ -54,11 +57,11 @@ const realtimeModels = z.union([
|
|
|
54
57
|
z.literal("lucy-2.5"),
|
|
55
58
|
z.literal("lucy-vton-2"),
|
|
56
59
|
z.literal("lucy-vton-3"),
|
|
60
|
+
z.literal("lucy-vton-3.5"),
|
|
57
61
|
z.literal("lucy-restyle-2"),
|
|
58
62
|
z.literal("lucy-latest"),
|
|
59
63
|
z.literal("lucy-vton-latest"),
|
|
60
64
|
z.literal("lucy-restyle-latest"),
|
|
61
|
-
z.literal("mirage_v2"),
|
|
62
65
|
z.literal("lucy-2.1-vton-2")
|
|
63
66
|
]);
|
|
64
67
|
const videoModels = z.union([
|
|
@@ -67,6 +70,7 @@ const videoModels = z.union([
|
|
|
67
70
|
z.literal("lucy-2.5"),
|
|
68
71
|
z.literal("lucy-vton-2"),
|
|
69
72
|
z.literal("lucy-vton-3"),
|
|
73
|
+
z.literal("lucy-vton-3.5"),
|
|
70
74
|
z.literal("lucy-restyle-2"),
|
|
71
75
|
z.literal("lucy-latest"),
|
|
72
76
|
z.literal("lucy-vton-latest"),
|
|
@@ -124,10 +128,10 @@ function resolveCanonicalModelAlias(model) {
|
|
|
124
128
|
return parsedModel.success ? parsedModel.data : void 0;
|
|
125
129
|
}
|
|
126
130
|
const fileInputSchema = z.union([
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
globalInstanceSchema("File"),
|
|
132
|
+
globalInstanceSchema("Blob"),
|
|
133
|
+
globalInstanceSchema("ReadableStream"),
|
|
134
|
+
globalInstanceSchema("URL"),
|
|
131
135
|
z.url(),
|
|
132
136
|
z.object({
|
|
133
137
|
uri: z.string(),
|
|
@@ -186,6 +190,7 @@ const modelInputSchemas = {
|
|
|
186
190
|
"lucy-2.5": videoEdit2Schema,
|
|
187
191
|
"lucy-vton-2": videoEdit2Schema,
|
|
188
192
|
"lucy-vton-3": videoEdit2Schema,
|
|
193
|
+
"lucy-vton-3.5": videoEdit2Schema,
|
|
189
194
|
"lucy-latest": videoEdit2Schema,
|
|
190
195
|
"lucy-vton-latest": videoEdit2Schema,
|
|
191
196
|
"lucy-restyle-latest": restyleSchema,
|
|
@@ -260,6 +265,17 @@ const _models = {
|
|
|
260
265
|
height: 624,
|
|
261
266
|
inputSchema: z.object({})
|
|
262
267
|
},
|
|
268
|
+
"lucy-vton-3.5": {
|
|
269
|
+
urlPath: "/v1/stream",
|
|
270
|
+
name: "lucy-vton-3.5",
|
|
271
|
+
fps: {
|
|
272
|
+
ideal: 30,
|
|
273
|
+
max: 30
|
|
274
|
+
},
|
|
275
|
+
width: 1088,
|
|
276
|
+
height: 624,
|
|
277
|
+
inputSchema: z.object({})
|
|
278
|
+
},
|
|
263
279
|
"lucy-restyle-2": {
|
|
264
280
|
urlPath: "/v1/stream",
|
|
265
281
|
name: "lucy-restyle-2",
|
|
@@ -304,17 +320,6 @@ const _models = {
|
|
|
304
320
|
height: 704,
|
|
305
321
|
inputSchema: z.object({})
|
|
306
322
|
},
|
|
307
|
-
mirage_v2: {
|
|
308
|
-
urlPath: "/v1/stream",
|
|
309
|
-
name: "mirage_v2",
|
|
310
|
-
fps: {
|
|
311
|
-
ideal: 30,
|
|
312
|
-
max: 30
|
|
313
|
-
},
|
|
314
|
-
width: 1280,
|
|
315
|
-
height: 704,
|
|
316
|
-
inputSchema: z.object({})
|
|
317
|
-
},
|
|
318
323
|
"lucy-2.1-vton-2": {
|
|
319
324
|
urlPath: "/v1/stream",
|
|
320
325
|
name: "lucy-2.1-vton-2",
|
|
@@ -402,6 +407,15 @@ const _models = {
|
|
|
402
407
|
height: 624,
|
|
403
408
|
inputSchema: modelInputSchemas["lucy-vton-3"]
|
|
404
409
|
},
|
|
410
|
+
"lucy-vton-3.5": {
|
|
411
|
+
urlPath: "/v1/generate/lucy-vton-3.5",
|
|
412
|
+
queueUrlPath: "/v1/jobs/lucy-vton-3.5",
|
|
413
|
+
name: "lucy-vton-3.5",
|
|
414
|
+
fps: 20,
|
|
415
|
+
width: 1088,
|
|
416
|
+
height: 624,
|
|
417
|
+
inputSchema: modelInputSchemas["lucy-vton-3.5"]
|
|
418
|
+
},
|
|
405
419
|
"lucy-restyle-2": {
|
|
406
420
|
urlPath: "/v1/generate/lucy-restyle-2",
|
|
407
421
|
queueUrlPath: "/v1/jobs/lucy-restyle-2",
|
|
@@ -500,18 +514,47 @@ function listModels(options = {}) {
|
|
|
500
514
|
});
|
|
501
515
|
}
|
|
502
516
|
const models = {
|
|
517
|
+
/**
|
|
518
|
+
* Get a realtime streaming model identifier.
|
|
519
|
+
*
|
|
520
|
+
* Available options:
|
|
521
|
+
* - `"lucy-2.1"` - Lucy 2.1 realtime video editing
|
|
522
|
+
* - `"lucy-2.5"` - Lucy 2.5 realtime video editing
|
|
523
|
+
* - `"lucy-vton-2"` - Lucy virtual try-on 2
|
|
524
|
+
* - `"lucy-vton-3"` - Lucy virtual try-on 3
|
|
525
|
+
* - `"lucy-vton-3.5"` - Lucy virtual try-on 3.5 (latest)
|
|
526
|
+
* - `"lucy-restyle-2"` - Realtime video restyling
|
|
527
|
+
*/
|
|
503
528
|
realtime: (model) => {
|
|
504
529
|
warnDeprecated(model);
|
|
505
530
|
const modelDefinition = _models.realtime[model];
|
|
506
531
|
if (!modelDefinition) throw createModelNotFoundError(model);
|
|
507
532
|
return modelDefinition;
|
|
508
533
|
},
|
|
534
|
+
/**
|
|
535
|
+
* Get a video model identifier.
|
|
536
|
+
*
|
|
537
|
+
* Available options:
|
|
538
|
+
* - `"lucy-clip"` - Video-to-video editing
|
|
539
|
+
* - `"lucy-2.1"` - Long-form video editing (Lucy 2.1)
|
|
540
|
+
* - `"lucy-2.5"` - Long-form video editing (Lucy 2.5)
|
|
541
|
+
* - `"lucy-vton-2"` - Virtual try-on 2 video editing
|
|
542
|
+
* - `"lucy-vton-3"` - Virtual try-on 3 video editing
|
|
543
|
+
* - `"lucy-vton-3.5"` - Virtual try-on 3.5 video editing (latest)
|
|
544
|
+
* - `"lucy-restyle-2"` - Video restyling
|
|
545
|
+
*/
|
|
509
546
|
video: (model) => {
|
|
510
547
|
warnDeprecated(model);
|
|
511
548
|
const modelDefinition = _models.video[model];
|
|
512
549
|
if (!modelDefinition) throw createModelNotFoundError(model);
|
|
513
550
|
return modelDefinition;
|
|
514
551
|
},
|
|
552
|
+
/**
|
|
553
|
+
* Get an image model identifier.
|
|
554
|
+
*
|
|
555
|
+
* Available options:
|
|
556
|
+
* - `"lucy-image-2"` - Image-to-image editing
|
|
557
|
+
*/
|
|
515
558
|
image: (model) => {
|
|
516
559
|
warnDeprecated(model);
|
|
517
560
|
const modelDefinition = _models.image[model];
|
|
@@ -520,4 +563,4 @@ const models = {
|
|
|
520
563
|
}
|
|
521
564
|
};
|
|
522
565
|
//#endregion
|
|
523
|
-
export { isCanonicalModel, isImageModel, isModel, isRealtimeModel, isVideoModel, listModels, modelAliases, modelDefinitionSchema, models, resolveCanonicalModelAlias, resolveFpsNumber, resolveModelAlias };
|
|
566
|
+
export { canonicalImageModels, canonicalModelSchema, canonicalRealtimeModels, canonicalVideoModels, imageModels, isCanonicalModel, isImageModel, isModel, isRealtimeModel, isVideoModel, listModels, modelAliases, modelDefinitionSchema, modelInputSchemas, modelSchema, models, realtimeModels, resolveCanonicalModelAlias, resolveFpsNumber, resolveModelAlias, videoModels };
|
package/dist/shared/request.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createInvalidInputError } from "../utils/errors.js";
|
|
2
|
+
import { isGlobalInstance } from "../utils/runtime.js";
|
|
2
3
|
import { buildUserAgent } from "../utils/user-agent.js";
|
|
3
4
|
//#region src/shared/request.ts
|
|
4
5
|
/**
|
|
@@ -13,9 +14,9 @@ function isReactNativeFile(value) {
|
|
|
13
14
|
*/
|
|
14
15
|
async function fileInputToBlob(input) {
|
|
15
16
|
if (isReactNativeFile(input)) return input;
|
|
16
|
-
if (input
|
|
17
|
-
if (input
|
|
18
|
-
if (typeof input === "string" || input
|
|
17
|
+
if (isGlobalInstance(input, "Blob") || isGlobalInstance(input, "File")) return input;
|
|
18
|
+
if (isGlobalInstance(input, "ReadableStream")) return new Response(input).blob();
|
|
19
|
+
if (typeof input === "string" || isGlobalInstance(input, "URL")) {
|
|
19
20
|
const url = typeof input === "string" ? input : input.toString();
|
|
20
21
|
if (!url.startsWith("http://") && !url.startsWith("https://")) throw createInvalidInputError("URL must start with http:// or https://");
|
|
21
22
|
const response = await fetch(url);
|
|
@@ -40,7 +41,7 @@ function buildAuthHeaders(options = {}) {
|
|
|
40
41
|
function buildFormData(inputs) {
|
|
41
42
|
const formData = new FormData();
|
|
42
43
|
for (const [key, value] of Object.entries(inputs)) if (value !== void 0 && value !== null) if (isReactNativeFile(value)) formData.append(key, value);
|
|
43
|
-
else if (value
|
|
44
|
+
else if (isGlobalInstance(value, "Blob")) formData.append(key, value);
|
|
44
45
|
else if (typeof value === "object" && value !== null) formData.append(key, JSON.stringify(value));
|
|
45
46
|
else formData.append(key, String(value));
|
|
46
47
|
return formData;
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ declare const modelStateSchema: z.ZodObject<{
|
|
|
6
6
|
text: z.ZodString;
|
|
7
7
|
enhance: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
8
8
|
}, z.core.$strip>>;
|
|
9
|
-
image: z.ZodOptional<z.ZodUnion<readonly [z.
|
|
9
|
+
image: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<Blob, unknown, z.core.$ZodTypeInternals<Blob, unknown>>, z.ZodType<File, unknown, z.core.$ZodTypeInternals<File, unknown>>, z.ZodString]>>;
|
|
10
10
|
passthrough: z.ZodOptional<z.ZodBoolean>;
|
|
11
11
|
}, z.core.$strip>;
|
|
12
12
|
type ModelState = z.infer<typeof modelStateSchema>;
|
|
13
13
|
//#endregion
|
|
14
|
-
export { ModelState };
|
|
14
|
+
export { ModelState, modelStateSchema };
|
package/dist/shared/types.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { globalInstanceSchema } from "../utils/runtime.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
//#region src/shared/types.ts
|
|
3
4
|
const modelStateSchema = z.object({
|
|
@@ -5,9 +6,15 @@ const modelStateSchema = z.object({
|
|
|
5
6
|
text: z.string().min(1),
|
|
6
7
|
enhance: z.boolean().optional().default(true)
|
|
7
8
|
}).optional(),
|
|
9
|
+
/**
|
|
10
|
+
* Initial image for the session. Pass either bytes (`Blob`/`File`/data URL/
|
|
11
|
+
* http(s) URL/base64 string) or a `"file_..."` id returned by
|
|
12
|
+
* `client.files.upload(...)`.id — the SDK detects the prefix and sends a
|
|
13
|
+
* server-side reference instead of base64.
|
|
14
|
+
*/
|
|
8
15
|
image: z.union([
|
|
9
|
-
|
|
10
|
-
|
|
16
|
+
globalInstanceSchema("Blob"),
|
|
17
|
+
globalInstanceSchema("File"),
|
|
11
18
|
z.string()
|
|
12
19
|
]).optional(),
|
|
13
20
|
passthrough: z.boolean().optional()
|
package/dist/utils/errors.d.ts
CHANGED
|
@@ -20,6 +20,9 @@ declare const ERROR_CODES: {
|
|
|
20
20
|
readonly FILES_UPLOAD_ERROR: "FILES_UPLOAD_ERROR";
|
|
21
21
|
readonly FILES_GET_ERROR: "FILES_GET_ERROR";
|
|
22
22
|
readonly FILES_DELETE_ERROR: "FILES_DELETE_ERROR";
|
|
23
|
+
readonly REACT_NATIVE_SETUP_REQUIRED: "REACT_NATIVE_SETUP_REQUIRED";
|
|
24
|
+
readonly UNSUPPORTED_PLATFORM_FEATURE: "UNSUPPORTED_PLATFORM_FEATURE";
|
|
25
|
+
readonly LIVEKIT_INITIALIZATION_ERROR: "LIVEKIT_INITIALIZATION_ERROR";
|
|
23
26
|
readonly WEBRTC_WEBSOCKET_ERROR: "WEBRTC_WEBSOCKET_ERROR";
|
|
24
27
|
readonly WEBRTC_ICE_ERROR: "WEBRTC_ICE_ERROR";
|
|
25
28
|
readonly WEBRTC_TIMEOUT_ERROR: "WEBRTC_TIMEOUT_ERROR";
|