@decartai/sdk 0.0.40 → 0.0.42
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
CHANGED
|
@@ -158,12 +158,6 @@ interface ProcessInputs {
|
|
|
158
158
|
* @default true
|
|
159
159
|
*/
|
|
160
160
|
enhance_prompt?: boolean;
|
|
161
|
-
/**
|
|
162
|
-
* The number of inference steps.
|
|
163
|
-
*
|
|
164
|
-
* @default 50
|
|
165
|
-
*/
|
|
166
|
-
num_inference_steps?: number;
|
|
167
161
|
}
|
|
168
162
|
/**
|
|
169
163
|
* ProcessInputs combined with model-specific inputs.
|
|
@@ -17,7 +17,7 @@ declare const avatarOptionsSchema: z.ZodObject<{
|
|
|
17
17
|
type AvatarOptions = z.infer<typeof avatarOptionsSchema>;
|
|
18
18
|
declare const realTimeClientConnectOptionsSchema: z.ZodObject<{
|
|
19
19
|
model: z.ZodObject<{
|
|
20
|
-
name: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">, z.ZodLiteral<"
|
|
20
|
+
name: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">, z.ZodLiteral<"lucy_2_rt">, z.ZodLiteral<"live_avatar">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-dev-i2v">, z.ZodLiteral<"lucy-fast-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.ZodLiteral<"lucy-restyle-v2v">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-pro-t2i">, z.ZodLiteral<"lucy-pro-i2i">]>]>;
|
|
21
21
|
urlPath: z.ZodString;
|
|
22
22
|
queueUrlPath: z.ZodOptional<z.ZodString>;
|
|
23
23
|
fps: z.ZodNumber;
|
|
@@ -57,6 +57,7 @@ type RealTimeClient = {
|
|
|
57
57
|
setImage: (image: Blob | File | string | null, options?: {
|
|
58
58
|
prompt?: string;
|
|
59
59
|
enhance?: boolean;
|
|
60
|
+
timeout?: number;
|
|
60
61
|
}) => Promise<void>;
|
|
61
62
|
playAudio?: (audio: Blob | File | ArrayBuffer) => Promise<void>;
|
|
62
63
|
};
|
|
@@ -3,7 +3,7 @@ import mitt from "mitt";
|
|
|
3
3
|
|
|
4
4
|
//#region src/realtime/webrtc-connection.ts
|
|
5
5
|
const ICE_SERVERS = [{ urls: "stun:stun.l.google.com:19302" }];
|
|
6
|
-
const AVATAR_SETUP_TIMEOUT_MS =
|
|
6
|
+
const AVATAR_SETUP_TIMEOUT_MS = 3e4;
|
|
7
7
|
var WebRTCConnection = class {
|
|
8
8
|
pc = null;
|
|
9
9
|
ws = null;
|
|
@@ -14,7 +14,7 @@ var WebRTCConnection = class {
|
|
|
14
14
|
constructor(callbacks = {}) {
|
|
15
15
|
this.callbacks = callbacks;
|
|
16
16
|
}
|
|
17
|
-
async connect(url, localStream, timeout
|
|
17
|
+
async connect(url, localStream, timeout, integration) {
|
|
18
18
|
const deadline = Date.now() + timeout;
|
|
19
19
|
this.localStream = localStream;
|
|
20
20
|
const userAgent = encodeURIComponent(buildUserAgent(integration));
|
|
@@ -140,7 +140,7 @@ var WebRTCConnection = class {
|
|
|
140
140
|
const timeoutId = setTimeout(() => {
|
|
141
141
|
this.websocketMessagesEmitter.off("setImageAck", listener);
|
|
142
142
|
reject(/* @__PURE__ */ new Error("Image send timed out"));
|
|
143
|
-
}, AVATAR_SETUP_TIMEOUT_MS);
|
|
143
|
+
}, options?.timeout ?? AVATAR_SETUP_TIMEOUT_MS);
|
|
144
144
|
const listener = (msg) => {
|
|
145
145
|
clearTimeout(timeoutId);
|
|
146
146
|
this.websocketMessagesEmitter.off("setImageAck", listener);
|
|
@@ -29,7 +29,7 @@ var WebRTCManager = class {
|
|
|
29
29
|
}
|
|
30
30
|
async connect(localStream) {
|
|
31
31
|
return pRetry(async () => {
|
|
32
|
-
await this.connection.connect(this.config.webrtcUrl, localStream, 6e4, this.config.integration);
|
|
32
|
+
await this.connection.connect(this.config.webrtcUrl, localStream, 6e4 * 5, this.config.integration);
|
|
33
33
|
return true;
|
|
34
34
|
}, {
|
|
35
35
|
retries: 5,
|
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<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">, z.ZodLiteral<"
|
|
4
|
+
declare const realtimeModels: z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">, z.ZodLiteral<"lucy_2_rt">, z.ZodLiteral<"live_avatar">]>;
|
|
5
5
|
declare const videoModels: z.ZodUnion<readonly [z.ZodLiteral<"lucy-dev-i2v">, z.ZodLiteral<"lucy-fast-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.ZodLiteral<"lucy-restyle-v2v">]>;
|
|
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.ZodLiteral<"
|
|
7
|
+
declare const modelSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"mirage">, z.ZodLiteral<"mirage_v2">, z.ZodLiteral<"lucy_v2v_720p_rt">, z.ZodLiteral<"lucy_2_rt">, z.ZodLiteral<"live_avatar">]>, z.ZodUnion<readonly [z.ZodLiteral<"lucy-dev-i2v">, z.ZodLiteral<"lucy-fast-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.ZodLiteral<"lucy-restyle-v2v">]>, 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>;
|
|
@@ -69,7 +69,6 @@ declare const modelInputSchemas: {
|
|
|
69
69
|
seed: z.ZodOptional<z.ZodNumber>;
|
|
70
70
|
resolution: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"720p">>>;
|
|
71
71
|
enhance_prompt: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
-
num_inference_steps: z.ZodOptional<z.ZodNumber>;
|
|
73
72
|
}, z.core.$strip>;
|
|
74
73
|
readonly "lucy-fast-v2v": z.ZodObject<{
|
|
75
74
|
prompt: z.ZodString;
|
package/dist/shared/model.js
CHANGED
|
@@ -6,7 +6,7 @@ const realtimeModels = z.union([
|
|
|
6
6
|
z.literal("mirage"),
|
|
7
7
|
z.literal("mirage_v2"),
|
|
8
8
|
z.literal("lucy_v2v_720p_rt"),
|
|
9
|
-
z.literal("
|
|
9
|
+
z.literal("lucy_2_rt"),
|
|
10
10
|
z.literal("live_avatar")
|
|
11
11
|
]);
|
|
12
12
|
const videoModels = z.union([
|
|
@@ -96,8 +96,7 @@ const modelInputSchemas = {
|
|
|
96
96
|
reference_image: fileInputSchema.optional().describe("Optional reference image to guide what to add to the video (File, Blob, ReadableStream, URL, or string URL)"),
|
|
97
97
|
seed: z.number().optional().describe("The seed to use for the generation"),
|
|
98
98
|
resolution: proV2vResolutionSchema,
|
|
99
|
-
enhance_prompt: z.boolean().optional().describe("Whether to enhance the prompt")
|
|
100
|
-
num_inference_steps: z.number().optional().describe("The number of inference steps")
|
|
99
|
+
enhance_prompt: z.boolean().optional().describe("Whether to enhance the prompt")
|
|
101
100
|
}),
|
|
102
101
|
"lucy-fast-v2v": z.object({
|
|
103
102
|
prompt: z.string().min(1).max(1e3).describe("The prompt to use for the generation"),
|
|
@@ -174,9 +173,9 @@ const _models = {
|
|
|
174
173
|
height: 704,
|
|
175
174
|
inputSchema: z.object({})
|
|
176
175
|
},
|
|
177
|
-
|
|
176
|
+
lucy_2_rt: {
|
|
178
177
|
urlPath: "/v1/stream",
|
|
179
|
-
name: "
|
|
178
|
+
name: "lucy_2_rt",
|
|
180
179
|
fps: 20,
|
|
181
180
|
width: 1280,
|
|
182
181
|
height: 720,
|