@picsart/ai-sdk 5.22.1 → 5.23.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/README.md CHANGED
@@ -144,10 +144,10 @@ catalog.find({ output: 'text' })
144
144
  image/video model throws, and `generate()` throws on a text model — use the matching
145
145
  method for each.
146
146
 
147
- ## Voice & Avatar Catalogs
147
+ ## Voice, Avatar & Template Catalogs
148
148
 
149
- Models with catalog-backed params (voices, avatars) serve their option lists
150
- from platform catalog tasks (`<vendor>/v1/catalog/<voices|avatars>`) — nothing
149
+ Models with catalog-backed params (voices, avatars, effect / caption templates) serve their option lists
150
+ from platform catalog tasks (`<vendor>/v1/catalog/<voices|avatars|templates|…>`) — nothing
151
151
  is bundled; the workers cache the lists and answer fast. Fetch them via
152
152
  `ai.catalogs`:
153
153
 
package/index.d.ts CHANGED
@@ -112,6 +112,10 @@ type ModelInputById = {
112
112
  "bytedance-video-upscaler": {
113
113
  videoUrl: string;
114
114
  };
115
+ "captionsai-video-captions": {
116
+ videoUrl: string;
117
+ templateId?: string;
118
+ };
115
119
  "claude-haiku-4-5": {
116
120
  prompt: string;
117
121
  imageUrls?: string[];
@@ -2013,7 +2017,7 @@ interface ModelFilter$1 {
2013
2017
  release?: ReleaseTag[];
2014
2018
  }
2015
2019
 
2016
- type AppProvider = 'picsart' | 'google' | 'kling' | 'grok' | 'openai' | 'flux' | 'ideogram' | 'elevenlabs' | 'minimax' | 'wan' | 'seedance' | 'ltx' | 'seedream' | 'seedaudio' | 'hunyuan' | 'pika' | 'runway' | 'luma' | 'ovi' | 'creatify' | 'veed' | 'bytedance' | 'qwen' | 'reve' | 'recraft' | 'videography' | 'topaz' | 'heygen' | 'happyhorse' | 'pixverse' | 'anthropic' | 'async';
2020
+ type AppProvider = 'picsart' | 'google' | 'kling' | 'grok' | 'openai' | 'flux' | 'ideogram' | 'elevenlabs' | 'minimax' | 'wan' | 'seedance' | 'ltx' | 'seedream' | 'seedaudio' | 'hunyuan' | 'pika' | 'runway' | 'luma' | 'ovi' | 'creatify' | 'veed' | 'bytedance' | 'qwen' | 'reve' | 'recraft' | 'videography' | 'topaz' | 'heygen' | 'happyhorse' | 'pixverse' | 'anthropic' | 'async' | 'captionsai';
2017
2021
  /** Provider used by model definitions. */
2018
2022
  type Provider = AppProvider;
2019
2023
  /** App generation modes. */
@@ -2514,6 +2518,7 @@ declare const Models: {
2514
2518
  readonly BytedanceOmnihumanV15: "bytedance-omnihuman-v1.5";
2515
2519
  readonly BytedanceVideoEnhance: "bytedance-video-enhance";
2516
2520
  readonly BytedanceVideoUpscaler: "bytedance-video-upscaler";
2521
+ readonly CaptionsaiVideoCaptions: "captionsai-video-captions";
2517
2522
  readonly ClaudeHaiku45: "claude-haiku-4-5";
2518
2523
  readonly ClaudeOpus48: "claude-opus-4-8";
2519
2524
  readonly ClaudeSonnet46: "claude-sonnet-4-6";
package/index.js CHANGED
@@ -820,7 +820,8 @@ var providers = {
820
820
  happyhorse: { color: "#FF6A00", label: "HH", name: "Happy Horse" },
821
821
  pixverse: { color: "#7C3AED", label: "PV", name: "PixVerse" },
822
822
  anthropic: { color: "#D97757", label: "CL", name: "Anthropic" },
823
- async: { color: "#5E5CE6", label: "AA", name: "Async AI" }
823
+ async: { color: "#5E5CE6", label: "AA", name: "Async AI" },
824
+ captionsai: { color: "#1D1F20", label: "MR", name: "Mirage" }
824
825
  };
825
826
 
826
827
  // src/core/descriptors/presets.ts
@@ -1175,7 +1176,7 @@ var passthroughPayload = (paramConfig) => (ctx) => {
1175
1176
  return payload;
1176
1177
  };
1177
1178
  function defineModels(provider, configs) {
1178
- const MODELS37 = [];
1179
+ const MODELS38 = [];
1179
1180
  for (const c of configs) {
1180
1181
  const prov = c.provider ?? provider;
1181
1182
  const resolvedPayload = c.buildPayload ?? passthroughPayload(c.paramConfig);
@@ -1211,19 +1212,19 @@ function defineModels(provider, configs) {
1211
1212
  if (c.constraints !== void 0) model.constraints = c.constraints;
1212
1213
  const contract = createModelContract(model);
1213
1214
  model.outputSchema = c.outputSchema ?? contract.output;
1214
- MODELS37.push(model);
1215
+ MODELS38.push(model);
1215
1216
  }
1216
- return { MODELS: MODELS37 };
1217
+ return { MODELS: MODELS38 };
1217
1218
  }
1218
- function registerPayloads(MODELS37, payloads) {
1219
+ function registerPayloads(MODELS38, payloads) {
1219
1220
  for (const [id, builder] of Object.entries(payloads)) {
1220
- const model = MODELS37.find((m) => m.id === id);
1221
+ const model = MODELS38.find((m) => m.id === id);
1221
1222
  if (model) model.buildPayload = builder;
1222
1223
  }
1223
1224
  }
1224
- function registerEditPayloads(MODELS37, payloads) {
1225
+ function registerEditPayloads(MODELS38, payloads) {
1225
1226
  for (const [id, builder] of Object.entries(payloads)) {
1226
- const model = MODELS37.find((m) => m.id === id);
1227
+ const model = MODELS38.find((m) => m.id === id);
1227
1228
  if (model) model.buildEditPayload = builder;
1228
1229
  }
1229
1230
  }
@@ -8481,6 +8482,54 @@ registerPayloads(MODELS36, {
8481
8482
  "gemini-3.5-flash-lite": buildOpenAiPayload("gemini-3.5-flash-lite")
8482
8483
  });
8483
8484
 
8485
+ // src/vendors/catalog/captionsai.ts
8486
+ var CAPTIONS_MAX_DURATION_SEC = 300;
8487
+ var CAPTIONS_MAX_BYTES = 50 * 1024 * 1024;
8488
+ var DEFAULT_CAPTION_TEMPLATE_ID = "ctpl_DxflLOnuKkb198FNdI9E";
8489
+ var { MODELS: MODELS37 } = defineModels("captionsai", [
8490
+ {
8491
+ id: "captionsai-video-captions",
8492
+ name: "Captions",
8493
+ modelId: "mirage-captions",
8494
+ addedAt: "2026-08-27",
8495
+ workflow: "captionsai/v1/videos/captions",
8496
+ // ~26s measured for an 8s clip on the live API; scales with clip length.
8497
+ estimatedTime: 60,
8498
+ mode: "video",
8499
+ inputType: "v2v",
8500
+ // Stage-only until the worker is deployed to prod and the pricing record
8501
+ // (mirage-captions / video-to-video) exists — flip to production then.
8502
+ release: "preview",
8503
+ description: "Auto-transcribes a vertical video and burns in animated captions from 67 style templates \u2014 up to 5 minutes, 9:16.",
8504
+ features: [
8505
+ feat("Video Required", "input"),
8506
+ feat("9:16", "resolution"),
8507
+ feat("Up to 5 min", "duration"),
8508
+ feat("67 Templates", "style")
8509
+ ],
8510
+ paramConfig: {
8511
+ ...params.videoInput("Source Video", "asset", true, CAPTIONS_MAX_DURATION_SEC, void 0, CAPTIONS_MAX_BYTES),
8512
+ ...params.catalog("templateId", {
8513
+ label: "Caption Style",
8514
+ // Not `required`: the declared default fills it, and request validation runs
8515
+ // before the payload builder — a required flag would reject the very
8516
+ // calls the default exists for (same shape as Kling's effect templateId).
8517
+ source: { workflow: "captionsai/v1/catalog/caption-templates" },
8518
+ default: DEFAULT_CAPTION_TEMPLATE_ID
8519
+ })
8520
+ }
8521
+ }
8522
+ ]);
8523
+
8524
+ // src/vendors/catalog/captionsai.payloads.ts
8525
+ var buildCaptionsPayload = (input) => ({
8526
+ video: { url: input.videoUrl },
8527
+ caption_template_id: input.templateId ?? DEFAULT_CAPTION_TEMPLATE_ID
8528
+ });
8529
+ registerPayloads(MODELS37, {
8530
+ "captionsai-video-captions": buildCaptionsPayload
8531
+ });
8532
+
8484
8533
  // src/vendors/catalog/index.ts
8485
8534
  var ALL_MODELS = [
8486
8535
  ...MODELS,
@@ -8518,7 +8567,8 @@ var ALL_MODELS = [
8518
8567
  ...MODELS33,
8519
8568
  ...MODELS34,
8520
8569
  ...MODELS35,
8521
- ...MODELS36
8570
+ ...MODELS36,
8571
+ ...MODELS37
8522
8572
  ];
8523
8573
  var getModelsByMode = (mode, includeDisabled = false) => ALL_MODELS.filter((m) => m.mode === mode && (includeDisabled || isVisibleForReleases(m)));
8524
8574
 
@@ -10610,6 +10660,7 @@ var AsyncFlashV1 = "async-flash-v1";
10610
10660
  var BytedanceOmnihumanV15 = "bytedance-omnihuman-v1.5";
10611
10661
  var BytedanceVideoEnhance = "bytedance-video-enhance";
10612
10662
  var BytedanceVideoUpscaler = "bytedance-video-upscaler";
10663
+ var CaptionsaiVideoCaptions = "captionsai-video-captions";
10613
10664
  var ClaudeHaiku45 = "claude-haiku-4-5";
10614
10665
  var ClaudeOpus48 = "claude-opus-4-8";
10615
10666
  var ClaudeSonnet46 = "claude-sonnet-4-6";
@@ -10821,6 +10872,7 @@ var Models = {
10821
10872
  BytedanceOmnihumanV15,
10822
10873
  BytedanceVideoEnhance,
10823
10874
  BytedanceVideoUpscaler,
10875
+ CaptionsaiVideoCaptions,
10824
10876
  ClaudeHaiku45,
10825
10877
  ClaudeOpus48,
10826
10878
  ClaudeSonnet46,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "5.22.1",
3
+ "version": "5.23.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",