@decartai/sdk 0.0.64 → 0.0.65
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/dist/process/types.d.ts +1 -1
- package/dist/shared/model.d.ts +53 -3
- package/dist/shared/model.js +63 -1
- package/package.json +1 -1
package/dist/process/types.d.ts
CHANGED
|
@@ -143,7 +143,7 @@ interface PromptInput {
|
|
|
143
143
|
* This allows different models to have field-specific documentation while maintaining type safety.
|
|
144
144
|
* Specific models are checked first, then falls back to category-based selection.
|
|
145
145
|
*/
|
|
146
|
-
type ModelSpecificInputs<T extends ModelDefinition> = T["name"] extends "lucy-pro-i2i" | "lucy-image-2" ? ImageEditingInputs : T["name"] extends "lucy-restyle-v2v" | "lucy-restyle-2" ? VideoRestyleInputs : T["name"] extends "lucy-2.1" | "lucy-2.1-vton" ? VideoEdit2Inputs : T["name"] extends "lucy-pro-v2v" | "lucy-clip" ? VideoEditInputs : T["name"] extends ImageModels ? ImageGenerationInputs : T["name"] extends VideoModels ? VideoModelInputs : PromptInput;
|
|
146
|
+
type ModelSpecificInputs<T extends ModelDefinition> = T["name"] extends "lucy-pro-i2i" | "lucy-image-2" ? ImageEditingInputs : T["name"] extends "lucy-restyle-v2v" | "lucy-restyle-2" ? VideoRestyleInputs : T["name"] extends "lucy-2.1" | "lucy-2.1-vton" | "lucy-vton-2" | "lucy-vton" | "lucy-2.1-vton-2" | "lucy-vton-latest" ? VideoEdit2Inputs : T["name"] extends "lucy-pro-v2v" | "lucy-clip" ? VideoEditInputs : T["name"] extends ImageModels ? ImageGenerationInputs : T["name"] extends VideoModels ? VideoModelInputs : PromptInput;
|
|
147
147
|
interface ProcessInputs {
|
|
148
148
|
/**
|
|
149
149
|
* Random seed for reproducible results.
|
package/dist/shared/model.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/shared/model.d.ts
|
|
4
|
-
declare const realtimeModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-2.1">, z.ZodLiteral<"lucy-2.1-vton">, z.ZodLiteral<"lucy-restyle-2">, z.ZodLiteral<"lucy-latest">, z.ZodLiteral<"lucy-vton-latest">, z.ZodLiteral<"lucy-restyle-latest">, z.ZodLiteral<"mirage_v2">]>;
|
|
5
|
-
declare const videoModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-clip">, z.ZodLiteral<"lucy-2.1">, z.ZodLiteral<"lucy-2.1-vton">, 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-pro-v2v">, z.ZodLiteral<"lucy-restyle-v2v">]>;
|
|
4
|
+
declare const realtimeModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-2.1">, z.ZodLiteral<"lucy-2.1-vton">, z.ZodLiteral<"lucy-vton-2">, z.ZodLiteral<"lucy-restyle-2">, z.ZodLiteral<"lucy-latest">, z.ZodLiteral<"lucy-vton-latest">, z.ZodLiteral<"lucy-restyle-latest">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy-vton">, z.ZodLiteral<"lucy-2.1-vton-2">]>;
|
|
5
|
+
declare const videoModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-clip">, z.ZodLiteral<"lucy-2.1">, z.ZodLiteral<"lucy-2.1-vton">, z.ZodLiteral<"lucy-vton-2">, 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-vton">, z.ZodLiteral<"lucy-2.1-vton-2">, z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-restyle-v2v">]>;
|
|
6
6
|
declare const imageModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-image-2">, z.ZodLiteral<"lucy-image-latest">, z.ZodLiteral<"lucy-pro-i2i">]>;
|
|
7
|
-
declare const modelSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"lucy-2.1">, z.ZodLiteral<"lucy-2.1-vton">, z.ZodLiteral<"lucy-restyle-2">, z.ZodLiteral<"lucy-latest">, z.ZodLiteral<"lucy-vton-latest">, z.ZodLiteral<"lucy-restyle-latest">, z.ZodLiteral<"mirage_v2">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-clip">, z.ZodLiteral<"lucy-2.1">, z.ZodLiteral<"lucy-2.1-vton">, 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-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">]>]>;
|
|
7
|
+
declare const modelSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"lucy-2.1">, z.ZodLiteral<"lucy-2.1-vton">, z.ZodLiteral<"lucy-vton-2">, z.ZodLiteral<"lucy-restyle-2">, z.ZodLiteral<"lucy-latest">, z.ZodLiteral<"lucy-vton-latest">, z.ZodLiteral<"lucy-restyle-latest">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy-vton">, z.ZodLiteral<"lucy-2.1-vton-2">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-clip">, z.ZodLiteral<"lucy-2.1">, z.ZodLiteral<"lucy-2.1-vton">, z.ZodLiteral<"lucy-vton-2">, 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-vton">, 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">]>]>;
|
|
8
8
|
type Model = z.infer<typeof modelSchema>;
|
|
9
9
|
type RealTimeModels = z.infer<typeof realtimeModels>;
|
|
10
10
|
type VideoModels = z.infer<typeof videoModels>;
|
|
@@ -96,6 +96,22 @@ declare const modelInputSchemas: {
|
|
|
96
96
|
resolution: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"720p">>>;
|
|
97
97
|
enhance_prompt: z.ZodOptional<z.ZodBoolean>;
|
|
98
98
|
}, z.core.$strip>;
|
|
99
|
+
readonly "lucy-vton-2": z.ZodObject<{
|
|
100
|
+
prompt: z.ZodString;
|
|
101
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
102
|
+
uri: z.ZodString;
|
|
103
|
+
type: z.ZodString;
|
|
104
|
+
name: z.ZodString;
|
|
105
|
+
}, z.core.$strip>]>>;
|
|
106
|
+
data: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
107
|
+
uri: z.ZodString;
|
|
108
|
+
type: z.ZodString;
|
|
109
|
+
name: z.ZodString;
|
|
110
|
+
}, z.core.$strip>]>;
|
|
111
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
resolution: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"720p">>>;
|
|
113
|
+
enhance_prompt: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
+
}, z.core.$strip>;
|
|
99
115
|
readonly "lucy-latest": z.ZodObject<{
|
|
100
116
|
prompt: z.ZodString;
|
|
101
117
|
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
@@ -179,6 +195,38 @@ declare const modelInputSchemas: {
|
|
|
179
195
|
}>>>;
|
|
180
196
|
enhance_prompt: z.ZodOptional<z.ZodBoolean>;
|
|
181
197
|
}, z.core.$strip>;
|
|
198
|
+
readonly "lucy-vton": z.ZodObject<{
|
|
199
|
+
prompt: z.ZodString;
|
|
200
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
201
|
+
uri: z.ZodString;
|
|
202
|
+
type: z.ZodString;
|
|
203
|
+
name: z.ZodString;
|
|
204
|
+
}, z.core.$strip>]>>;
|
|
205
|
+
data: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
206
|
+
uri: z.ZodString;
|
|
207
|
+
type: z.ZodString;
|
|
208
|
+
name: z.ZodString;
|
|
209
|
+
}, z.core.$strip>]>;
|
|
210
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
211
|
+
resolution: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"720p">>>;
|
|
212
|
+
enhance_prompt: z.ZodOptional<z.ZodBoolean>;
|
|
213
|
+
}, z.core.$strip>;
|
|
214
|
+
readonly "lucy-2.1-vton-2": z.ZodObject<{
|
|
215
|
+
prompt: z.ZodString;
|
|
216
|
+
reference_image: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
217
|
+
uri: z.ZodString;
|
|
218
|
+
type: z.ZodString;
|
|
219
|
+
name: z.ZodString;
|
|
220
|
+
}, z.core.$strip>]>>;
|
|
221
|
+
data: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
222
|
+
uri: z.ZodString;
|
|
223
|
+
type: z.ZodString;
|
|
224
|
+
name: z.ZodString;
|
|
225
|
+
}, z.core.$strip>]>;
|
|
226
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
227
|
+
resolution: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"720p">>>;
|
|
228
|
+
enhance_prompt: z.ZodOptional<z.ZodBoolean>;
|
|
229
|
+
}, z.core.$strip>;
|
|
182
230
|
readonly "lucy-pro-v2v": z.ZodObject<{
|
|
183
231
|
prompt: z.ZodString;
|
|
184
232
|
data: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL, z.ZodObject<{
|
|
@@ -272,6 +320,7 @@ declare const models: {
|
|
|
272
320
|
* Available options:
|
|
273
321
|
* - `"lucy-2.1"` - Lucy 2.1 realtime video editing
|
|
274
322
|
* - `"lucy-2.1-vton"` - Lucy 2.1 virtual try-on
|
|
323
|
+
* - `"lucy-vton-2"` - Lucy virtual try-on 2
|
|
275
324
|
* - `"lucy-restyle-2"` - Realtime video restyling
|
|
276
325
|
*/
|
|
277
326
|
realtime: <T extends RealTimeModels>(model: T) => ModelDefinition<T>;
|
|
@@ -282,6 +331,7 @@ declare const models: {
|
|
|
282
331
|
* - `"lucy-clip"` - Video-to-video editing
|
|
283
332
|
* - `"lucy-2.1"` - Long-form video editing (Lucy 2.1)
|
|
284
333
|
* - `"lucy-2.1-vton"` - Virtual try-on video editing
|
|
334
|
+
* - `"lucy-vton-2"` - Virtual try-on 2 video editing
|
|
285
335
|
* - `"lucy-restyle-2"` - Video restyling
|
|
286
336
|
*/
|
|
287
337
|
video: <T extends VideoModels>(model: T) => ModelDefinition<T> & {
|
package/dist/shared/model.js
CHANGED
|
@@ -8,6 +8,8 @@ import { z } from "zod";
|
|
|
8
8
|
*/
|
|
9
9
|
const MODEL_ALIASES = {
|
|
10
10
|
mirage_v2: "lucy-restyle-2",
|
|
11
|
+
"lucy-vton": "lucy-2.1-vton",
|
|
12
|
+
"lucy-2.1-vton-2": "lucy-vton-2",
|
|
11
13
|
"lucy-pro-v2v": "lucy-clip",
|
|
12
14
|
"lucy-restyle-v2v": "lucy-restyle-2",
|
|
13
15
|
"lucy-pro-i2i": "lucy-image-2"
|
|
@@ -23,21 +25,27 @@ function warnDeprecated(model) {
|
|
|
23
25
|
const realtimeModels = z.union([
|
|
24
26
|
z.literal("lucy-2.1"),
|
|
25
27
|
z.literal("lucy-2.1-vton"),
|
|
28
|
+
z.literal("lucy-vton-2"),
|
|
26
29
|
z.literal("lucy-restyle-2"),
|
|
27
30
|
z.literal("lucy-latest"),
|
|
28
31
|
z.literal("lucy-vton-latest"),
|
|
29
32
|
z.literal("lucy-restyle-latest"),
|
|
30
|
-
z.literal("mirage_v2")
|
|
33
|
+
z.literal("mirage_v2"),
|
|
34
|
+
z.literal("lucy-vton"),
|
|
35
|
+
z.literal("lucy-2.1-vton-2")
|
|
31
36
|
]);
|
|
32
37
|
const videoModels = z.union([
|
|
33
38
|
z.literal("lucy-clip"),
|
|
34
39
|
z.literal("lucy-2.1"),
|
|
35
40
|
z.literal("lucy-2.1-vton"),
|
|
41
|
+
z.literal("lucy-vton-2"),
|
|
36
42
|
z.literal("lucy-restyle-2"),
|
|
37
43
|
z.literal("lucy-latest"),
|
|
38
44
|
z.literal("lucy-vton-latest"),
|
|
39
45
|
z.literal("lucy-restyle-latest"),
|
|
40
46
|
z.literal("lucy-clip-latest"),
|
|
47
|
+
z.literal("lucy-vton"),
|
|
48
|
+
z.literal("lucy-2.1-vton-2"),
|
|
41
49
|
z.literal("lucy-pro-v2v"),
|
|
42
50
|
z.literal("lucy-restyle-v2v")
|
|
43
51
|
]);
|
|
@@ -121,11 +129,14 @@ const modelInputSchemas = {
|
|
|
121
129
|
"lucy-restyle-2": restyleSchema,
|
|
122
130
|
"lucy-2.1": videoEdit2Schema,
|
|
123
131
|
"lucy-2.1-vton": videoEdit2Schema,
|
|
132
|
+
"lucy-vton-2": videoEdit2Schema,
|
|
124
133
|
"lucy-latest": videoEdit2Schema,
|
|
125
134
|
"lucy-vton-latest": videoEdit2Schema,
|
|
126
135
|
"lucy-restyle-latest": restyleSchema,
|
|
127
136
|
"lucy-clip-latest": videoEditSchema,
|
|
128
137
|
"lucy-image-latest": imageEditSchema,
|
|
138
|
+
"lucy-vton": videoEdit2Schema,
|
|
139
|
+
"lucy-2.1-vton-2": videoEdit2Schema,
|
|
129
140
|
"lucy-pro-v2v": videoEditSchema,
|
|
130
141
|
"lucy-pro-i2i": imageEditSchema,
|
|
131
142
|
"lucy-restyle-v2v": restyleSchema
|
|
@@ -157,6 +168,14 @@ const _models = {
|
|
|
157
168
|
height: 624,
|
|
158
169
|
inputSchema: z.object({})
|
|
159
170
|
},
|
|
171
|
+
"lucy-vton-2": {
|
|
172
|
+
urlPath: "/v1/stream",
|
|
173
|
+
name: "lucy-vton-2",
|
|
174
|
+
fps: 20,
|
|
175
|
+
width: 1088,
|
|
176
|
+
height: 624,
|
|
177
|
+
inputSchema: z.object({})
|
|
178
|
+
},
|
|
160
179
|
"lucy-restyle-2": {
|
|
161
180
|
urlPath: "/v1/stream",
|
|
162
181
|
name: "lucy-restyle-2",
|
|
@@ -196,6 +215,22 @@ const _models = {
|
|
|
196
215
|
width: 1280,
|
|
197
216
|
height: 704,
|
|
198
217
|
inputSchema: z.object({})
|
|
218
|
+
},
|
|
219
|
+
"lucy-vton": {
|
|
220
|
+
urlPath: "/v1/stream",
|
|
221
|
+
name: "lucy-vton",
|
|
222
|
+
fps: 20,
|
|
223
|
+
width: 1088,
|
|
224
|
+
height: 624,
|
|
225
|
+
inputSchema: z.object({})
|
|
226
|
+
},
|
|
227
|
+
"lucy-2.1-vton-2": {
|
|
228
|
+
urlPath: "/v1/stream",
|
|
229
|
+
name: "lucy-2.1-vton-2",
|
|
230
|
+
fps: 20,
|
|
231
|
+
width: 1088,
|
|
232
|
+
height: 624,
|
|
233
|
+
inputSchema: z.object({})
|
|
199
234
|
}
|
|
200
235
|
},
|
|
201
236
|
image: {
|
|
@@ -255,6 +290,15 @@ const _models = {
|
|
|
255
290
|
height: 624,
|
|
256
291
|
inputSchema: modelInputSchemas["lucy-2.1-vton"]
|
|
257
292
|
},
|
|
293
|
+
"lucy-vton-2": {
|
|
294
|
+
urlPath: "/v1/generate/lucy-vton-2",
|
|
295
|
+
queueUrlPath: "/v1/jobs/lucy-vton-2",
|
|
296
|
+
name: "lucy-vton-2",
|
|
297
|
+
fps: 20,
|
|
298
|
+
width: 1088,
|
|
299
|
+
height: 624,
|
|
300
|
+
inputSchema: modelInputSchemas["lucy-vton-2"]
|
|
301
|
+
},
|
|
258
302
|
"lucy-restyle-2": {
|
|
259
303
|
urlPath: "/v1/generate/lucy-restyle-2",
|
|
260
304
|
queueUrlPath: "/v1/jobs/lucy-restyle-2",
|
|
@@ -300,6 +344,24 @@ const _models = {
|
|
|
300
344
|
height: 704,
|
|
301
345
|
inputSchema: modelInputSchemas["lucy-clip-latest"]
|
|
302
346
|
},
|
|
347
|
+
"lucy-vton": {
|
|
348
|
+
urlPath: "/v1/generate/lucy-vton",
|
|
349
|
+
queueUrlPath: "/v1/jobs/lucy-vton",
|
|
350
|
+
name: "lucy-vton",
|
|
351
|
+
fps: 20,
|
|
352
|
+
width: 1088,
|
|
353
|
+
height: 624,
|
|
354
|
+
inputSchema: modelInputSchemas["lucy-vton"]
|
|
355
|
+
},
|
|
356
|
+
"lucy-2.1-vton-2": {
|
|
357
|
+
urlPath: "/v1/generate/lucy-2.1-vton-2",
|
|
358
|
+
queueUrlPath: "/v1/jobs/lucy-2.1-vton-2",
|
|
359
|
+
name: "lucy-2.1-vton-2",
|
|
360
|
+
fps: 20,
|
|
361
|
+
width: 1088,
|
|
362
|
+
height: 624,
|
|
363
|
+
inputSchema: modelInputSchemas["lucy-2.1-vton-2"]
|
|
364
|
+
},
|
|
303
365
|
"lucy-pro-v2v": {
|
|
304
366
|
urlPath: "/v1/generate/lucy-pro-v2v",
|
|
305
367
|
queueUrlPath: "/v1/jobs/lucy-pro-v2v",
|