@picsart/ai-sdk 5.11.0 → 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.
Files changed (3) hide show
  1. package/index.d.ts +3 -0
  2. package/index.js +37 -15
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -68,6 +68,9 @@ type ModelInputById = {
68
68
  prompt?: string;
69
69
  imageUrls: [string, ...string[]];
70
70
  audioUrl: string;
71
+ resolution?: "720p" | "1080p";
72
+ turboMode?: boolean;
73
+ seed?: number;
71
74
  };
72
75
  "bytedance-video-enhance": {
73
76
  videoUrl: string;
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
- buildPayload: buildBytedanceOmnihumanPayload,
2597
- estimatedTime: 179,
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: [feat("Image Input", "input"), feat("Audio Input", "audio")],
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
@@ -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-v2",
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "5.11.0",
3
+ "version": "5.12.0",
4
4
  "type": "module",
5
5
  "description": "Type-safe SDK for 100+ AI models — image, video, audio, and text generation with Picsart",
6
6
  "license": "MIT",