@picsart/ai-sdk 3.26.0 → 3.27.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 CHANGED
@@ -69,6 +69,14 @@ type ModelInputById = {
69
69
  imageUrls: [string, ...string[]];
70
70
  audioUrl: string;
71
71
  };
72
+ "bytedance-video-enhance": {
73
+ videoUrl: string;
74
+ quality?: "standard" | "professional";
75
+ resolution?: "source" | "720p" | "1080p" | "2k" | "4k" | "8k";
76
+ fps?: 30 | 60 | 120;
77
+ scene?: "common" | "ugc" | "short_series" | "aigc" | "old_film";
78
+ bitrateLevel?: "low" | "medium" | "high";
79
+ };
72
80
  "bytedance-video-upscaler": {
73
81
  videoUrl: string;
74
82
  };
@@ -2133,6 +2141,7 @@ interface ModelFilter {
2133
2141
  declare const Models: {
2134
2142
  readonly AsyncFlashV1: "async-flash-v1";
2135
2143
  readonly BytedanceOmnihumanV15: "bytedance-omnihuman-v1.5";
2144
+ readonly BytedanceVideoEnhance: "bytedance-video-enhance";
2136
2145
  readonly BytedanceVideoUpscaler: "bytedance-video-upscaler";
2137
2146
  readonly ClaudeHaiku45: "claude-haiku-4-5";
2138
2147
  readonly ClaudeOpus48: "claude-opus-4-8";
package/index.js CHANGED
@@ -2652,6 +2652,22 @@ var { MODELS: MODELS5 } = defineModels("ovi", [
2652
2652
  ]);
2653
2653
 
2654
2654
  // src/vendors/catalog/bytedance.ts
2655
+ var BYTEDANCE_ENHANCE_RESOLUTION_OPTIONS = [
2656
+ "source",
2657
+ "720p",
2658
+ "1080p",
2659
+ "2k",
2660
+ "4k",
2661
+ "8k"
2662
+ ];
2663
+ var BYTEDANCE_ENHANCE_FPS_OPTIONS = [30, 60, 120];
2664
+ var BYTEDANCE_ENHANCE_SCENE_OPTIONS = [
2665
+ "common",
2666
+ "ugc",
2667
+ "short_series",
2668
+ "aigc",
2669
+ "old_film"
2670
+ ];
2655
2671
  var buildBytedanceUpscalerPayload = (ctx) => ({
2656
2672
  video_url: ctx.videoUrl,
2657
2673
  target_resolution: "1080p"
@@ -2694,9 +2710,67 @@ var { MODELS: MODELS6 } = defineModels("bytedance", [
2694
2710
  ...params.imageInput(1, "Portrait Image", true),
2695
2711
  ...params.audioInput("Audio Track", true)
2696
2712
  }
2713
+ },
2714
+ {
2715
+ id: "bytedance-video-enhance",
2716
+ name: "ByteDance Video Enhance",
2717
+ addedAt: "2026-07-29",
2718
+ workflow: "bytedance/video-enhance",
2719
+ // Measured on the live API: 303s end-to-end for a 5s 720p→1080p@60fps
2720
+ // professional run. Wall time scales with source duration, so this is a
2721
+ // representative short-clip figure, not a ceiling.
2722
+ estimatedTime: 300,
2723
+ mode: "video",
2724
+ inputType: "v2v",
2725
+ // The pa-bytedance-pluggable-worker MR adding this task is still open, so
2726
+ // the workflow is not deployed. Flip this off once the worker ships.
2727
+ disabled: true,
2728
+ description: "Denoise, color-correct and super-resolve existing footage up to 8K, with frame-rate conversion.",
2729
+ features: [feat("Video Required", "input"), feat("Up to 8K", "resolution"), feat("Enhance", "quality")],
2730
+ paramConfig: {
2731
+ ...params.videoInput("Source Video", "asset", true),
2732
+ ...p.quality(["standard", "professional"], "standard"),
2733
+ ...p.enum("resolution", [...BYTEDANCE_ENHANCE_RESOLUTION_OPTIONS], "source"),
2734
+ // Always sent — the backend rejects a request it cannot price, and the
2735
+ // source frame rate is not discoverable from file metadata.
2736
+ ...p.enum("fps", [...BYTEDANCE_ENHANCE_FPS_OPTIONS], 30),
2737
+ ...p.enum("scene", [...BYTEDANCE_ENHANCE_SCENE_OPTIONS], "common"),
2738
+ ...p.enum("bitrateLevel", ["low", "medium", "high"], "medium")
2739
+ },
2740
+ constraints: [
2741
+ {
2742
+ when: { quality: { is: "professional" } },
2743
+ then: { scene: { disabled: true, reason: "Scene presets only apply to the standard version" } }
2744
+ }
2745
+ ]
2697
2746
  }
2698
2747
  ]);
2699
2748
 
2749
+ // src/vendors/catalog/bytedance.payloads.ts
2750
+ var DEFAULT_TOOL_VERSION = "standard";
2751
+ var buildBytedanceVideoEnhancePayload = (input) => {
2752
+ const toolVersion = input.quality ?? DEFAULT_TOOL_VERSION;
2753
+ return {
2754
+ video_url: input.videoUrl,
2755
+ tool_version: toolVersion,
2756
+ bitrate_level: input.bitrateLevel ?? "medium",
2757
+ // Always sent: the backend resolves the billing tier before generating and
2758
+ // rejects the request (`billing_undetermined`) when the output frame rate is
2759
+ // unknown — it cannot read the source frame rate from file metadata.
2760
+ fps: input.fps ?? 30,
2761
+ // `source` is the SDK-only sentinel for "keep the source resolution"; the
2762
+ // backend expresses that by omitting the field. Sending an explicit tier
2763
+ // instead would silently rescale (and reprice) every request.
2764
+ ...input.resolution && input.resolution !== "source" ? { resolution: input.resolution } : {},
2765
+ // The vendor ignores `scene` unless tool_version is standard, and the
2766
+ // backend validator rejects the combination outright.
2767
+ ...input.scene && toolVersion === DEFAULT_TOOL_VERSION ? { scene: input.scene } : {}
2768
+ };
2769
+ };
2770
+ registerPayloads(MODELS6, {
2771
+ "bytedance-video-enhance": buildBytedanceVideoEnhancePayload
2772
+ });
2773
+
2700
2774
  // src/vendors/catalog/videography.ts
2701
2775
  var buildVideographyPayload = (ctx) => ({
2702
2776
  imageUrl: ctx.imageUrls?.[0]
@@ -10269,6 +10343,7 @@ var catalog = {
10269
10343
  // src/generated/model-constants.ts
10270
10344
  var AsyncFlashV1 = "async-flash-v1";
10271
10345
  var BytedanceOmnihumanV15 = "bytedance-omnihuman-v1.5";
10346
+ var BytedanceVideoEnhance = "bytedance-video-enhance";
10272
10347
  var BytedanceVideoUpscaler = "bytedance-video-upscaler";
10273
10348
  var ClaudeHaiku45 = "claude-haiku-4-5";
10274
10349
  var ClaudeOpus48 = "claude-opus-4-8";
@@ -10465,6 +10540,7 @@ var Wan27VideoEdit = "wan-2.7-video-edit";
10465
10540
  var Models = {
10466
10541
  AsyncFlashV1,
10467
10542
  BytedanceOmnihumanV15,
10543
+ BytedanceVideoEnhance,
10468
10544
  BytedanceVideoUpscaler,
10469
10545
  ClaudeHaiku45,
10470
10546
  ClaudeOpus48,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "3.26.0",
3
+ "version": "3.27.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",