@picsart/ai-sdk 5.13.0 → 5.14.0
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/index.d.ts +6 -3
- package/index.js +22 -5
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1310,7 +1310,7 @@ type ModelInputById = {
|
|
|
1310
1310
|
prompt: string;
|
|
1311
1311
|
aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
|
|
1312
1312
|
resolution?: "480p" | "720p" | "1080p";
|
|
1313
|
-
duration?:
|
|
1313
|
+
duration?: number;
|
|
1314
1314
|
generateAudio?: boolean;
|
|
1315
1315
|
returnLastFrame?: boolean;
|
|
1316
1316
|
outputFormat?: "mp4" | "mov";
|
|
@@ -1334,7 +1334,7 @@ type ModelInputById = {
|
|
|
1334
1334
|
prompt: string;
|
|
1335
1335
|
aspectRatio?: "adaptive";
|
|
1336
1336
|
resolution?: "480p" | "720p" | "1080p";
|
|
1337
|
-
duration?:
|
|
1337
|
+
duration?: number;
|
|
1338
1338
|
generateAudio?: boolean;
|
|
1339
1339
|
outputFormat?: "mp4" | "mov";
|
|
1340
1340
|
videoUrls: [string, ...string[]];
|
|
@@ -1876,7 +1876,10 @@ interface ModelParamsAccessor {
|
|
|
1876
1876
|
file(key: string): FileEntry | undefined;
|
|
1877
1877
|
prompt(): TextEntry | undefined;
|
|
1878
1878
|
aspectRatio(): EnumEntry | undefined;
|
|
1879
|
-
|
|
1879
|
+
/** Duration is an enum on models with a fixed option list and a range on
|
|
1880
|
+
* models whose vendor accepts every value in a span (kling-t2a,
|
|
1881
|
+
* seedance-2.5), so narrow on `.kind` before reading `.options` / `.min`. */
|
|
1882
|
+
duration(): EnumEntry | RangeEntry | undefined;
|
|
1880
1883
|
resolution(): EnumEntry | undefined;
|
|
1881
1884
|
generateAudio(): BooleanEntry | undefined;
|
|
1882
1885
|
startFrame(): FileEntry | undefined;
|
package/index.js
CHANGED
|
@@ -846,6 +846,17 @@ var p = {
|
|
|
846
846
|
}
|
|
847
847
|
};
|
|
848
848
|
},
|
|
849
|
+
/** Continuous duration (seconds) — for models whose vendor accepts every
|
|
850
|
+
* value in a span instead of a fixed option list. Reach for this only when
|
|
851
|
+
* the span holds more than 10 possible values; 10 or fewer stays an enum
|
|
852
|
+
* (`duration`), which shows the exact options instead of a slider. */
|
|
853
|
+
durationRange(min, max, def, step = 1) {
|
|
854
|
+
return {
|
|
855
|
+
duration: {
|
|
856
|
+
descriptor: { kind: "range", min, max, step, default: def }
|
|
857
|
+
}
|
|
858
|
+
};
|
|
859
|
+
},
|
|
849
860
|
resolution(opts, def) {
|
|
850
861
|
return {
|
|
851
862
|
resolution: {
|
|
@@ -1216,6 +1227,7 @@ var params = {
|
|
|
1216
1227
|
prompt: p.prompt,
|
|
1217
1228
|
aspectRatio: p.aspectRatio,
|
|
1218
1229
|
duration: p.duration,
|
|
1230
|
+
durationRange: p.durationRange,
|
|
1219
1231
|
count: p.count,
|
|
1220
1232
|
resolution: p.resolution,
|
|
1221
1233
|
negativePrompt: p.negativePrompt,
|
|
@@ -3851,7 +3863,7 @@ var buildSeedance25VideoExtendPayload = (ctx) => ({
|
|
|
3851
3863
|
});
|
|
3852
3864
|
var SEEDANCE_AR = ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "adaptive"];
|
|
3853
3865
|
var SEEDANCE_V2_DURATIONS = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
|
|
3854
|
-
var
|
|
3866
|
+
var SEEDANCE_25_DURATION = { min: 4, max: 30 };
|
|
3855
3867
|
var { MODELS: MODELS12 } = defineModels("seedance", [
|
|
3856
3868
|
{
|
|
3857
3869
|
id: "seedance-2.5",
|
|
@@ -3871,7 +3883,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
|
|
|
3871
3883
|
...params.prompt(),
|
|
3872
3884
|
...params.aspectRatio(SEEDANCE_AR),
|
|
3873
3885
|
...params.resolution(["480p", "720p", "1080p"], "1080p"),
|
|
3874
|
-
...params.
|
|
3886
|
+
...params.durationRange(SEEDANCE_25_DURATION.min, SEEDANCE_25_DURATION.max, 5),
|
|
3875
3887
|
...params.generateAudio(),
|
|
3876
3888
|
...params.returnLastFrame(),
|
|
3877
3889
|
...p.enum("outputFormat", ["mp4", "mov"], "mp4", { label: "Format" }),
|
|
@@ -3928,7 +3940,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
|
|
|
3928
3940
|
// duration stays user-selectable.
|
|
3929
3941
|
...params.aspectRatio(["adaptive"]),
|
|
3930
3942
|
...params.resolution(["480p", "720p", "1080p"], "1080p"),
|
|
3931
|
-
...params.
|
|
3943
|
+
...params.durationRange(SEEDANCE_25_DURATION.min, SEEDANCE_25_DURATION.max, 15),
|
|
3932
3944
|
...params.generateAudio(),
|
|
3933
3945
|
...p.enum("outputFormat", ["mp4", "mov"], "mp4", { label: "Format" }),
|
|
3934
3946
|
...params.videoInputs(10, "Source Videos", true, void 0, SEEDANCE_25_MAX_VIDEO_BYTES)
|
|
@@ -10229,8 +10241,12 @@ var ModelParamsAccessorImpl = class {
|
|
|
10229
10241
|
aspectRatio() {
|
|
10230
10242
|
return this.narrow("aspectRatio", "enum");
|
|
10231
10243
|
}
|
|
10244
|
+
/** Enum on fixed-option models, range where the vendor accepts every value
|
|
10245
|
+
* in a span — callers narrow on `.kind`. */
|
|
10232
10246
|
duration() {
|
|
10233
|
-
|
|
10247
|
+
const entry = this.param("duration");
|
|
10248
|
+
if (!entry || entry.kind !== "enum" && entry.kind !== "range") return void 0;
|
|
10249
|
+
return entry;
|
|
10234
10250
|
}
|
|
10235
10251
|
resolution() {
|
|
10236
10252
|
return this.narrow("resolution", "enum");
|
|
@@ -10308,7 +10324,8 @@ var ConstrainedParamsAccessor = class {
|
|
|
10308
10324
|
return this.applyEnum("aspectRatio", this.inner.aspectRatio());
|
|
10309
10325
|
}
|
|
10310
10326
|
duration() {
|
|
10311
|
-
|
|
10327
|
+
const entry = this.inner.duration();
|
|
10328
|
+
return entry?.kind === "enum" ? this.applyEnum("duration", entry) : this.applyEntry("duration", entry);
|
|
10312
10329
|
}
|
|
10313
10330
|
resolution() {
|
|
10314
10331
|
return this.applyEnum("resolution", this.inner.resolution());
|