@picsart/ai-sdk 5.10.1 → 5.12.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 +3 -0
- package/index.js +43 -21
- package/package.json +1 -1
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -2554,6 +2554,7 @@ var BYTEDANCE_ENHANCE_RESOLUTION_OPTIONS = [
|
|
|
2554
2554
|
"4k",
|
|
2555
2555
|
"8k"
|
|
2556
2556
|
];
|
|
2557
|
+
var BYTEDANCE_OMNIHUMAN_RESOLUTION_OPTIONS = ["720p", "1080p"];
|
|
2557
2558
|
var BYTEDANCE_ENHANCE_FPS_OPTIONS = [30, 60, 120];
|
|
2558
2559
|
var BYTEDANCE_ENHANCE_SCENE_OPTIONS = [
|
|
2559
2560
|
"common",
|
|
@@ -2566,11 +2567,6 @@ var buildBytedanceUpscalerPayload = (ctx) => ({
|
|
|
2566
2567
|
video_url: ctx.videoUrl,
|
|
2567
2568
|
target_resolution: "1080p"
|
|
2568
2569
|
});
|
|
2569
|
-
var buildBytedanceOmnihumanPayload = (ctx) => ({
|
|
2570
|
-
image_url: ctx.imageUrls?.[0],
|
|
2571
|
-
audio_url: ctx.audioUrl,
|
|
2572
|
-
...ctx.prompt ? { prompt: ctx.prompt } : {}
|
|
2573
|
-
});
|
|
2574
2570
|
var { MODELS: MODELS6 } = defineModels("bytedance", [
|
|
2575
2571
|
{
|
|
2576
2572
|
id: "bytedance-video-upscaler",
|
|
@@ -2581,6 +2577,7 @@ var { MODELS: MODELS6 } = defineModels("bytedance", [
|
|
|
2581
2577
|
estimatedTime: 88,
|
|
2582
2578
|
mode: "video",
|
|
2583
2579
|
inputType: "v2v",
|
|
2580
|
+
deprecated: true,
|
|
2584
2581
|
description: "AI upscale video resolution \u2014 enhance existing footage to 1080p.",
|
|
2585
2582
|
features: [feat("Video Input", "input"), feat("1080p", "resolution")],
|
|
2586
2583
|
// Vendor rejects sources already at/above the 1080p target: "The input
|
|
@@ -2593,16 +2590,33 @@ var { MODELS: MODELS6 } = defineModels("bytedance", [
|
|
|
2593
2590
|
name: "ByteDance OmniHuman",
|
|
2594
2591
|
addedAt: "2026-02-06",
|
|
2595
2592
|
workflow: "bytedance/omnihuman/v1.5",
|
|
2596
|
-
|
|
2597
|
-
|
|
2593
|
+
// Pricing key of the direct BytePlus Vision AI integration that now serves
|
|
2594
|
+
// this workflow (it replaced the fal.ai proxy). The catalog `id` keeps its
|
|
2595
|
+
// `v1.5` spelling for stability, so the backend key has to be spelled out.
|
|
2596
|
+
// Priced per second of output video, narrowed by `resolution`.
|
|
2597
|
+
modelId: "bytedance-omnihuman-1.5",
|
|
2598
|
+
// The vendor quotes a real-time factor of 23 (720p) / 27 (1080p), so wall
|
|
2599
|
+
// time is driven by the driving audio's length: ~230s for a 10s clip at
|
|
2600
|
+
// 720p. Measured 92-131s for a 1.84s clip — mostly queue and fixed
|
|
2601
|
+
// overhead. This is a representative mid-length figure, not a ceiling.
|
|
2602
|
+
estimatedTime: 250,
|
|
2598
2603
|
mode: "video",
|
|
2599
2604
|
inputType: "i2v",
|
|
2600
2605
|
description: "Animate a portrait with realistic body movement driven by audio.",
|
|
2601
|
-
features: [
|
|
2606
|
+
features: [
|
|
2607
|
+
feat("Image Input", "input"),
|
|
2608
|
+
feat("Audio Input", "audio"),
|
|
2609
|
+
feat("1080p", "resolution")
|
|
2610
|
+
],
|
|
2602
2611
|
paramConfig: {
|
|
2603
2612
|
...params.prompt({ required: false }),
|
|
2604
2613
|
...params.imageInput(1, "Portrait Image", true),
|
|
2605
|
-
...params.audioInput("Audio Track", true)
|
|
2614
|
+
...params.audioInput("Audio Track", true),
|
|
2615
|
+
...params.resolution([...BYTEDANCE_OMNIHUMAN_RESOLUTION_OPTIONS], "1080p"),
|
|
2616
|
+
...p.boolean("turboMode", false, "Turbo Mode"),
|
|
2617
|
+
// -1 (the vendor default) means "pick a random seed"; any positive value
|
|
2618
|
+
// reproduces the same result for identical inputs.
|
|
2619
|
+
...p.range("seed", -1, 2147483647, -1)
|
|
2606
2620
|
}
|
|
2607
2621
|
},
|
|
2608
2622
|
{
|
|
@@ -2616,9 +2630,6 @@ var { MODELS: MODELS6 } = defineModels("bytedance", [
|
|
|
2616
2630
|
estimatedTime: 300,
|
|
2617
2631
|
mode: "video",
|
|
2618
2632
|
inputType: "v2v",
|
|
2619
|
-
// The pa-bytedance-pluggable-worker MR adding this task is still open, so
|
|
2620
|
-
// the workflow is not deployed. Flip this off once the worker ships.
|
|
2621
|
-
disabled: true,
|
|
2622
2633
|
description: "Denoise, color-correct and super-resolve existing footage up to 8K, with frame-rate conversion.",
|
|
2623
2634
|
features: [feat("Video Required", "input"), feat("Up to 8K", "resolution"), feat("Enhance", "quality")],
|
|
2624
2635
|
paramConfig: {
|
|
@@ -2661,8 +2672,17 @@ var buildBytedanceVideoEnhancePayload = (input) => {
|
|
|
2661
2672
|
...input.scene && toolVersion === DEFAULT_TOOL_VERSION ? { scene: input.scene } : {}
|
|
2662
2673
|
};
|
|
2663
2674
|
};
|
|
2675
|
+
var buildBytedanceOmniHumanPayload = (input) => ({
|
|
2676
|
+
image_url: input.imageUrls[0],
|
|
2677
|
+
audio_url: input.audioUrl,
|
|
2678
|
+
resolution: input.resolution ?? "1080p",
|
|
2679
|
+
...input.prompt ? { prompt: input.prompt } : {},
|
|
2680
|
+
...input.turboMode ? { turbo_mode: true } : {},
|
|
2681
|
+
...input.seed != null && input.seed !== -1 ? { seed: input.seed } : {}
|
|
2682
|
+
});
|
|
2664
2683
|
registerPayloads(MODELS6, {
|
|
2665
|
-
"bytedance-video-enhance": buildBytedanceVideoEnhancePayload
|
|
2684
|
+
"bytedance-video-enhance": buildBytedanceVideoEnhancePayload,
|
|
2685
|
+
"bytedance-omnihuman-v1.5": buildBytedanceOmniHumanPayload
|
|
2666
2686
|
});
|
|
2667
2687
|
|
|
2668
2688
|
// src/vendors/catalog/videography.ts
|
|
@@ -3790,7 +3810,7 @@ var buildSeedance25Payload = (ctx) => {
|
|
|
3790
3810
|
],
|
|
3791
3811
|
ratio: usesFrame ? "adaptive" : ctx.aspectRatio ?? "16:9",
|
|
3792
3812
|
duration: ctx.duration ?? 5,
|
|
3793
|
-
resolution: ctx.resolution ?? "
|
|
3813
|
+
resolution: ctx.resolution ?? "1080p",
|
|
3794
3814
|
generate_audio: ctx.generateAudio ?? true,
|
|
3795
3815
|
output_format: ctx.outputFormat ?? "mp4",
|
|
3796
3816
|
...ctx.returnLastFrame ? { return_last_frame: true } : {}
|
|
@@ -3809,7 +3829,7 @@ var buildSeedance25VideoEditPayload = (ctx) => ({
|
|
|
3809
3829
|
],
|
|
3810
3830
|
ratio: "adaptive",
|
|
3811
3831
|
duration: -1,
|
|
3812
|
-
resolution: ctx.resolution ?? "
|
|
3832
|
+
resolution: ctx.resolution ?? "1080p",
|
|
3813
3833
|
generate_audio: ctx.generateAudio ?? true,
|
|
3814
3834
|
output_format: ctx.outputFormat ?? "mp4",
|
|
3815
3835
|
...ctx.returnLastFrame ? { return_last_frame: true } : {}
|
|
@@ -3826,7 +3846,7 @@ var buildSeedance25VideoExtendPayload = (ctx) => ({
|
|
|
3826
3846
|
],
|
|
3827
3847
|
ratio: "adaptive",
|
|
3828
3848
|
duration: ctx.duration ?? 15,
|
|
3829
|
-
resolution: ctx.resolution ?? "
|
|
3849
|
+
resolution: ctx.resolution ?? "1080p",
|
|
3830
3850
|
generate_audio: ctx.generateAudio ?? true,
|
|
3831
3851
|
output_format: ctx.outputFormat ?? "mp4"
|
|
3832
3852
|
});
|
|
@@ -3851,7 +3871,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
|
|
|
3851
3871
|
paramConfig: {
|
|
3852
3872
|
...params.prompt(),
|
|
3853
3873
|
...params.aspectRatio(SEEDANCE_AR),
|
|
3854
|
-
...params.resolution(["480p", "720p", "1080p"], "
|
|
3874
|
+
...params.resolution(["480p", "720p", "1080p"], "1080p"),
|
|
3855
3875
|
...params.duration(SEEDANCE_25_DURATIONS, 5),
|
|
3856
3876
|
...params.generateAudio(),
|
|
3857
3877
|
...params.returnLastFrame(),
|
|
@@ -3882,7 +3902,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
|
|
|
3882
3902
|
// Editing mode: aspect ratio is fixed to 'adaptive' and duration is
|
|
3883
3903
|
// source-driven ('-1'), so neither is user-selectable (vendor rule).
|
|
3884
3904
|
...params.aspectRatio(["adaptive"]),
|
|
3885
|
-
...params.resolution(["480p", "720p", "1080p"], "
|
|
3905
|
+
...params.resolution(["480p", "720p", "1080p"], "1080p"),
|
|
3886
3906
|
...params.generateAudio(),
|
|
3887
3907
|
...params.returnLastFrame(),
|
|
3888
3908
|
...p.enum("outputFormat", ["mp4", "mov"], "mp4", { label: "Format" }),
|
|
@@ -3908,7 +3928,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
|
|
|
3908
3928
|
// Extension mode: aspect ratio is locked to 'adaptive' (vendor rule);
|
|
3909
3929
|
// duration stays user-selectable.
|
|
3910
3930
|
...params.aspectRatio(["adaptive"]),
|
|
3911
|
-
...params.resolution(["480p", "720p", "1080p"], "
|
|
3931
|
+
...params.resolution(["480p", "720p", "1080p"], "1080p"),
|
|
3912
3932
|
...params.duration(SEEDANCE_25_DURATIONS, 15),
|
|
3913
3933
|
...params.generateAudio(),
|
|
3914
3934
|
...p.enum("outputFormat", ["mp4", "mov"], "mp4", { label: "Format" }),
|
|
@@ -5382,6 +5402,7 @@ var fluxResolutions = ["1K", "2K", "4K"];
|
|
|
5382
5402
|
var buildFluxV2Payload = (modelId) => (ctx) => ({
|
|
5383
5403
|
prompt: ctx.prompt,
|
|
5384
5404
|
model: modelId,
|
|
5405
|
+
count: ctx.count ?? 1,
|
|
5385
5406
|
imageUrls: ctx.imageUrls ?? [],
|
|
5386
5407
|
resolution: ctx.resolution ?? "1K",
|
|
5387
5408
|
aspectRatio: ctx.aspectRatio ?? "1:1",
|
|
@@ -5411,17 +5432,18 @@ var buildFluxKontextPayload = (modelId) => (ctx) => {
|
|
|
5411
5432
|
return {
|
|
5412
5433
|
prompt: ctx.prompt,
|
|
5413
5434
|
model: modelId,
|
|
5435
|
+
count: ctx.count ?? 1,
|
|
5414
5436
|
imageUrls: ctx.imageUrls ?? [],
|
|
5415
5437
|
...aspectRatio ? { aspectRatio } : {}
|
|
5416
5438
|
};
|
|
5417
5439
|
};
|
|
5418
5440
|
var fluxV2Base = {
|
|
5419
|
-
workflow: "flux-
|
|
5441
|
+
workflow: "bfl/v1/flux-2",
|
|
5420
5442
|
mode: "image",
|
|
5421
5443
|
inputType: "t2i"
|
|
5422
5444
|
};
|
|
5423
5445
|
var fluxKontextBase = {
|
|
5424
|
-
workflow: "flux-kontext",
|
|
5446
|
+
workflow: "bfl/v1/flux-kontext",
|
|
5425
5447
|
mode: "image",
|
|
5426
5448
|
inputType: "t2i"
|
|
5427
5449
|
};
|