@decartai/sdk 0.0.53 → 0.0.55
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 +23 -1
- package/dist/shared/model.d.ts +19 -2
- package/dist/shared/model.js +20 -2
- package/package.json +1 -1
package/dist/process/types.d.ts
CHANGED
|
@@ -80,6 +80,28 @@ interface VideoEditInputs {
|
|
|
80
80
|
*/
|
|
81
81
|
reference_image?: FileInput;
|
|
82
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Model-specific input documentation for lucy-2-v2v.
|
|
85
|
+
* Requires prompt (can be empty string). Optional reference_image can also be provided.
|
|
86
|
+
*/
|
|
87
|
+
interface VideoEdit2Inputs {
|
|
88
|
+
/**
|
|
89
|
+
* Text prompt for the video editing. Send an empty string if you want no text prompt.
|
|
90
|
+
*
|
|
91
|
+
* See our [Prompt Engineering](https://docs.platform.decart.ai/models/video/video-generation#prompt-engineering) guide for how to write prompt for Decart video models effectively.
|
|
92
|
+
*/
|
|
93
|
+
prompt: string;
|
|
94
|
+
/**
|
|
95
|
+
* Video file to process.
|
|
96
|
+
* Can be a File, Blob, ReadableStream, URL, or string URL.
|
|
97
|
+
*/
|
|
98
|
+
data: FileInput;
|
|
99
|
+
/**
|
|
100
|
+
* Optional reference image to guide what to add to the video.
|
|
101
|
+
* Can be a File, Blob, ReadableStream, URL, or string URL.
|
|
102
|
+
*/
|
|
103
|
+
reference_image?: FileInput;
|
|
104
|
+
}
|
|
83
105
|
/**
|
|
84
106
|
* Model-specific input documentation for lucy-restyle-v2v.
|
|
85
107
|
* Allows either prompt or reference_image (mutually exclusive).
|
|
@@ -116,7 +138,7 @@ interface PromptInput {
|
|
|
116
138
|
* This allows different models to have field-specific documentation while maintaining type safety.
|
|
117
139
|
* Specific models are checked first, then falls back to category-based selection.
|
|
118
140
|
*/
|
|
119
|
-
type ModelSpecificInputs<T extends ModelDefinition> = T["name"] extends "lucy-pro-i2i" ? ImageEditingInputs : T["name"] extends "lucy-restyle-v2v" ? VideoRestyleInputs : T["name"] extends "lucy-pro-v2v" ? VideoEditInputs : T["name"] extends ImageModels ? ImageGenerationInputs : T["name"] extends VideoModels ? VideoModelInputs : PromptInput;
|
|
141
|
+
type ModelSpecificInputs<T extends ModelDefinition> = T["name"] extends "lucy-pro-i2i" ? ImageEditingInputs : T["name"] extends "lucy-restyle-v2v" ? VideoRestyleInputs : T["name"] extends "lucy-2-v2v" ? VideoEdit2Inputs : T["name"] extends "lucy-pro-v2v" ? VideoEditInputs : T["name"] extends ImageModels ? ImageGenerationInputs : T["name"] extends VideoModels ? VideoModelInputs : PromptInput;
|
|
120
142
|
interface ProcessInputs {
|
|
121
143
|
/**
|
|
122
144
|
* Random seed for reproducible results.
|
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">, z.ZodLiteral<"lucy_2_rt">, z.ZodLiteral<"live_avatar">]>;
|
|
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">]>;
|
|
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">, z.ZodLiteral<"lucy-2-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<"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">]>]>;
|
|
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.ZodLiteral<"lucy-2-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>;
|
|
@@ -143,6 +143,22 @@ declare const modelInputSchemas: {
|
|
|
143
143
|
resolution: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"720p">>>;
|
|
144
144
|
enhance_prompt: z.ZodOptional<z.ZodBoolean>;
|
|
145
145
|
}, z.core.$strip>;
|
|
146
|
+
readonly "lucy-2-v2v": z.ZodObject<{
|
|
147
|
+
prompt: z.ZodString;
|
|
148
|
+
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<{
|
|
149
|
+
uri: z.ZodString;
|
|
150
|
+
type: z.ZodString;
|
|
151
|
+
name: z.ZodString;
|
|
152
|
+
}, z.core.$strip>]>>;
|
|
153
|
+
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<{
|
|
154
|
+
uri: z.ZodString;
|
|
155
|
+
type: z.ZodString;
|
|
156
|
+
name: z.ZodString;
|
|
157
|
+
}, z.core.$strip>]>;
|
|
158
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
159
|
+
resolution: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"720p">>>;
|
|
160
|
+
enhance_prompt: z.ZodOptional<z.ZodBoolean>;
|
|
161
|
+
}, z.core.$strip>;
|
|
146
162
|
};
|
|
147
163
|
type ModelInputSchemas = typeof modelInputSchemas;
|
|
148
164
|
type ModelDefinition<T extends Model = Model> = {
|
|
@@ -185,6 +201,7 @@ declare const models: {
|
|
|
185
201
|
* - `"lucy-dev-i2v"` - Image-to-video (Dev quality)
|
|
186
202
|
* - `"lucy-fast-v2v"` - Video-to-video (Fast quality)
|
|
187
203
|
* - `"lucy-restyle-v2v"` - Video-to-video (Restyling)
|
|
204
|
+
* - `"lucy-2-v2v"` - Video-to-video (Long-form editing, 720p)
|
|
188
205
|
*/
|
|
189
206
|
video: <T extends VideoModels>(model: T) => ModelDefinition<T>;
|
|
190
207
|
/**
|
package/dist/shared/model.js
CHANGED
|
@@ -17,7 +17,8 @@ const videoModels = z.union([
|
|
|
17
17
|
z.literal("lucy-pro-v2v"),
|
|
18
18
|
z.literal("lucy-pro-flf2v"),
|
|
19
19
|
z.literal("lucy-motion"),
|
|
20
|
-
z.literal("lucy-restyle-v2v")
|
|
20
|
+
z.literal("lucy-restyle-v2v"),
|
|
21
|
+
z.literal("lucy-2-v2v")
|
|
21
22
|
]);
|
|
22
23
|
const imageModels = z.union([z.literal("lucy-pro-t2i"), z.literal("lucy-pro-i2i")]);
|
|
23
24
|
const modelSchema = z.union([
|
|
@@ -136,7 +137,15 @@ const modelInputSchemas = {
|
|
|
136
137
|
seed: z.number().optional().describe("Seed for the video generation"),
|
|
137
138
|
resolution: proV2vResolutionSchema,
|
|
138
139
|
enhance_prompt: z.boolean().optional().describe("Whether to enhance the prompt (only valid with text prompt, defaults to true on backend)")
|
|
139
|
-
}).refine((data) => data.prompt !== void 0 !== (data.reference_image !== void 0), { message: "Must provide either 'prompt' or 'reference_image', but not both" }).refine((data) => !(data.reference_image !== void 0 && data.enhance_prompt !== void 0), { message: "'enhance_prompt' is only valid when using 'prompt', not 'reference_image'" })
|
|
140
|
+
}).refine((data) => data.prompt !== void 0 !== (data.reference_image !== void 0), { message: "Must provide either 'prompt' or 'reference_image', but not both" }).refine((data) => !(data.reference_image !== void 0 && data.enhance_prompt !== void 0), { message: "'enhance_prompt' is only valid when using 'prompt', not 'reference_image'" }),
|
|
141
|
+
"lucy-2-v2v": z.object({
|
|
142
|
+
prompt: z.string().max(1e3).describe("Text prompt for the video editing. Send an empty string if you want no text prompt."),
|
|
143
|
+
reference_image: fileInputSchema.optional().describe("Optional reference image to guide the edit (File, Blob, ReadableStream, URL, or string URL)"),
|
|
144
|
+
data: fileInputSchema.describe("Video file to process (File, Blob, ReadableStream, URL, or string URL)"),
|
|
145
|
+
seed: z.number().optional().describe("The seed to use for the generation"),
|
|
146
|
+
resolution: proV2vResolutionSchema,
|
|
147
|
+
enhance_prompt: z.boolean().optional().describe("Whether to enhance the prompt")
|
|
148
|
+
})
|
|
140
149
|
};
|
|
141
150
|
const modelDefinitionSchema = z.object({
|
|
142
151
|
name: z.string(),
|
|
@@ -282,6 +291,15 @@ const _models = {
|
|
|
282
291
|
width: 1280,
|
|
283
292
|
height: 704,
|
|
284
293
|
inputSchema: modelInputSchemas["lucy-restyle-v2v"]
|
|
294
|
+
},
|
|
295
|
+
"lucy-2-v2v": {
|
|
296
|
+
urlPath: "/v1/generate/lucy-2-v2v",
|
|
297
|
+
queueUrlPath: "/v1/jobs/lucy-2-v2v",
|
|
298
|
+
name: "lucy-2-v2v",
|
|
299
|
+
fps: 20,
|
|
300
|
+
width: 1280,
|
|
301
|
+
height: 720,
|
|
302
|
+
inputSchema: modelInputSchemas["lucy-2-v2v"]
|
|
285
303
|
}
|
|
286
304
|
}
|
|
287
305
|
};
|