@picsart/ai-sdk 6.42.0 → 6.44.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 +43 -1
  2. package/index.js +174 -11
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -359,6 +359,15 @@ type ModelInputById = {
359
359
  imageUrls?: string[];
360
360
  safetyTolerance?: number;
361
361
  };
362
+ "flux-3-image-klein": {
363
+ prompt: string;
364
+ aspectRatio?: "auto" | "21:9" | "2:1" | "16:9" | "3:2" | "7:5" | "4:3" | "5:4" | "1:1" | "4:5" | "3:4" | "5:7" | "2:3" | "9:16" | "9:21" | "1:2";
365
+ resolution?: "768sq" | "1k" | "1.5k" | "2k" | "4k";
366
+ count?: 1 | 2 | 4 | 6 | 8 | 10;
367
+ imageUrls?: string[];
368
+ steps?: number;
369
+ safetyTolerance?: number;
370
+ };
362
371
  "flux-3-video": {
363
372
  prompt: string;
364
373
  aspectRatio?: "auto" | "21:9" | "2:1" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
@@ -1297,6 +1306,35 @@ type ModelInputById = {
1297
1306
  bitrate?: 32000 | 64000 | 128000 | 256000;
1298
1307
  format?: "mp3" | "wav" | "pcm";
1299
1308
  };
1309
+ "mirelo-sfx-2.0-text-to-audio": {
1310
+ prompt: string;
1311
+ negativePrompt?: string;
1312
+ duration?: number;
1313
+ count?: 1 | 2 | 3 | 4;
1314
+ format?: "wav" | "mp3" | "aac" | "flac";
1315
+ bitrateKbps?: number;
1316
+ seed?: number;
1317
+ };
1318
+ "mirelo-sfx-2.0-video-to-audio": {
1319
+ videoUrl: string;
1320
+ prompt?: string;
1321
+ negativePrompt?: string;
1322
+ preserveSpeech?: boolean;
1323
+ duration?: number;
1324
+ count?: 1 | 2 | 3 | 4;
1325
+ format?: "wav" | "mp3" | "aac" | "flac";
1326
+ bitrateKbps?: number;
1327
+ seed?: number;
1328
+ };
1329
+ "mirelo-sfx-2.0-video-to-video": {
1330
+ videoUrl: string;
1331
+ prompt?: string;
1332
+ negativePrompt?: string;
1333
+ preserveSpeech?: boolean;
1334
+ duration?: number;
1335
+ count?: 1 | 2 | 3 | 4;
1336
+ seed?: number;
1337
+ };
1300
1338
  "muse-image-1.0": {
1301
1339
  prompt: string;
1302
1340
  aspectRatio?: "1:1" | "3:2" | "2:3" | "16:9" | "9:16" | "4:3" | "3:4";
@@ -2532,7 +2570,7 @@ interface ModelFilter {
2532
2570
  release?: ReleaseTag[];
2533
2571
  }
2534
2572
 
2535
- 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' | 'meta' | 'typesafe' | 'depth-anything' | 'kimi';
2573
+ 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' | 'meta' | 'typesafe' | 'depth-anything' | 'kimi' | 'mirelo';
2536
2574
  /** Provider used by model definitions. */
2537
2575
  type Provider = AppProvider;
2538
2576
  /** App generation modes. `json` marks structured-output models (judges,
@@ -3534,6 +3572,7 @@ declare const Models: {
3534
3572
  readonly Flux2Max: "flux-2-max";
3535
3573
  readonly Flux2Pro: "flux-2-pro";
3536
3574
  readonly Flux3Image: "flux-3-image";
3575
+ readonly Flux3ImageKlein: "flux-3-image-klein";
3537
3576
  readonly Flux3Video: "flux-3-video";
3538
3577
  readonly FluxKontextMax: "flux-kontext-max";
3539
3578
  readonly FluxKontextPro: "flux-kontext-pro";
@@ -3654,6 +3693,9 @@ declare const Models: {
3654
3693
  readonly MinimaxH3MaxTurbo: "minimax-h3-max-turbo";
3655
3694
  readonly MinimaxMusicV2: "minimax-music-v2";
3656
3695
  readonly MinimaxMusicV3: "minimax-music-v3";
3696
+ readonly MireloSfx20TextToAudio: "mirelo-sfx-2.0-text-to-audio";
3697
+ readonly MireloSfx20VideoToAudio: "mirelo-sfx-2.0-video-to-audio";
3698
+ readonly MireloSfx20VideoToVideo: "mirelo-sfx-2.0-video-to-video";
3657
3699
  readonly MuseImage10: "muse-image-1.0";
3658
3700
  readonly Ovi: "ovi";
3659
3701
  readonly PicsartChangeBg: "picsart-change-bg";
package/index.js CHANGED
@@ -798,7 +798,8 @@ var providers = {
798
798
  meta: { color: "#0081FB", label: "MT", name: "Meta" },
799
799
  typesafe: { color: "#3E6B8F", label: "TS", name: "TypeSafe" },
800
800
  "depth-anything": { color: "#0EA5E9", label: "DA", name: "Depth Anything" },
801
- kimi: { color: "#1A1A2E", label: "KM", name: "Kimi" }
801
+ kimi: { color: "#1A1A2E", label: "KM", name: "Kimi" },
802
+ mirelo: { color: "#5C3DF5", label: "ML", name: "Mirelo" }
802
803
  };
803
804
 
804
805
  // src/core/descriptors/presets.ts
@@ -1176,7 +1177,7 @@ var passthroughPayload = (paramConfig) => (ctx) => {
1176
1177
  return payload;
1177
1178
  };
1178
1179
  function defineModels(provider, configs) {
1179
- const MODELS40 = [];
1180
+ const MODELS41 = [];
1180
1181
  for (const c of configs) {
1181
1182
  const prov = c.provider ?? provider;
1182
1183
  const resolvedPayload = c.buildPayload ?? passthroughPayload(c.paramConfig);
@@ -1213,19 +1214,19 @@ function defineModels(provider, configs) {
1213
1214
  if (c.validateInput !== void 0) model.validateInput = c.validateInput;
1214
1215
  const contract = createModelContract(model);
1215
1216
  model.outputSchema = c.outputSchema ?? contract.output;
1216
- MODELS40.push(model);
1217
+ MODELS41.push(model);
1217
1218
  }
1218
- return { MODELS: MODELS40 };
1219
+ return { MODELS: MODELS41 };
1219
1220
  }
1220
- function registerPayloads(MODELS40, payloads) {
1221
+ function registerPayloads(MODELS41, payloads) {
1221
1222
  for (const [id, builder] of Object.entries(payloads)) {
1222
- const model = MODELS40.find((m) => m.id === id);
1223
+ const model = MODELS41.find((m) => m.id === id);
1223
1224
  if (model) model.buildPayload = builder;
1224
1225
  }
1225
1226
  }
1226
- function registerEditPayloads(MODELS40, payloads) {
1227
+ function registerEditPayloads(MODELS41, payloads) {
1227
1228
  for (const [id, builder] of Object.entries(payloads)) {
1228
- const model = MODELS40.find((m) => m.id === id);
1229
+ const model = MODELS41.find((m) => m.id === id);
1229
1230
  if (model) model.buildEditPayload = builder;
1230
1231
  }
1231
1232
  }
@@ -6528,6 +6529,49 @@ var { MODELS: MODELS21 } = defineModels("flux", [
6528
6529
  ...p.range("safetyTolerance", 0, 4, 2, { label: "Safety Tolerance" })
6529
6530
  }
6530
6531
  },
6532
+ {
6533
+ // Distilled "Klein" tier of FLUX 3 Image. Same contract as flux-3-image —
6534
+ // a pure pass-through, since every Command field already carries the SDK's
6535
+ // unified name (prompt, imageUrls, aspectRatio, resolution, count,
6536
+ // safetyTolerance) — with two deltas: a `steps` knob (1–16 denoising steps
6537
+ // for the distilled model; fewer is faster and it does not affect cost) and
6538
+ // a wider safetyTolerance range (0–7 vs the 0–4 of flux-3-image). As with
6539
+ // flux-3-image, supplying imageUrls switches the vendor into editing mode
6540
+ // (hence inputType 't2i'), `version` pins the endpoint contract and is not
6541
+ // surfaced, and `options` is dropped.
6542
+ id: "flux-3-image-klein",
6543
+ name: "Flux 3 Image Klein",
6544
+ workflow: "bfl/v1/flux-3-image-klein",
6545
+ mode: "image",
6546
+ inputType: "t2i",
6547
+ addedAt: "2026-10-16",
6548
+ badge: ["fast"],
6549
+ // Klein is the distilled/low-step tier, so it generates faster than
6550
+ // flux-3-image. Reuse that model's per-tier map as a safe upper bound —
6551
+ // over-estimating only finishes the bar early; tighten once stage
6552
+ // measurements land.
6553
+ estimatedTime: { "768sq": 110, "1k": 150, "1.5k": 195, "2k": 240, "4k": 360 },
6554
+ description: "Distilled, faster FLUX 3 Image \u2014 generate and edit with up to 10 references, with a steps control to trade speed for detail, natively up to 4K.",
6555
+ features: [
6556
+ feat("Multi-Image Input", "input"),
6557
+ feat("4K", "resolution")
6558
+ ],
6559
+ paramConfig: {
6560
+ ...params.prompt(),
6561
+ ...params.aspectRatio(flux3ImageAspectRatios, "auto"),
6562
+ ...params.resolution(flux3ImageResolutions, "1k"),
6563
+ ...params.count(),
6564
+ // Up to 10 references; the first one drives the output ratio while
6565
+ // aspectRatio is 'auto'.
6566
+ ...params.imageInput(10, "Reference Images", false, "reference"),
6567
+ // Denoising steps for the distilled Klein model: 1 (fastest) … 16.
6568
+ // Vendor default is 16; does not affect cost (priced per resolution tier).
6569
+ ...p.range("steps", 1, 16, 16, { label: "Steps" }),
6570
+ // Moderation level: 0 (strict) … 7 (permissive). Wider than the 0–4 of
6571
+ // flux-3-image.
6572
+ ...p.range("safetyTolerance", 0, 7, 2, { label: "Safety Tolerance" })
6573
+ }
6574
+ },
6531
6575
  {
6532
6576
  // Single workflow `flux/v1/video` derives its mode from the input it's
6533
6577
  // given: none → t2v, keyframe images → i2v, a start video → v2v. No
@@ -6570,13 +6614,13 @@ var { MODELS: MODELS21 } = defineModels("flux", [
6570
6614
  // payload builder needed. webhookUrl is polling plumbing, not surfaced
6571
6615
  // (same as flux-3-video).
6572
6616
  id: "flux-video-upscale",
6573
- name: "Flux Video Upscale",
6617
+ name: "Flux 3 Video Upscale",
6574
6618
  workflow: "flux/v1/video-upscale",
6575
6619
  mode: "video",
6576
6620
  inputType: "v2v",
6577
6621
  addedAt: "2026-08-28",
6578
6622
  estimatedTime: 180,
6579
- description: "Upscale videos toward 4K (1.5x\u20133x) in precise (source-faithful) or creative (detail-enhancing) mode. Source clips up to 20 seconds and 2K.",
6623
+ description: "FLUX 3 powered video upscale toward 4K (1.5x\u20133x) in precise (source-faithful) or creative (detail-enhancing) mode. Source clips up to 20 seconds and 2K.",
6580
6624
  features: [
6581
6625
  feat("Upscale", "quality"),
6582
6626
  feat("Video Required", "input"),
@@ -11247,6 +11291,116 @@ registerPayloads(MODELS39, {
11247
11291
  "depth-anything-video": buildDepthAnythingVideoPayload
11248
11292
  });
11249
11293
 
11294
+ // src/vendors/catalog/mirelo.ts
11295
+ var FORMAT_OPTIONS = ["wav", "mp3", "aac", "flac"];
11296
+ var SAMPLE_OPTIONS = [1, 2, 3, 4];
11297
+ var bitrateKbps = {
11298
+ bitrateKbps: {
11299
+ label: "Audio Bitrate (kbps)",
11300
+ descriptor: { kind: "range", min: 32, max: 320, step: 1 }
11301
+ }
11302
+ };
11303
+ var { MODELS: MODELS40 } = defineModels("mirelo", [
11304
+ {
11305
+ id: "mirelo-sfx-2.0-text-to-audio",
11306
+ name: "Mirelo SFX 2.0 (Text to Audio)",
11307
+ addedAt: "2026-10-15",
11308
+ workflow: "mirelo-ai/sfx2.0/text-to-audio",
11309
+ estimatedTime: 15,
11310
+ mode: "audio",
11311
+ inputType: "t2a",
11312
+ description: "Generate sound effects and soundscapes from a text prompt with Mirelo SFX 2.0.",
11313
+ features: [feat("Text to Audio", "characteristic"), feat("Sound Effects", "audio")],
11314
+ paramConfig: {
11315
+ ...params.prompt({ maxLength: 2e3 }),
11316
+ ...params.negativePrompt(void 0, 1e3),
11317
+ ...params.durationRange(1, 600, 30),
11318
+ ...params.count(SAMPLE_OPTIONS, 2),
11319
+ ...p.enum("format", [...FORMAT_OPTIONS], "wav", { label: "Format" }),
11320
+ ...bitrateKbps,
11321
+ ...params.seed()
11322
+ }
11323
+ },
11324
+ {
11325
+ id: "mirelo-sfx-2.0-video-to-audio",
11326
+ name: "Mirelo SFX 2.0 (Video to Audio)",
11327
+ addedAt: "2026-10-15",
11328
+ workflow: "mirelo-ai/sfx2.0/video-to-audio",
11329
+ estimatedTime: 20,
11330
+ mode: "audio",
11331
+ inputType: "v2a",
11332
+ description: "Generate a soundtrack synced to your video with Mirelo SFX 2.0 \u2014 returns the audio track.",
11333
+ features: [feat("Video to Audio", "characteristic"), feat("Video Required", "input"), feat("Sound Effects", "audio")],
11334
+ paramConfig: {
11335
+ ...params.videoInput("Source Video", "asset", true),
11336
+ ...params.prompt({ required: false, maxLength: 2e3 }),
11337
+ ...params.negativePrompt(void 0, 1e3),
11338
+ ...p.boolean("preserveSpeech", true, "Preserve Speech"),
11339
+ ...params.durationRange(1, 600, 10),
11340
+ ...params.count(SAMPLE_OPTIONS, 2),
11341
+ ...p.enum("format", [...FORMAT_OPTIONS], "wav", { label: "Format" }),
11342
+ ...bitrateKbps,
11343
+ ...params.seed()
11344
+ }
11345
+ },
11346
+ {
11347
+ id: "mirelo-sfx-2.0-video-to-video",
11348
+ name: "Mirelo SFX 2.0 (Video to Video)",
11349
+ addedAt: "2026-10-15",
11350
+ workflow: "mirelo-ai/sfx2.0/video-to-video",
11351
+ estimatedTime: 30,
11352
+ mode: "video",
11353
+ inputType: "v2v",
11354
+ description: "Add a synced soundtrack to your video with Mirelo SFX 2.0 \u2014 returns the video with its new audio.",
11355
+ features: [feat("Video to Video", "characteristic"), feat("Video Required", "input"), feat("Synced Soundtrack", "audio")],
11356
+ paramConfig: {
11357
+ ...params.videoInput("Source Video", "asset", true),
11358
+ ...params.prompt({ required: false, maxLength: 2e3 }),
11359
+ ...params.negativePrompt(void 0, 1e3),
11360
+ ...p.boolean("preserveSpeech", true, "Preserve Speech"),
11361
+ ...params.durationRange(1, 600, 10),
11362
+ ...params.count(SAMPLE_OPTIONS, 2),
11363
+ ...params.seed()
11364
+ }
11365
+ }
11366
+ ]);
11367
+
11368
+ // src/vendors/catalog/mirelo.payloads.ts
11369
+ var buildTextToAudioPayload = (input) => ({
11370
+ prompt: input.prompt,
11371
+ duration: input.duration ?? 30,
11372
+ num_samples: input.count ?? 2,
11373
+ upload_audio_format: input.format ?? "wav",
11374
+ ...input.negativePrompt != null ? { negative_prompt: input.negativePrompt } : {},
11375
+ ...input.bitrateKbps != null ? { upload_audio_bitrate_kbps: input.bitrateKbps } : {},
11376
+ ...input.seed != null ? { seed: input.seed } : {}
11377
+ });
11378
+ var buildVideoToAudioPayload = (input) => ({
11379
+ video_url: input.videoUrl,
11380
+ preserve_speech: input.preserveSpeech ?? true,
11381
+ duration: input.duration ?? 10,
11382
+ num_samples: input.count ?? 2,
11383
+ upload_audio_format: input.format ?? "wav",
11384
+ ...input.prompt != null ? { text_prompt: input.prompt } : {},
11385
+ ...input.negativePrompt != null ? { negative_prompt: input.negativePrompt } : {},
11386
+ ...input.bitrateKbps != null ? { upload_audio_bitrate_kbps: input.bitrateKbps } : {},
11387
+ ...input.seed != null ? { seed: input.seed } : {}
11388
+ });
11389
+ var buildVideoToVideoPayload = (input) => ({
11390
+ video_url: input.videoUrl,
11391
+ preserve_speech: input.preserveSpeech ?? true,
11392
+ duration: input.duration ?? 10,
11393
+ num_samples: input.count ?? 2,
11394
+ ...input.prompt != null ? { text_prompt: input.prompt } : {},
11395
+ ...input.negativePrompt != null ? { negative_prompt: input.negativePrompt } : {},
11396
+ ...input.seed != null ? { seed: input.seed } : {}
11397
+ });
11398
+ registerPayloads(MODELS40, {
11399
+ "mirelo-sfx-2.0-text-to-audio": buildTextToAudioPayload,
11400
+ "mirelo-sfx-2.0-video-to-audio": buildVideoToAudioPayload,
11401
+ "mirelo-sfx-2.0-video-to-video": buildVideoToVideoPayload
11402
+ });
11403
+
11250
11404
  // src/vendors/catalog/creatify.payloads.ts
11251
11405
  var buildCreatifyBorealPayload = (input) => ({
11252
11406
  prompt: input.prompt,
@@ -11412,7 +11566,8 @@ var ALL_MODELS = [
11412
11566
  ...MODELS36,
11413
11567
  ...MODELS37,
11414
11568
  ...MODELS38,
11415
- ...MODELS39
11569
+ ...MODELS39,
11570
+ ...MODELS40
11416
11571
  ];
11417
11572
  var getModelsByMode = (mode, includeHidden = false) => ALL_MODELS.filter((m) => m.mode === mode && (includeHidden || isVisibleForReleases(m)));
11418
11573
 
@@ -14977,6 +15132,7 @@ var Flux2Flex = "flux-2-flex";
14977
15132
  var Flux2Max = "flux-2-max";
14978
15133
  var Flux2Pro = "flux-2-pro";
14979
15134
  var Flux3Image = "flux-3-image";
15135
+ var Flux3ImageKlein = "flux-3-image-klein";
14980
15136
  var Flux3Video = "flux-3-video";
14981
15137
  var FluxKontextMax = "flux-kontext-max";
14982
15138
  var FluxKontextPro = "flux-kontext-pro";
@@ -15097,6 +15253,9 @@ var MinimaxH3MaxRelight = "minimax-h3-max-relight";
15097
15253
  var MinimaxH3MaxTurbo = "minimax-h3-max-turbo";
15098
15254
  var MinimaxMusicV2 = "minimax-music-v2";
15099
15255
  var MinimaxMusicV3 = "minimax-music-v3";
15256
+ var MireloSfx20TextToAudio = "mirelo-sfx-2.0-text-to-audio";
15257
+ var MireloSfx20VideoToAudio = "mirelo-sfx-2.0-video-to-audio";
15258
+ var MireloSfx20VideoToVideo = "mirelo-sfx-2.0-video-to-video";
15100
15259
  var MuseImage10 = "muse-image-1.0";
15101
15260
  var Ovi = "ovi";
15102
15261
  var PicsartChangeBg = "picsart-change-bg";
@@ -15244,6 +15403,7 @@ var Models = {
15244
15403
  Flux2Max,
15245
15404
  Flux2Pro,
15246
15405
  Flux3Image,
15406
+ Flux3ImageKlein,
15247
15407
  Flux3Video,
15248
15408
  FluxKontextMax,
15249
15409
  FluxKontextPro,
@@ -15364,6 +15524,9 @@ var Models = {
15364
15524
  MinimaxH3MaxTurbo,
15365
15525
  MinimaxMusicV2,
15366
15526
  MinimaxMusicV3,
15527
+ MireloSfx20TextToAudio,
15528
+ MireloSfx20VideoToAudio,
15529
+ MireloSfx20VideoToVideo,
15367
15530
  MuseImage10,
15368
15531
  Ovi,
15369
15532
  PicsartChangeBg,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "6.42.0",
3
+ "version": "6.44.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",