@decartai/sdk 0.0.12 → 0.0.13
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/request.js +1 -0
- package/dist/realtime/client.d.ts +1 -1
- package/dist/shared/model.d.ts +12 -2
- package/dist/shared/model.js +24 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/process/request.js
CHANGED
|
@@ -17,6 +17,7 @@ async function fileInputToBlob(input) {
|
|
|
17
17
|
async function sendRequest({ baseUrl, apiKey, model, inputs, signal, integration }) {
|
|
18
18
|
const formData = new FormData();
|
|
19
19
|
for (const [key, value] of Object.entries(inputs)) if (value !== void 0 && value !== null) if (value instanceof Blob) formData.append(key, value);
|
|
20
|
+
else if (typeof value === "object" && value !== null) formData.append(key, JSON.stringify(value));
|
|
20
21
|
else formData.append(key, String(value));
|
|
21
22
|
const endpoint = `${baseUrl}${model.urlPath}`;
|
|
22
23
|
const response = await fetch(endpoint, {
|
|
@@ -14,7 +14,7 @@ type OnRemoteStreamFn = (stream: MediaStream) => void;
|
|
|
14
14
|
type RealTimeClientInitialState = z.infer<typeof realTimeClientInitialStateSchema>;
|
|
15
15
|
declare const realTimeClientConnectOptionsSchema: z.ZodObject<{
|
|
16
16
|
model: z.ZodObject<{
|
|
17
|
-
name: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-dev-i2v">, z.ZodLiteral<"lucy-dev-v2v">, z.ZodLiteral<"lucy-pro-t2v">, z.ZodLiteral<"lucy-pro-i2v">, z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-pro-flf2v">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-pro-t2i">, z.ZodLiteral<"lucy-pro-i2i">]>]>;
|
|
17
|
+
name: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-dev-i2v">, z.ZodLiteral<"lucy-dev-v2v">, z.ZodLiteral<"lucy-pro-t2v">, z.ZodLiteral<"lucy-pro-i2v">, z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-pro-flf2v">, z.ZodLiteral<"lucy-motion">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-pro-t2i">, z.ZodLiteral<"lucy-pro-i2i">]>]>;
|
|
18
18
|
urlPath: z.ZodString;
|
|
19
19
|
fps: z.ZodNumber;
|
|
20
20
|
width: z.ZodNumber;
|
package/dist/shared/model.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { z } from "zod";
|
|
|
2
2
|
|
|
3
3
|
//#region src/shared/model.d.ts
|
|
4
4
|
declare const realtimeModels: z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">]>;
|
|
5
|
-
declare const videoModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-dev-i2v">, z.ZodLiteral<"lucy-dev-v2v">, z.ZodLiteral<"lucy-pro-t2v">, z.ZodLiteral<"lucy-pro-i2v">, z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-pro-flf2v">]>;
|
|
5
|
+
declare const videoModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-dev-i2v">, z.ZodLiteral<"lucy-dev-v2v">, z.ZodLiteral<"lucy-pro-t2v">, z.ZodLiteral<"lucy-pro-i2v">, z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-pro-flf2v">, z.ZodLiteral<"lucy-motion">]>;
|
|
6
6
|
declare const imageModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-pro-t2i">, z.ZodLiteral<"lucy-pro-i2i">]>;
|
|
7
|
-
declare const modelSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-dev-i2v">, z.ZodLiteral<"lucy-dev-v2v">, z.ZodLiteral<"lucy-pro-t2v">, z.ZodLiteral<"lucy-pro-i2v">, z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-pro-flf2v">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-pro-t2i">, z.ZodLiteral<"lucy-pro-i2i">]>]>;
|
|
7
|
+
declare const modelSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-dev-i2v">, z.ZodLiteral<"lucy-dev-v2v">, z.ZodLiteral<"lucy-pro-t2v">, z.ZodLiteral<"lucy-pro-i2v">, z.ZodLiteral<"lucy-pro-v2v">, z.ZodLiteral<"lucy-pro-flf2v">, z.ZodLiteral<"lucy-motion">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-pro-t2i">, 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>;
|
|
@@ -81,6 +81,16 @@ declare const modelInputSchemas: {
|
|
|
81
81
|
}>>>;
|
|
82
82
|
enhance_prompt: z.ZodOptional<z.ZodBoolean>;
|
|
83
83
|
}, z.core.$strip>;
|
|
84
|
+
readonly "lucy-motion": z.ZodObject<{
|
|
85
|
+
data: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>, z.ZodCustom<ReadableStream<unknown>, ReadableStream<unknown>>, z.ZodCustom<URL, URL>, z.ZodURL]>;
|
|
86
|
+
trajectory: z.ZodArray<z.ZodObject<{
|
|
87
|
+
frame: z.ZodNumber;
|
|
88
|
+
x: z.ZodNumber;
|
|
89
|
+
y: z.ZodNumber;
|
|
90
|
+
}, z.core.$strip>>;
|
|
91
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
resolution: z.ZodOptional<z.ZodDefault<z.ZodLiteral<"720p">>>;
|
|
93
|
+
}, z.core.$strip>;
|
|
84
94
|
};
|
|
85
95
|
type ModelInputSchemas = typeof modelInputSchemas;
|
|
86
96
|
type ModelDefinition<T extends Model = Model> = {
|
package/dist/shared/model.js
CHANGED
|
@@ -13,7 +13,8 @@ const videoModels = z.union([
|
|
|
13
13
|
z.literal("lucy-pro-t2v"),
|
|
14
14
|
z.literal("lucy-pro-i2v"),
|
|
15
15
|
z.literal("lucy-pro-v2v"),
|
|
16
|
-
z.literal("lucy-pro-flf2v")
|
|
16
|
+
z.literal("lucy-pro-flf2v"),
|
|
17
|
+
z.literal("lucy-motion")
|
|
17
18
|
]);
|
|
18
19
|
const imageModels = z.union([z.literal("lucy-pro-t2i"), z.literal("lucy-pro-i2i")]);
|
|
19
20
|
const modelSchema = z.union([
|
|
@@ -40,6 +41,10 @@ const proResolutionSchema = () => {
|
|
|
40
41
|
return z.enum(["720p", "480p"]).optional().describe("The resolution to use for the generation").default("720p");
|
|
41
42
|
};
|
|
42
43
|
/**
|
|
44
|
+
* Resolution schema for lucy-motion.
|
|
45
|
+
*/
|
|
46
|
+
const motionResolutionSchema = z.literal("720p").default("720p").optional().describe("The resolution to use for the generation");
|
|
47
|
+
/**
|
|
43
48
|
* Resolution schema for lucy-pro-v2v (supports 720p and 480p).
|
|
44
49
|
*/
|
|
45
50
|
const proV2vResolutionSchema = z.enum(["720p", "480p"]).optional().describe("The resolution to use for the generation").default("720p");
|
|
@@ -96,6 +101,16 @@ const modelInputSchemas = {
|
|
|
96
101
|
seed: z.number().optional().describe("The seed to use for the generation"),
|
|
97
102
|
resolution: proResolutionSchema(),
|
|
98
103
|
enhance_prompt: z.boolean().optional().describe("Whether to enhance the prompt")
|
|
104
|
+
}),
|
|
105
|
+
"lucy-motion": z.object({
|
|
106
|
+
data: fileInputSchema.describe("The image data to use for generation (File, Blob, ReadableStream, URL, or string URL)"),
|
|
107
|
+
trajectory: z.array(z.object({
|
|
108
|
+
frame: z.number().min(0),
|
|
109
|
+
x: z.number().min(0),
|
|
110
|
+
y: z.number().min(0)
|
|
111
|
+
})).min(2).max(121).describe("The trajectory of the desired movement of the object in the image"),
|
|
112
|
+
seed: z.number().optional().describe("The seed to use for the generation"),
|
|
113
|
+
resolution: motionResolutionSchema
|
|
99
114
|
})
|
|
100
115
|
};
|
|
101
116
|
const modelDefinitionSchema = z.object({
|
|
@@ -199,6 +214,14 @@ const _models = {
|
|
|
199
214
|
width: 1280,
|
|
200
215
|
height: 704,
|
|
201
216
|
inputSchema: modelInputSchemas["lucy-pro-flf2v"]
|
|
217
|
+
},
|
|
218
|
+
"lucy-motion": {
|
|
219
|
+
urlPath: "/v1/generate/lucy-motion",
|
|
220
|
+
name: "lucy-motion",
|
|
221
|
+
fps: 25,
|
|
222
|
+
width: 1280,
|
|
223
|
+
height: 704,
|
|
224
|
+
inputSchema: modelInputSchemas["lucy-motion"]
|
|
202
225
|
}
|
|
203
226
|
}
|
|
204
227
|
};
|
package/dist/version.js
CHANGED