@picsart/ai-sdk 6.41.0 → 6.43.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 +46 -1
  2. package/index.js +216 -17
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -650,6 +650,8 @@ type ModelInputById = {
650
650
  "gpt-image-2.5-flare": {
651
651
  prompt: string;
652
652
  aspectRatio?: "1:1" | "3:2" | "2:3" | "16:9" | "9:16" | "4:3" | "3:4" | "auto";
653
+ resolution?: "1K" | "2K" | "4K";
654
+ size?: string;
653
655
  quality?: "max" | "xhigh" | "high" | "medium" | "low";
654
656
  background?: "opaque" | "transparent";
655
657
  outputFormat?: "png" | "jpeg" | "webp";
@@ -659,6 +661,8 @@ type ModelInputById = {
659
661
  "gpt-image-2.5-sunburst": {
660
662
  prompt: string;
661
663
  aspectRatio?: "1:1" | "3:2" | "2:3" | "16:9" | "9:16" | "4:3" | "3:4" | "auto";
664
+ resolution?: "1K" | "2K" | "4K";
665
+ size?: string;
662
666
  quality?: "max" | "xhigh" | "high" | "medium" | "low";
663
667
  background?: "opaque" | "transparent";
664
668
  outputFormat?: "png" | "jpeg" | "webp";
@@ -1293,6 +1297,35 @@ type ModelInputById = {
1293
1297
  bitrate?: 32000 | 64000 | 128000 | 256000;
1294
1298
  format?: "mp3" | "wav" | "pcm";
1295
1299
  };
1300
+ "mirelo-sfx-2.0-text-to-audio": {
1301
+ prompt: string;
1302
+ negativePrompt?: string;
1303
+ duration?: number;
1304
+ count?: 1 | 2 | 3 | 4;
1305
+ format?: "wav" | "mp3" | "aac" | "flac";
1306
+ bitrateKbps?: number;
1307
+ seed?: number;
1308
+ };
1309
+ "mirelo-sfx-2.0-video-to-audio": {
1310
+ videoUrl: string;
1311
+ prompt?: string;
1312
+ negativePrompt?: string;
1313
+ preserveSpeech?: boolean;
1314
+ duration?: number;
1315
+ count?: 1 | 2 | 3 | 4;
1316
+ format?: "wav" | "mp3" | "aac" | "flac";
1317
+ bitrateKbps?: number;
1318
+ seed?: number;
1319
+ };
1320
+ "mirelo-sfx-2.0-video-to-video": {
1321
+ videoUrl: string;
1322
+ prompt?: string;
1323
+ negativePrompt?: string;
1324
+ preserveSpeech?: boolean;
1325
+ duration?: number;
1326
+ count?: 1 | 2 | 3 | 4;
1327
+ seed?: number;
1328
+ };
1296
1329
  "muse-image-1.0": {
1297
1330
  prompt: string;
1298
1331
  aspectRatio?: "1:1" | "3:2" | "2:3" | "16:9" | "9:16" | "4:3" | "3:4";
@@ -2528,7 +2561,7 @@ interface ModelFilter {
2528
2561
  release?: ReleaseTag[];
2529
2562
  }
2530
2563
 
2531
- 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';
2564
+ 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';
2532
2565
  /** Provider used by model definitions. */
2533
2566
  type Provider = AppProvider;
2534
2567
  /** App generation modes. `json` marks structured-output models (judges,
@@ -2646,6 +2679,8 @@ interface GenerationContext {
2646
2679
  /** Qwen 3.0 family — thinking mode (requires prompt_extend), sent as `enable_thinking`. */
2647
2680
  enableThinking?: boolean;
2648
2681
  }
2682
+ /** See `ModelDefinition.validateInput`. */
2683
+ type InputValidator = (input: Record<string, unknown>) => void;
2649
2684
  type PayloadBuilder<TContext extends GenerationContext = GenerationContext> = (ctx: TContext) => object;
2650
2685
  /** Lightweight runtime schema contract used by SDK integrations. */
2651
2686
  interface RuntimeSchema<T = unknown> {
@@ -2736,6 +2771,13 @@ interface ModelDefinition {
2736
2771
  paramConfig: ModelParams;
2737
2772
  /** Declarative inter-parameter constraints (e.g. "1080p requires 8s duration"). */
2738
2773
  constraints?: Constraint[];
2774
+ /**
2775
+ * Model-specific input check that the declarative layer cannot express —
2776
+ * a value format, or a "this OR those, never both" rule. Runs after the
2777
+ * per-param and constraint validation, on the raw input (no defaults
2778
+ * merged), and throws an `Error` whose message names the offending param.
2779
+ */
2780
+ validateInput?: InputValidator;
2739
2781
  /** Payload builder. Optional — omit for pass-through (param values sent as-is). */
2740
2782
  buildPayload?: PayloadBuilder;
2741
2783
  /** I2V/edit payload builder when different from buildPayload. */
@@ -3641,6 +3683,9 @@ declare const Models: {
3641
3683
  readonly MinimaxH3MaxTurbo: "minimax-h3-max-turbo";
3642
3684
  readonly MinimaxMusicV2: "minimax-music-v2";
3643
3685
  readonly MinimaxMusicV3: "minimax-music-v3";
3686
+ readonly MireloSfx20TextToAudio: "mirelo-sfx-2.0-text-to-audio";
3687
+ readonly MireloSfx20VideoToAudio: "mirelo-sfx-2.0-video-to-audio";
3688
+ readonly MireloSfx20VideoToVideo: "mirelo-sfx-2.0-video-to-video";
3644
3689
  readonly MuseImage10: "muse-image-1.0";
3645
3690
  readonly Ovi: "ovi";
3646
3691
  readonly PicsartChangeBg: "picsart-change-bg";
package/index.js CHANGED
@@ -591,7 +591,7 @@ function validateDescriptor(key, d, val, required) {
591
591
  function isAbsent(val) {
592
592
  return val == null || typeof val === "string" && val.trim().length === 0 || Array.isArray(val) && val.length === 0;
593
593
  }
594
- function validateAll(params2, input, constraints) {
594
+ function validateAll(params2, input, constraints, validateInput) {
595
595
  for (const [key, entry] of Object.entries(params2)) {
596
596
  validateDescriptor(key, entry.descriptor, input[key], entry.required);
597
597
  }
@@ -600,6 +600,7 @@ function validateAll(params2, input, constraints) {
600
600
  throw new Error(requirement.reason ? `"${key}" is required: ${requirement.reason}` : `"${key}" is required`);
601
601
  }
602
602
  }
603
+ validateInput?.(input);
603
604
  }
604
605
  function descriptorsToSchema(params2) {
605
606
  const schema = {};
@@ -797,7 +798,8 @@ var providers = {
797
798
  meta: { color: "#0081FB", label: "MT", name: "Meta" },
798
799
  typesafe: { color: "#3E6B8F", label: "TS", name: "TypeSafe" },
799
800
  "depth-anything": { color: "#0EA5E9", label: "DA", name: "Depth Anything" },
800
- kimi: { color: "#1A1A2E", label: "KM", name: "Kimi" }
801
+ kimi: { color: "#1A1A2E", label: "KM", name: "Kimi" },
802
+ mirelo: { color: "#5C3DF5", label: "ML", name: "Mirelo" }
801
803
  };
802
804
 
803
805
  // src/core/descriptors/presets.ts
@@ -1175,7 +1177,7 @@ var passthroughPayload = (paramConfig) => (ctx) => {
1175
1177
  return payload;
1176
1178
  };
1177
1179
  function defineModels(provider, configs) {
1178
- const MODELS40 = [];
1180
+ const MODELS41 = [];
1179
1181
  for (const c of configs) {
1180
1182
  const prov = c.provider ?? provider;
1181
1183
  const resolvedPayload = c.buildPayload ?? passthroughPayload(c.paramConfig);
@@ -1209,21 +1211,22 @@ function defineModels(provider, configs) {
1209
1211
  if (c.release !== void 0) model.release = c.release;
1210
1212
  if (c.modelId !== void 0) model.modelId = c.modelId;
1211
1213
  if (c.constraints !== void 0) model.constraints = c.constraints;
1214
+ if (c.validateInput !== void 0) model.validateInput = c.validateInput;
1212
1215
  const contract = createModelContract(model);
1213
1216
  model.outputSchema = c.outputSchema ?? contract.output;
1214
- MODELS40.push(model);
1217
+ MODELS41.push(model);
1215
1218
  }
1216
- return { MODELS: MODELS40 };
1219
+ return { MODELS: MODELS41 };
1217
1220
  }
1218
- function registerPayloads(MODELS40, payloads) {
1221
+ function registerPayloads(MODELS41, payloads) {
1219
1222
  for (const [id, builder] of Object.entries(payloads)) {
1220
- const model = MODELS40.find((m) => m.id === id);
1223
+ const model = MODELS41.find((m) => m.id === id);
1221
1224
  if (model) model.buildPayload = builder;
1222
1225
  }
1223
1226
  }
1224
- function registerEditPayloads(MODELS40, payloads) {
1227
+ function registerEditPayloads(MODELS41, payloads) {
1225
1228
  for (const [id, builder] of Object.entries(payloads)) {
1226
- const model = MODELS40.find((m) => m.id === id);
1229
+ const model = MODELS41.find((m) => m.id === id);
1227
1230
  if (model) model.buildEditPayload = builder;
1228
1231
  }
1229
1232
  }
@@ -7155,6 +7158,54 @@ var GPT_IMAGE_2_AR_TO_SIZE = {
7155
7158
  "4:3": "1360x1024",
7156
7159
  "3:4": "1024x1360"
7157
7160
  };
7161
+ var GPT_IMAGE_25_SIZES = {
7162
+ "1K": GPT_IMAGE_2_AR_TO_SIZE,
7163
+ "2K": {
7164
+ "1:1": "2048x2048",
7165
+ "3:2": "2496x1664",
7166
+ "2:3": "1664x2496",
7167
+ "16:9": "2560x1440",
7168
+ "9:16": "1440x2560",
7169
+ "4:3": "2304x1728",
7170
+ "3:4": "1728x2304"
7171
+ },
7172
+ "4K": {
7173
+ "1:1": "2880x2880",
7174
+ "3:2": "3504x2336",
7175
+ "2:3": "2336x3504",
7176
+ "16:9": "3840x2160",
7177
+ "9:16": "2160x3840",
7178
+ "4:3": "3264x2448",
7179
+ "3:4": "2448x3264"
7180
+ }
7181
+ };
7182
+ var GPT_IMAGE_SIZE_PATTERN = /^([1-9]\d*)x([1-9]\d*)$/;
7183
+ var GPT_IMAGE_SIZE_GRID = 16;
7184
+ var GPT_IMAGE_MAX_ASPECT_RATIO = 3;
7185
+ var GPT_IMAGE_MAX_EDGE = 3840;
7186
+ var GPT_IMAGE_MIN_PIXELS = 655360;
7187
+ var GPT_IMAGE_MAX_PIXELS = 8294400;
7188
+ function gptImageSizeViolation(size) {
7189
+ const match = GPT_IMAGE_SIZE_PATTERN.exec(size);
7190
+ if (!match) return "must be WIDTHxHEIGHT, e.g. 2048x1152";
7191
+ const width = Number(match[1]);
7192
+ const height = Number(match[2]);
7193
+ if (width % GPT_IMAGE_SIZE_GRID !== 0 || height % GPT_IMAGE_SIZE_GRID !== 0) {
7194
+ return `both dimensions must be divisible by ${GPT_IMAGE_SIZE_GRID}`;
7195
+ }
7196
+ const ratio = width / height;
7197
+ if (ratio > GPT_IMAGE_MAX_ASPECT_RATIO || ratio < 1 / GPT_IMAGE_MAX_ASPECT_RATIO) {
7198
+ return "the aspect ratio must be between 1:3 and 3:1";
7199
+ }
7200
+ if (Math.max(width, height) > GPT_IMAGE_MAX_EDGE) {
7201
+ return `the longest edge must be at most ${GPT_IMAGE_MAX_EDGE}`;
7202
+ }
7203
+ const pixels = width * height;
7204
+ if (pixels < GPT_IMAGE_MIN_PIXELS || pixels > GPT_IMAGE_MAX_PIXELS) {
7205
+ return `the total pixel count must be between ${GPT_IMAGE_MIN_PIXELS} and ${GPT_IMAGE_MAX_PIXELS}`;
7206
+ }
7207
+ return null;
7208
+ }
7158
7209
  var buildGptImage1Payload = (ctx) => ({
7159
7210
  prompt: ctx.prompt,
7160
7211
  model: "gpt-image-1",
@@ -7219,6 +7270,7 @@ var buildGptImage2EditPayload = (ctx) => ({
7219
7270
  var GPT_IMAGE_PROMPT_MAX = 32e3;
7220
7271
  var GPT_IMAGE_25_QUALITIES = ["max", "xhigh", "high", "medium", "low"];
7221
7272
  var GPT_IMAGE_25_ASPECT_RATIOS = ["1:1", "3:2", "2:3", "16:9", "9:16", "4:3", "3:4", "auto"];
7273
+ var GPT_IMAGE_25_RESOLUTIONS = Object.keys(GPT_IMAGE_25_SIZES);
7222
7274
  var GPT_IMAGE_25_MAX_INPUT_IMAGES = 16;
7223
7275
  var gptImage2Constraints = [
7224
7276
  {
@@ -7236,6 +7288,25 @@ var gptImageBgConstraints = [
7236
7288
  then: { outputFormat: { allowed: ["png", "webp"], reason: "Transparent background needs PNG or WEBP \u2014 JPEG has no alpha channel." } }
7237
7289
  }
7238
7290
  ];
7291
+ var gptImage25SizeConstraints = [
7292
+ {
7293
+ when: { size: { exists: true } },
7294
+ then: {
7295
+ aspectRatio: { disabled: true, reason: "A custom size sets the output size." },
7296
+ resolution: { disabled: true, reason: "A custom size sets the output size." }
7297
+ }
7298
+ },
7299
+ {
7300
+ when: { aspectRatio: { is: "auto" } },
7301
+ then: { resolution: { disabled: true, reason: "Auto lets the model pick the size." } }
7302
+ }
7303
+ ];
7304
+ var isGiven = (value) => value != null && !(typeof value === "string" && value.trim().length === 0);
7305
+ var validateGptImage25Input = (input) => {
7306
+ if (!isGiven(input.size)) return;
7307
+ const violation = gptImageSizeViolation(String(input.size).trim());
7308
+ if (violation) throw new Error(`"size" ${violation}`);
7309
+ };
7239
7310
  var { MODELS: MODELS23 } = defineModels("openai", [
7240
7311
  // ── Image ─────────────────────────────────────────
7241
7312
  {
@@ -7252,13 +7323,16 @@ var { MODELS: MODELS23 } = defineModels("openai", [
7252
7323
  paramConfig: {
7253
7324
  ...params.prompt({ maxLength: GPT_IMAGE_PROMPT_MAX }),
7254
7325
  ...params.aspectRatio(GPT_IMAGE_25_ASPECT_RATIOS, "1:1"),
7326
+ ...params.resolution(GPT_IMAGE_25_RESOLUTIONS, "1K"),
7327
+ ...p.text("size", { label: "Custom Size", placeholder: "WIDTHxHEIGHT, e.g. 2048x1152" }),
7255
7328
  ...p.quality(GPT_IMAGE_25_QUALITIES, "high"),
7256
7329
  ...p.enum("background", ["opaque", "transparent"], "opaque", { label: "Background" }),
7257
7330
  ...p.enum("outputFormat", ["png", "jpeg", "webp"], "png", { label: "Format" }),
7258
7331
  ...params.count(),
7259
7332
  ...params.imageInput(GPT_IMAGE_25_MAX_INPUT_IMAGES, "Source Images")
7260
7333
  },
7261
- constraints: gptImageBgConstraints
7334
+ constraints: [...gptImageBgConstraints, ...gptImage25SizeConstraints],
7335
+ validateInput: validateGptImage25Input
7262
7336
  },
7263
7337
  {
7264
7338
  id: "gpt-image-2.5-flare",
@@ -7274,13 +7348,16 @@ var { MODELS: MODELS23 } = defineModels("openai", [
7274
7348
  paramConfig: {
7275
7349
  ...params.prompt({ maxLength: GPT_IMAGE_PROMPT_MAX }),
7276
7350
  ...params.aspectRatio(GPT_IMAGE_25_ASPECT_RATIOS, "1:1"),
7351
+ ...params.resolution(GPT_IMAGE_25_RESOLUTIONS, "1K"),
7352
+ ...p.text("size", { label: "Custom Size", placeholder: "WIDTHxHEIGHT, e.g. 2048x1152" }),
7277
7353
  ...p.quality(GPT_IMAGE_25_QUALITIES, "high"),
7278
7354
  ...p.enum("background", ["opaque", "transparent"], "opaque", { label: "Background" }),
7279
7355
  ...p.enum("outputFormat", ["png", "jpeg", "webp"], "png", { label: "Format" }),
7280
7356
  ...params.count(),
7281
7357
  ...params.imageInput(GPT_IMAGE_25_MAX_INPUT_IMAGES, "Source Images")
7282
7358
  },
7283
- constraints: gptImageBgConstraints
7359
+ constraints: [...gptImageBgConstraints, ...gptImage25SizeConstraints],
7360
+ validateInput: validateGptImage25Input
7284
7361
  },
7285
7362
  {
7286
7363
  id: "gpt-image-2",
@@ -7363,12 +7440,17 @@ var { MODELS: MODELS23 } = defineModels("openai", [
7363
7440
  ]);
7364
7441
 
7365
7442
  // src/vendors/catalog/openai.payloads.ts
7366
- var resolveSize = (aspectRatio, fallback) => aspectRatio === "auto" ? "auto" : GPT_IMAGE_2_AR_TO_SIZE[aspectRatio ?? ""] ?? fallback;
7443
+ var resolveSize = (input, defaultAspectRatio) => {
7444
+ if (input.size?.trim()) return input.size.trim();
7445
+ const aspectRatio = input.aspectRatio ?? defaultAspectRatio;
7446
+ if (aspectRatio === "auto") return "auto";
7447
+ return GPT_IMAGE_25_SIZES[input.resolution ?? "1K"]?.[aspectRatio] ?? "1024x1024";
7448
+ };
7367
7449
  var generateFor = (model) => (input) => ({
7368
7450
  prompt: input.prompt,
7369
7451
  model,
7370
7452
  n: input.count ?? 1,
7371
- size: resolveSize(input.aspectRatio, "1024x1024"),
7453
+ size: resolveSize(input, "1:1"),
7372
7454
  quality: input.quality ?? "high",
7373
7455
  ...input.background ? { background: input.background } : {},
7374
7456
  ...input.outputFormat ? { output_format: input.outputFormat } : {}
@@ -7378,7 +7460,7 @@ var editFor = (model) => (input) => ({
7378
7460
  model,
7379
7461
  images: input.imageUrls ?? [],
7380
7462
  n: input.count ?? 1,
7381
- size: resolveSize(input.aspectRatio, "auto"),
7463
+ size: resolveSize(input, "auto"),
7382
7464
  quality: input.quality ?? "high",
7383
7465
  ...input.background ? { background: input.background } : {},
7384
7466
  ...input.outputFormat ? { output_format: input.outputFormat } : {}
@@ -11166,6 +11248,116 @@ registerPayloads(MODELS39, {
11166
11248
  "depth-anything-video": buildDepthAnythingVideoPayload
11167
11249
  });
11168
11250
 
11251
+ // src/vendors/catalog/mirelo.ts
11252
+ var FORMAT_OPTIONS = ["wav", "mp3", "aac", "flac"];
11253
+ var SAMPLE_OPTIONS = [1, 2, 3, 4];
11254
+ var bitrateKbps = {
11255
+ bitrateKbps: {
11256
+ label: "Audio Bitrate (kbps)",
11257
+ descriptor: { kind: "range", min: 32, max: 320, step: 1 }
11258
+ }
11259
+ };
11260
+ var { MODELS: MODELS40 } = defineModels("mirelo", [
11261
+ {
11262
+ id: "mirelo-sfx-2.0-text-to-audio",
11263
+ name: "Mirelo SFX 2.0 (Text to Audio)",
11264
+ addedAt: "2026-10-15",
11265
+ workflow: "mirelo-ai/sfx2.0/text-to-audio",
11266
+ estimatedTime: 15,
11267
+ mode: "audio",
11268
+ inputType: "t2a",
11269
+ description: "Generate sound effects and soundscapes from a text prompt with Mirelo SFX 2.0.",
11270
+ features: [feat("Text to Audio", "characteristic"), feat("Sound Effects", "audio")],
11271
+ paramConfig: {
11272
+ ...params.prompt({ maxLength: 2e3 }),
11273
+ ...params.negativePrompt(void 0, 1e3),
11274
+ ...params.durationRange(1, 600, 30),
11275
+ ...params.count(SAMPLE_OPTIONS, 2),
11276
+ ...p.enum("format", [...FORMAT_OPTIONS], "wav", { label: "Format" }),
11277
+ ...bitrateKbps,
11278
+ ...params.seed()
11279
+ }
11280
+ },
11281
+ {
11282
+ id: "mirelo-sfx-2.0-video-to-audio",
11283
+ name: "Mirelo SFX 2.0 (Video to Audio)",
11284
+ addedAt: "2026-10-15",
11285
+ workflow: "mirelo-ai/sfx2.0/video-to-audio",
11286
+ estimatedTime: 20,
11287
+ mode: "audio",
11288
+ inputType: "v2a",
11289
+ description: "Generate a soundtrack synced to your video with Mirelo SFX 2.0 \u2014 returns the audio track.",
11290
+ features: [feat("Video to Audio", "characteristic"), feat("Video Required", "input"), feat("Sound Effects", "audio")],
11291
+ paramConfig: {
11292
+ ...params.videoInput("Source Video", "asset", true),
11293
+ ...params.prompt({ required: false, maxLength: 2e3 }),
11294
+ ...params.negativePrompt(void 0, 1e3),
11295
+ ...p.boolean("preserveSpeech", true, "Preserve Speech"),
11296
+ ...params.durationRange(1, 600, 10),
11297
+ ...params.count(SAMPLE_OPTIONS, 2),
11298
+ ...p.enum("format", [...FORMAT_OPTIONS], "wav", { label: "Format" }),
11299
+ ...bitrateKbps,
11300
+ ...params.seed()
11301
+ }
11302
+ },
11303
+ {
11304
+ id: "mirelo-sfx-2.0-video-to-video",
11305
+ name: "Mirelo SFX 2.0 (Video to Video)",
11306
+ addedAt: "2026-10-15",
11307
+ workflow: "mirelo-ai/sfx2.0/video-to-video",
11308
+ estimatedTime: 30,
11309
+ mode: "video",
11310
+ inputType: "v2v",
11311
+ description: "Add a synced soundtrack to your video with Mirelo SFX 2.0 \u2014 returns the video with its new audio.",
11312
+ features: [feat("Video to Video", "characteristic"), feat("Video Required", "input"), feat("Synced Soundtrack", "audio")],
11313
+ paramConfig: {
11314
+ ...params.videoInput("Source Video", "asset", true),
11315
+ ...params.prompt({ required: false, maxLength: 2e3 }),
11316
+ ...params.negativePrompt(void 0, 1e3),
11317
+ ...p.boolean("preserveSpeech", true, "Preserve Speech"),
11318
+ ...params.durationRange(1, 600, 10),
11319
+ ...params.count(SAMPLE_OPTIONS, 2),
11320
+ ...params.seed()
11321
+ }
11322
+ }
11323
+ ]);
11324
+
11325
+ // src/vendors/catalog/mirelo.payloads.ts
11326
+ var buildTextToAudioPayload = (input) => ({
11327
+ prompt: input.prompt,
11328
+ duration: input.duration ?? 30,
11329
+ num_samples: input.count ?? 2,
11330
+ upload_audio_format: input.format ?? "wav",
11331
+ ...input.negativePrompt != null ? { negative_prompt: input.negativePrompt } : {},
11332
+ ...input.bitrateKbps != null ? { upload_audio_bitrate_kbps: input.bitrateKbps } : {},
11333
+ ...input.seed != null ? { seed: input.seed } : {}
11334
+ });
11335
+ var buildVideoToAudioPayload = (input) => ({
11336
+ video_url: input.videoUrl,
11337
+ preserve_speech: input.preserveSpeech ?? true,
11338
+ duration: input.duration ?? 10,
11339
+ num_samples: input.count ?? 2,
11340
+ upload_audio_format: input.format ?? "wav",
11341
+ ...input.prompt != null ? { text_prompt: input.prompt } : {},
11342
+ ...input.negativePrompt != null ? { negative_prompt: input.negativePrompt } : {},
11343
+ ...input.bitrateKbps != null ? { upload_audio_bitrate_kbps: input.bitrateKbps } : {},
11344
+ ...input.seed != null ? { seed: input.seed } : {}
11345
+ });
11346
+ var buildVideoToVideoPayload = (input) => ({
11347
+ video_url: input.videoUrl,
11348
+ preserve_speech: input.preserveSpeech ?? true,
11349
+ duration: input.duration ?? 10,
11350
+ num_samples: input.count ?? 2,
11351
+ ...input.prompt != null ? { text_prompt: input.prompt } : {},
11352
+ ...input.negativePrompt != null ? { negative_prompt: input.negativePrompt } : {},
11353
+ ...input.seed != null ? { seed: input.seed } : {}
11354
+ });
11355
+ registerPayloads(MODELS40, {
11356
+ "mirelo-sfx-2.0-text-to-audio": buildTextToAudioPayload,
11357
+ "mirelo-sfx-2.0-video-to-audio": buildVideoToAudioPayload,
11358
+ "mirelo-sfx-2.0-video-to-video": buildVideoToVideoPayload
11359
+ });
11360
+
11169
11361
  // src/vendors/catalog/creatify.payloads.ts
11170
11362
  var buildCreatifyBorealPayload = (input) => ({
11171
11363
  prompt: input.prompt,
@@ -11331,7 +11523,8 @@ var ALL_MODELS = [
11331
11523
  ...MODELS36,
11332
11524
  ...MODELS37,
11333
11525
  ...MODELS38,
11334
- ...MODELS39
11526
+ ...MODELS39,
11527
+ ...MODELS40
11335
11528
  ];
11336
11529
  var getModelsByMode = (mode, includeHidden = false) => ALL_MODELS.filter((m) => m.mode === mode && (includeHidden || isVisibleForReleases(m)));
11337
11530
 
@@ -11375,7 +11568,7 @@ function buildInputSchema(model) {
11375
11568
  parse(input) {
11376
11569
  requireObject(input, `Invalid input for model "${model.id}"`);
11377
11570
  try {
11378
- validateAll(model.paramConfig, input, model.constraints);
11571
+ validateAll(model.paramConfig, input, model.constraints, model.validateInput);
11379
11572
  } catch (err) {
11380
11573
  if (err instanceof ApiError) throw err;
11381
11574
  throw new ApiError(err instanceof Error ? err.message : String(err), {
@@ -12153,7 +12346,7 @@ var ModelDescriptorImpl = class {
12153
12346
  return { valid: false, errors: [`Invalid input for model "${this.def.id}"`] };
12154
12347
  }
12155
12348
  try {
12156
- validateAll(this.def.paramConfig, input, this.def.constraints);
12349
+ validateAll(this.def.paramConfig, input, this.def.constraints, this.def.validateInput);
12157
12350
  return { valid: true };
12158
12351
  } catch (err) {
12159
12352
  return { valid: false, errors: [err instanceof Error ? err.message : String(err)] };
@@ -15016,6 +15209,9 @@ var MinimaxH3MaxRelight = "minimax-h3-max-relight";
15016
15209
  var MinimaxH3MaxTurbo = "minimax-h3-max-turbo";
15017
15210
  var MinimaxMusicV2 = "minimax-music-v2";
15018
15211
  var MinimaxMusicV3 = "minimax-music-v3";
15212
+ var MireloSfx20TextToAudio = "mirelo-sfx-2.0-text-to-audio";
15213
+ var MireloSfx20VideoToAudio = "mirelo-sfx-2.0-video-to-audio";
15214
+ var MireloSfx20VideoToVideo = "mirelo-sfx-2.0-video-to-video";
15019
15215
  var MuseImage10 = "muse-image-1.0";
15020
15216
  var Ovi = "ovi";
15021
15217
  var PicsartChangeBg = "picsart-change-bg";
@@ -15283,6 +15479,9 @@ var Models = {
15283
15479
  MinimaxH3MaxTurbo,
15284
15480
  MinimaxMusicV2,
15285
15481
  MinimaxMusicV3,
15482
+ MireloSfx20TextToAudio,
15483
+ MireloSfx20VideoToAudio,
15484
+ MireloSfx20VideoToVideo,
15286
15485
  MuseImage10,
15287
15486
  Ovi,
15288
15487
  PicsartChangeBg,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "6.41.0",
3
+ "version": "6.43.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",