@picsart/ai-sdk 3.25.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
  };
@@ -409,6 +417,11 @@ type ModelInputById = {
409
417
  count?: 1 | 2 | 4 | 6 | 8 | 10;
410
418
  imageUrls: [string, ...string[]];
411
419
  };
420
+ "ideogram-p-image": {
421
+ prompt: string;
422
+ resolution?: "2048x2048" | "1440x2880" | "2880x1440" | "1664x2496" | "2496x1664" | "1792x2240" | "2240x1792" | "1440x2560" | "2560x1440" | "1600x2560" | "2560x1600" | "1728x2304" | "2304x1728" | "1296x3168" | "3168x1296" | "1152x2944" | "2944x1152" | "1248x3328" | "3328x1248" | "1280x3072" | "3072x1280" | "1024x3072" | "3072x1024" | "1024x1024" | "896x1120" | "1120x896" | "864x1152" | "1152x864" | "832x1248" | "1248x832" | "800x1280" | "1280x800" | "720x1280" | "1280x720" | "720x1440" | "1440x720";
423
+ renderingSpeed?: "very-low" | "low" | "medium" | "high";
424
+ };
412
425
  "ideogram-v3": {
413
426
  prompt: string;
414
427
  aspectRatio?: "16:9" | "9:16" | "1:1" | "3:4" | "4:3";
@@ -2128,6 +2141,7 @@ interface ModelFilter {
2128
2141
  declare const Models: {
2129
2142
  readonly AsyncFlashV1: "async-flash-v1";
2130
2143
  readonly BytedanceOmnihumanV15: "bytedance-omnihuman-v1.5";
2144
+ readonly BytedanceVideoEnhance: "bytedance-video-enhance";
2131
2145
  readonly BytedanceVideoUpscaler: "bytedance-video-upscaler";
2132
2146
  readonly ClaudeHaiku45: "claude-haiku-4-5";
2133
2147
  readonly ClaudeOpus48: "claude-opus-4-8";
@@ -2185,6 +2199,7 @@ declare const Models: {
2185
2199
  readonly HeygenVideoAvatar: "heygen-video-avatar";
2186
2200
  readonly HunyuanV3: "hunyuan-v3";
2187
2201
  readonly IdeogramCharacter: "ideogram-character";
2202
+ readonly IdeogramPImage: "ideogram-p-image";
2188
2203
  readonly IdeogramV3: "ideogram-v3";
2189
2204
  readonly IdeogramV4: "ideogram-v4";
2190
2205
  readonly Imagen40: "imagen-4.0";
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]
@@ -6492,6 +6566,11 @@ var buildIdeogramV4GeneratePayload = (ctx) => ({
6492
6566
  ...ctx.renderingSpeed ? { rendering_speed: ctx.renderingSpeed } : {},
6493
6567
  ...ctx.enableCopyrightDetection ? { enable_copyright_detection: true } : {}
6494
6568
  });
6569
+ var buildIdeogramPImagePayload = (ctx) => ({
6570
+ prompt: ctx.prompt,
6571
+ resolution: ctx.resolution ?? "1024x1024",
6572
+ rendering_speed: ctx.renderingSpeed ?? "medium"
6573
+ });
6495
6574
  var { MODELS: MODELS27 } = defineModels("ideogram", [
6496
6575
  {
6497
6576
  id: "ideogram-v4",
@@ -6537,6 +6616,68 @@ var { MODELS: MODELS27 } = defineModels("ideogram", [
6537
6616
  ...p.boolean("enableCopyrightDetection", false, "Copyright Detection")
6538
6617
  }
6539
6618
  },
6619
+ {
6620
+ id: "ideogram-p-image",
6621
+ name: "Ideogram P-Image",
6622
+ release: "preview",
6623
+ addedAt: "2026-07-28",
6624
+ workflow: "ideogram/p-image/generate",
6625
+ buildPayload: buildIdeogramPImagePayload,
6626
+ estimatedTime: 15,
6627
+ mode: "image",
6628
+ inputType: "t2i",
6629
+ description: "Tiered Ideogram text-to-image \u2014 pick a speed/quality tier from very-low (fastest) to high (max quality).",
6630
+ features: [feat("Speed Tiers", "style"), feat("Up to 2K", "resolution")],
6631
+ paramConfig: {
6632
+ ...params.prompt(),
6633
+ ...params.resolution([
6634
+ // 2K bucket (~3–4 MP)
6635
+ "2048x2048",
6636
+ "1440x2880",
6637
+ "2880x1440",
6638
+ "1664x2496",
6639
+ "2496x1664",
6640
+ "1792x2240",
6641
+ "2240x1792",
6642
+ "1440x2560",
6643
+ "2560x1440",
6644
+ "1600x2560",
6645
+ "2560x1600",
6646
+ "1728x2304",
6647
+ "2304x1728",
6648
+ "1296x3168",
6649
+ "3168x1296",
6650
+ "1152x2944",
6651
+ "2944x1152",
6652
+ "1248x3328",
6653
+ "3328x1248",
6654
+ "1280x3072",
6655
+ "3072x1280",
6656
+ "1024x3072",
6657
+ "3072x1024",
6658
+ // 1K bucket (~1 MP)
6659
+ "1024x1024",
6660
+ "896x1120",
6661
+ "1120x896",
6662
+ "864x1152",
6663
+ "1152x864",
6664
+ "832x1248",
6665
+ "1248x832",
6666
+ "800x1280",
6667
+ "1280x800",
6668
+ "720x1280",
6669
+ "1280x720",
6670
+ "720x1440",
6671
+ "1440x720"
6672
+ ], "1024x1024"),
6673
+ ...params.renderingSpeed([
6674
+ { id: "very-low", label: "Very Low" },
6675
+ { id: "low", label: "Low" },
6676
+ { id: "medium", label: "Balanced" },
6677
+ { id: "high", label: "Quality" }
6678
+ ], "medium")
6679
+ }
6680
+ },
6540
6681
  {
6541
6682
  id: "ideogram-v3",
6542
6683
  name: "Ideogram v3",
@@ -10202,6 +10343,7 @@ var catalog = {
10202
10343
  // src/generated/model-constants.ts
10203
10344
  var AsyncFlashV1 = "async-flash-v1";
10204
10345
  var BytedanceOmnihumanV15 = "bytedance-omnihuman-v1.5";
10346
+ var BytedanceVideoEnhance = "bytedance-video-enhance";
10205
10347
  var BytedanceVideoUpscaler = "bytedance-video-upscaler";
10206
10348
  var ClaudeHaiku45 = "claude-haiku-4-5";
10207
10349
  var ClaudeOpus48 = "claude-opus-4-8";
@@ -10259,6 +10401,7 @@ var HeygenTalkingPhoto = "heygen-talking-photo";
10259
10401
  var HeygenVideoAvatar = "heygen-video-avatar";
10260
10402
  var HunyuanV3 = "hunyuan-v3";
10261
10403
  var IdeogramCharacter = "ideogram-character";
10404
+ var IdeogramPImage = "ideogram-p-image";
10262
10405
  var IdeogramV3 = "ideogram-v3";
10263
10406
  var IdeogramV4 = "ideogram-v4";
10264
10407
  var Imagen40 = "imagen-4.0";
@@ -10397,6 +10540,7 @@ var Wan27VideoEdit = "wan-2.7-video-edit";
10397
10540
  var Models = {
10398
10541
  AsyncFlashV1,
10399
10542
  BytedanceOmnihumanV15,
10543
+ BytedanceVideoEnhance,
10400
10544
  BytedanceVideoUpscaler,
10401
10545
  ClaudeHaiku45,
10402
10546
  ClaudeOpus48,
@@ -10454,6 +10598,7 @@ var Models = {
10454
10598
  HeygenVideoAvatar,
10455
10599
  HunyuanV3,
10456
10600
  IdeogramCharacter,
10601
+ IdeogramPImage,
10457
10602
  IdeogramV3,
10458
10603
  IdeogramV4,
10459
10604
  Imagen40,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "3.25.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",