@picsart/ai-sdk 5.28.7 → 5.29.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.js CHANGED
@@ -2293,6 +2293,7 @@ var FAST_DURATIONS = [6, 8, 10, 12, 14, 16, 18, 20];
2293
2293
  var LTX_RESOLUTIONS = ["1080p", "1440p", "2160p"];
2294
2294
  var LTX_23_AR = ["16:9", "9:16"];
2295
2295
  var LTX_23_FPS = [24, 25, 48, 50];
2296
+ var LTX_PROMPT_MAX = 5e3;
2296
2297
  var FAST_LONG = "Videos longer than 10s render at 1080p / 25 fps.";
2297
2298
  var ltxFastLongConstraints = [12, 14, 16, 18, 20].map((d) => ({
2298
2299
  when: { duration: { is: d } },
@@ -2390,7 +2391,7 @@ var { MODELS: MODELS2 } = defineModels("ltx", [
2390
2391
  description: "4K output with audio \u2014 streamlined for fast, production-ready results.",
2391
2392
  features: [feat("Image Input", "input"), feat("Start Frame", "frame"), feat("Audio", "audio"), feat("4K", "resolution"), feat("6/8/10 sec", "duration")],
2392
2393
  paramConfig: {
2393
- ...params.prompt(),
2394
+ ...params.prompt({ maxLength: LTX_PROMPT_MAX }),
2394
2395
  ...params.duration(PRO_DURATIONS, 6),
2395
2396
  ...params.resolution([...LTX_RESOLUTIONS]),
2396
2397
  ...params.generateAudio(),
@@ -2414,7 +2415,7 @@ var { MODELS: MODELS2 } = defineModels("ltx", [
2414
2415
  description: "Fast with long video support \u2014 up to 20s at 1080p, ideal for drafts and extended scenes.",
2415
2416
  features: [feat("Image Input", "input"), feat("Fast", "duration"), feat("Up to 20s", "duration"), feat("Audio", "audio"), feat("4K", "resolution")],
2416
2417
  paramConfig: {
2417
- ...params.prompt(),
2418
+ ...params.prompt({ maxLength: LTX_PROMPT_MAX }),
2418
2419
  ...params.duration(FAST_DURATIONS, 6),
2419
2420
  ...params.resolution([...LTX_RESOLUTIONS]),
2420
2421
  ...params.generateAudio(),
@@ -2435,7 +2436,7 @@ var { MODELS: MODELS2 } = defineModels("ltx", [
2435
2436
  description: "Reinterpret existing footage with a new visual direction \u2014 up to 20s segments.",
2436
2437
  features: [feat("Video Input", "input"), feat("Up to 20s", "duration")],
2437
2438
  paramConfig: {
2438
- ...params.prompt(),
2439
+ ...params.prompt({ maxLength: LTX_PROMPT_MAX }),
2439
2440
  ...params.duration([5, 10, 15, 20], 5),
2440
2441
  ...params.videoInput("Source Video")
2441
2442
  }
@@ -2456,7 +2457,7 @@ var { MODELS: MODELS2 } = defineModels("ltx", [
2456
2457
  description: "4K output with audio and aspect ratio control \u2014 production-ready v2.3.",
2457
2458
  features: [feat("Image Input", "input"), feat("Start Frame", "frame"), feat("Audio", "audio"), feat("4K", "resolution"), feat("16:9 / 9:16", "characteristic"), feat("6/8/10 sec", "duration")],
2458
2459
  paramConfig: {
2459
- ...params.prompt(),
2460
+ ...params.prompt({ maxLength: LTX_PROMPT_MAX }),
2460
2461
  ...params.duration(PRO_DURATIONS, 6),
2461
2462
  ...params.resolution([...LTX_RESOLUTIONS]),
2462
2463
  ...params.aspectRatio(LTX_23_AR),
@@ -2487,7 +2488,7 @@ var { MODELS: MODELS2 } = defineModels("ltx", [
2487
2488
  description: "Fast 2.3 with long video support \u2014 up to 20s at 1080p with aspect ratio control.",
2488
2489
  features: [feat("Image Input", "input"), feat("Fast", "duration"), feat("Up to 20s", "duration"), feat("Audio", "audio"), feat("4K", "resolution"), feat("16:9 / 9:16", "characteristic")],
2489
2490
  paramConfig: {
2490
- ...params.prompt(),
2491
+ ...params.prompt({ maxLength: LTX_PROMPT_MAX }),
2491
2492
  ...params.duration(FAST_DURATIONS, 6),
2492
2493
  ...params.resolution([...LTX_RESOLUTIONS]),
2493
2494
  ...params.aspectRatio(LTX_23_AR),
@@ -2517,7 +2518,7 @@ var { MODELS: MODELS2 } = defineModels("ltx", [
2517
2518
  description: "Generate video driven by an audio track \u2014 2-20s, optional image for first frame.",
2518
2519
  features: [feat("Audio Input", "audio"), feat("Image Input", "input"), feat("2\u201320 sec", "duration")],
2519
2520
  paramConfig: {
2520
- ...params.prompt({ required: false }),
2521
+ ...params.prompt({ required: false, maxLength: LTX_PROMPT_MAX }),
2521
2522
  ...params.audioInput("Audio Track", true),
2522
2523
  ...params.imageInput(1, "First Frame Image", false),
2523
2524
  ...params.aspectRatio(["auto", ...LTX_23_AR]),
@@ -2541,7 +2542,7 @@ var { MODELS: MODELS2 } = defineModels("ltx", [
2541
2542
  description: "Seamlessly extend an existing video forward or backward \u2014 up to 20s.",
2542
2543
  features: [feat("Video Input", "input"), feat("Up to 20s", "duration")],
2543
2544
  paramConfig: {
2544
- ...params.prompt({ required: false }),
2545
+ ...params.prompt({ required: false, maxLength: LTX_PROMPT_MAX }),
2545
2546
  ...params.durationRange(2, 20, 5, 1),
2546
2547
  ...p.enum("mode", ["end", "start"], "end", { label: "Extend Direction" }),
2547
2548
  ...params.videoInput("Source Video")
@@ -2559,7 +2560,7 @@ var { MODELS: MODELS2 } = defineModels("ltx", [
2559
2560
  description: "Retake video with new direction \u2014 replace audio, video, or both.",
2560
2561
  features: [feat("Video Input", "input"), feat("Up to 20s", "duration")],
2561
2562
  paramConfig: {
2562
- ...params.prompt(),
2563
+ ...params.prompt({ maxLength: LTX_PROMPT_MAX }),
2563
2564
  ...params.durationRange(2, 20, 5, 1),
2564
2565
  ...p.enum("retakeMode", ["replace_audio_and_video", "replace_audio", "replace_video"], "replace_audio_and_video", { label: "Retake Mode" }),
2565
2566
  // Default-less: when unset the retake starts at 0 (vendor default).
@@ -2741,7 +2742,8 @@ var { MODELS: MODELS6 } = defineModels("bytedance", [
2741
2742
  feat("1080p", "resolution")
2742
2743
  ],
2743
2744
  paramConfig: {
2744
- ...params.prompt({ required: false }),
2745
+ // BytePlus OmniHuman 1.5 API: the optional prompt is capped at 300 characters.
2746
+ ...params.prompt({ required: false, maxLength: 300 }),
2745
2747
  ...params.imageInput(1, "Portrait Image", true),
2746
2748
  ...params.audioInput("Audio Track", true),
2747
2749
  ...params.resolution([...BYTEDANCE_OMNIHUMAN_RESOLUTION_OPTIONS], "1080p"),
@@ -3224,7 +3226,7 @@ var { MODELS: MODELS10 } = defineModels("wan", [
3224
3226
  description: "Painterly artistic look with audio \u2014 up to 15s at 1080p.",
3225
3227
  features: [feat("Image Input", "input"), feat("Start Frame", "frame"), feat("Audio", "audio"), feat("1080p", "resolution"), feat("5/10/15 sec", "duration")],
3226
3228
  paramConfig: {
3227
- ...params.prompt(),
3229
+ ...params.prompt({ maxLength: 5e3 }),
3228
3230
  ...params.duration([5, 10, 15], 5),
3229
3231
  ...params.resolution(["480p", "720p", "1080p"], "720p"),
3230
3232
  ...params.aspectRatio(["16:9", "9:16", "1:1", "4:3", "3:4"]),
@@ -3247,7 +3249,7 @@ var { MODELS: MODELS10 } = defineModels("wan", [
3247
3249
  description: "Regenerate video from a reference clip with new stylistic direction.",
3248
3250
  features: [feat("Video Input", "input"), feat("1080p", "resolution"), feat("5/10 sec", "duration")],
3249
3251
  paramConfig: {
3250
- ...params.prompt(),
3252
+ ...params.prompt({ maxLength: 5e3 }),
3251
3253
  ...params.duration([5, 10], 5),
3252
3254
  ...params.resolution(["720p", "1080p"], "720p"),
3253
3255
  ...params.videoInput("Reference Video")
@@ -3267,7 +3269,8 @@ var { MODELS: MODELS10 } = defineModels("wan", [
3267
3269
  description: "Diverse, stylized images for visual exploration and animation.",
3268
3270
  features: [feat("Multi-Image Input", "input")],
3269
3271
  paramConfig: {
3270
- ...params.prompt(),
3272
+ // pa-alibaba worker: @MaxLength(1500) on the wan-images prompt (video tasks take 5000).
3273
+ ...params.prompt({ maxLength: 1500 }),
3271
3274
  ...params.count(),
3272
3275
  ...params.negativePrompt()
3273
3276
  }
@@ -3499,8 +3502,9 @@ var buildLumaRay2ReframeVideoPayload = makeReframeVideoPayload("ray-2");
3499
3502
  var buildLumaRayFlash2ReframeVideoPayload = makeReframeVideoPayload("ray-flash-2");
3500
3503
  var LUMA_AR = ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21"];
3501
3504
  var LUMA_RESOLUTIONS = ["540p", "720p", "1080p", "4k"];
3505
+ var LUMA_PROMPT_MAX = 5e3;
3502
3506
  var lumaParamConfig = {
3503
- ...params.prompt(),
3507
+ ...params.prompt({ maxLength: LUMA_PROMPT_MAX }),
3504
3508
  ...params.aspectRatio(LUMA_AR),
3505
3509
  ...params.resolution(LUMA_RESOLUTIONS, "720p"),
3506
3510
  ...params.duration([5, 9], 5)
@@ -3534,7 +3538,7 @@ var buildLumaUni1I2IPayload = makeUni1I2IPayload("uni-1");
3534
3538
  var buildLumaUni1MaxT2IPayload = makeUni1T2IPayload("uni-1-max");
3535
3539
  var buildLumaUni1MaxI2IPayload = makeUni1I2IPayload("uni-1-max");
3536
3540
  var lumaUni1ParamConfig = {
3537
- ...params.prompt({ maxLength: 6e3 }),
3541
+ ...params.prompt({ maxLength: LUMA_PROMPT_MAX }),
3538
3542
  ...params.aspectRatio(LUMA_UNI1_AR, "1:1"),
3539
3543
  ...params.style(LUMA_UNI1_STYLES, "auto"),
3540
3544
  ...params.imageInput(9, "Reference Images", false)
@@ -3645,7 +3649,7 @@ var { MODELS: MODELS11 } = defineModels("luma", [
3645
3649
  description: "Reframe a video to a new aspect ratio using Luma Ray 2.",
3646
3650
  features: [feat("Video Input", "input"), feat("Reframe", "characteristic")],
3647
3651
  paramConfig: {
3648
- ...params.prompt({ required: false }),
3652
+ ...params.prompt({ required: false, maxLength: LUMA_PROMPT_MAX }),
3649
3653
  ...params.aspectRatio(LUMA_AR, "16:9"),
3650
3654
  ...params.videoInput("Source Video")
3651
3655
  }
@@ -3663,7 +3667,7 @@ var { MODELS: MODELS11 } = defineModels("luma", [
3663
3667
  description: "Reframe a video to a new aspect ratio using Luma Flash 2.",
3664
3668
  features: [feat("Video Input", "input"), feat("Reframe", "characteristic")],
3665
3669
  paramConfig: {
3666
- ...params.prompt({ required: false }),
3670
+ ...params.prompt({ required: false, maxLength: LUMA_PROMPT_MAX }),
3667
3671
  ...params.aspectRatio(LUMA_AR, "16:9"),
3668
3672
  ...params.videoInput("Source Video")
3669
3673
  }
@@ -3711,7 +3715,7 @@ var { MODELS: MODELS11 } = defineModels("luma", [
3711
3715
  description: "Luma Ray 3.2 \u2014 high-fidelity video generation with start/end frames, HDR, and looping (early access).",
3712
3716
  features: [feat("Image Input", "input"), feat("Start/End Frame", "frame"), feat("HDR", "characteristic"), feat("5/10 sec", "duration")],
3713
3717
  paramConfig: {
3714
- ...params.prompt({ maxLength: 6e3 }),
3718
+ ...params.prompt({ maxLength: LUMA_PROMPT_MAX }),
3715
3719
  ...params.aspectRatio(RAY32_AR, "16:9"),
3716
3720
  ...params.resolution(RAY32_RESOLUTIONS, "720p"),
3717
3721
  ...params.duration([5, 10], 5),
@@ -3735,7 +3739,7 @@ var { MODELS: MODELS11 } = defineModels("luma", [
3735
3739
  description: "Edit a prior video from a prompt using Luma Ray 3.2 \u2014 preservation-vs-reimagination presets (early access).",
3736
3740
  features: [feat("Video Input", "input"), feat("Edit", "characteristic"), feat("HDR", "characteristic"), feat("5/10 sec", "duration")],
3737
3741
  paramConfig: {
3738
- ...params.prompt({ maxLength: 6e3 }),
3742
+ ...params.prompt({ maxLength: LUMA_PROMPT_MAX }),
3739
3743
  // Source clip capped at 30s — video_edit rejects longer at ingest (422).
3740
3744
  ...params.videoInput("Source Video", "reference", true, 30),
3741
3745
  ...params.resolution(RAY32_RESOLUTIONS, "720p"),
@@ -3758,7 +3762,7 @@ var { MODELS: MODELS11 } = defineModels("luma", [
3758
3762
  description: "Reframe a video to a new aspect ratio using Luma Ray 3.2 (early access).",
3759
3763
  features: [feat("Video Input", "input"), feat("Reframe", "characteristic")],
3760
3764
  paramConfig: {
3761
- ...params.prompt({ maxLength: 6e3 }),
3765
+ ...params.prompt({ maxLength: LUMA_PROMPT_MAX }),
3762
3766
  ...params.aspectRatio(RAY32_AR, "16:9"),
3763
3767
  // Source clip capped at 30s — video_reframe rejects longer at ingest (422).
3764
3768
  ...params.videoInput("Source Video", "reference", true, 30),
@@ -4532,6 +4536,7 @@ var buildSora2ExtendPayload = (ctx) => ({
4532
4536
  });
4533
4537
  var SORA_DURATIONS = [4, 8, 12, 16, 20];
4534
4538
  var SORA_AR = ["16:9", "9:16"];
4539
+ var SORA_PROMPT_MAX = 5e3;
4535
4540
  var { MODELS: MODELS13 } = defineModels("openai", [
4536
4541
  {
4537
4542
  id: "sora-2-pro",
@@ -4548,7 +4553,7 @@ var { MODELS: MODELS13 } = defineModels("openai", [
4548
4553
  description: "Up to 1080p with strong physical realism and optional reference image.",
4549
4554
  features: [feat("Image Input", "input"), feat("Audio", "audio"), feat("Up to 1080p", "resolution"), feat("4\u201320 sec", "duration")],
4550
4555
  paramConfig: {
4551
- ...params.prompt(),
4556
+ ...params.prompt({ maxLength: SORA_PROMPT_MAX }),
4552
4557
  ...params.imageInput(1, "Reference Image"),
4553
4558
  ...params.aspectRatio(SORA_AR),
4554
4559
  ...params.resolution(["720p", "1024p", "1080p"]),
@@ -4569,7 +4574,7 @@ var { MODELS: MODELS13 } = defineModels("openai", [
4569
4574
  description: "Naturalistic 720p video with lifelike motion and character detail.",
4570
4575
  features: [feat("Image Input", "input"), feat("Audio", "audio"), feat("720p", "resolution"), feat("4\u201320 sec", "duration")],
4571
4576
  paramConfig: {
4572
- ...params.prompt(),
4577
+ ...params.prompt({ maxLength: SORA_PROMPT_MAX }),
4573
4578
  ...params.imageInput(1, "Reference Image"),
4574
4579
  ...params.aspectRatio(SORA_AR),
4575
4580
  ...params.duration(SORA_DURATIONS, 4)
@@ -4588,7 +4593,7 @@ var { MODELS: MODELS13 } = defineModels("openai", [
4588
4593
  description: "Seamlessly continue a previously generated Sora video with matching style and pacing.",
4589
4594
  features: [feat("Continue Video", "input"), feat("4\u201320 sec", "duration")],
4590
4595
  paramConfig: {
4591
- ...params.prompt(),
4596
+ ...params.prompt({ maxLength: SORA_PROMPT_MAX }),
4592
4597
  // video_id is chained from the source Sora asset (declaring the param lets
4593
4598
  // the store seed ctx.videoId); no aspectRatio/size — extend keeps source geometry.
4594
4599
  ...params.videoId([], ""),
@@ -4936,6 +4941,7 @@ var buildGrokTTSPayload = (ctx) => ({
4936
4941
  voice_id: ctx.voiceId ?? DEFAULT_GROK_VOICE_ID
4937
4942
  });
4938
4943
  var GROK_VIDEO_PROMPT_MAX = 4096;
4944
+ var GROK_IMAGE_PROMPT_MAX = 8e3;
4939
4945
  var GROK_VIDEO_AR = ["16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3"];
4940
4946
  var GROK_IMAGE_AR = ["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "2:1", "1:2", "19.5:9", "9:19.5", "20:9", "9:20"];
4941
4947
  var GROK_DURATIONS = [3, 5, 6, 8, 10, 12, 15];
@@ -5039,7 +5045,7 @@ var { MODELS: MODELS17 } = defineModels("grok", [
5039
5045
  description: "Rapid image creation with wide aspect-ratio selection and image input.",
5040
5046
  features: [feat("Image Input", "input")],
5041
5047
  paramConfig: {
5042
- ...params.prompt(),
5048
+ ...params.prompt({ maxLength: GROK_IMAGE_PROMPT_MAX }),
5043
5049
  ...params.aspectRatio(GROK_IMAGE_AR, "1:1"),
5044
5050
  ...params.resolution(GROK_IMAGE_RESOLUTIONS, "1k"),
5045
5051
  ...params.count([1, 2, 4]),
@@ -5061,7 +5067,7 @@ var { MODELS: MODELS17 } = defineModels("grok", [
5061
5067
  description: "Higher-fidelity Grok Imagine variant for production-grade images.",
5062
5068
  features: [feat("Image Input", "input"), feat("2k", "resolution")],
5063
5069
  paramConfig: {
5064
- ...params.prompt({ maxLength: 8e3 }),
5070
+ ...params.prompt({ maxLength: GROK_IMAGE_PROMPT_MAX }),
5065
5071
  ...params.aspectRatio(GROK_IMAGE_AR, "1:1"),
5066
5072
  ...params.resolution(GROK_IMAGE_RESOLUTIONS, "2k"),
5067
5073
  ...params.count([1, 2, 4]),
@@ -5080,7 +5086,7 @@ var { MODELS: MODELS17 } = defineModels("grok", [
5080
5086
  description: "Latest Grok Imagine generation \u2014 sharper detail with a low/medium quality tier.",
5081
5087
  features: [feat("Image Input", "input"), feat("2k", "resolution")],
5082
5088
  paramConfig: {
5083
- ...params.prompt(),
5089
+ ...params.prompt({ maxLength: GROK_IMAGE_PROMPT_MAX }),
5084
5090
  ...params.aspectRatio(GROK_IMAGE_AR, "1:1"),
5085
5091
  ...params.resolution(GROK_IMAGE_RESOLUTIONS, "1k"),
5086
5092
  // Vendor-side default is medium; only supported by grok-imagine-image-2.0
@@ -5266,8 +5272,9 @@ var buildVeoPayload = (modelId, opts = {}) => (ctx) => {
5266
5272
  }
5267
5273
  };
5268
5274
  };
5275
+ var VEO_PROMPT_MAX = 4e3;
5269
5276
  var veoParamConfig = {
5270
- ...params.prompt(),
5277
+ ...params.prompt({ maxLength: VEO_PROMPT_MAX }),
5271
5278
  ...params.aspectRatio(["16:9", "9:16"]),
5272
5279
  ...params.duration([4, 6, 8], 8),
5273
5280
  ...params.resolution(["720p", "1080p", "4k"]),
@@ -5290,7 +5297,7 @@ var veoConstraints = [
5290
5297
  } }
5291
5298
  ];
5292
5299
  var veoLiteParamConfig = {
5293
- ...params.prompt(),
5300
+ ...params.prompt({ maxLength: VEO_PROMPT_MAX }),
5294
5301
  ...params.aspectRatio(["16:9", "9:16"]),
5295
5302
  ...params.duration([4, 6, 8], 8),
5296
5303
  ...params.resolution(["720p", "1080p"]),
@@ -6155,6 +6162,7 @@ var buildGptImage2EditPayload = (ctx) => ({
6155
6162
  ...ctx.background ? { background: ctx.background } : {},
6156
6163
  ...ctx.outputFormat ? { output_format: ctx.outputFormat } : {}
6157
6164
  });
6165
+ var GPT_IMAGE_PROMPT_MAX = 32e3;
6158
6166
  var gptImage2Constraints = [
6159
6167
  {
6160
6168
  when: { imageUrls: { exists: true } },
@@ -6188,7 +6196,7 @@ var { MODELS: MODELS23 } = defineModels("openai", [
6188
6196
  description: "Next-gen GPT image model with arbitrary output dimensions and multi-image input.",
6189
6197
  features: [feat("Multi-Image Input", "input"), feat("High Quality", "quality")],
6190
6198
  paramConfig: {
6191
- ...params.prompt(),
6199
+ ...params.prompt({ maxLength: GPT_IMAGE_PROMPT_MAX }),
6192
6200
  ...params.aspectRatio(["1:1", "3:2", "2:3", "16:9", "9:16", "4:3", "3:4", "auto"], "1:1"),
6193
6201
  ...p.quality(["high", "medium", "low"], "high"),
6194
6202
  // gpt-image-2 supports only an opaque background — the API rejects
@@ -6214,7 +6222,7 @@ var { MODELS: MODELS23 } = defineModels("openai", [
6214
6222
  description: "Strong text-in-image and infographic rendering with multi-image input.",
6215
6223
  features: [feat("Multi-Image Input", "input"), feat("High Quality", "quality")],
6216
6224
  paramConfig: {
6217
- ...params.prompt(),
6225
+ ...params.prompt({ maxLength: GPT_IMAGE_PROMPT_MAX }),
6218
6226
  ...params.aspectRatio(["1:1", "3:2", "2:3", "16:9", "9:16", "4:3", "3:4"], "1:1"),
6219
6227
  ...p.quality(["high", "medium", "low"], "high"),
6220
6228
  ...p.enum("background", ["opaque", "transparent"], "opaque", { label: "Background" }),
@@ -6241,7 +6249,7 @@ var { MODELS: MODELS23 } = defineModels("openai", [
6241
6249
  description: "Original GPT image model with quality-tiered generation.",
6242
6250
  features: [feat("Multi-Image Input", "input")],
6243
6251
  paramConfig: {
6244
- ...params.prompt(),
6252
+ ...params.prompt({ maxLength: GPT_IMAGE_PROMPT_MAX }),
6245
6253
  ...params.aspectRatio(["1:1", "3:2", "2:3", "16:9", "9:16", "4:3", "3:4"], "1:1"),
6246
6254
  ...p.quality(["high", "medium", "low"], "high"),
6247
6255
  ...p.enum("background", ["opaque", "transparent"], "opaque", { label: "Background" }),
@@ -6347,7 +6355,8 @@ var { MODELS: MODELS24 } = defineModels("elevenlabs", [
6347
6355
  badge: ["popular"],
6348
6356
  description: "Create custom sound effects from a text description \u2014 up to 30 seconds.",
6349
6357
  features: [feat("Sound Effects", "characteristic")],
6350
- paramConfig: { ...params.prompt(), ...params.durationRange(0.5, 30, 5, 0.5) }
6358
+ // ElevenLabs sound-generation reference: "The maximum length of the prompt is 450 characters."
6359
+ paramConfig: { ...params.prompt({ maxLength: 450 }), ...params.durationRange(0.5, 30, 5, 0.5) }
6351
6360
  },
6352
6361
  // ── Music ─────────────────────────────────────────────────────────
6353
6362
  {
@@ -6362,7 +6371,8 @@ var { MODELS: MODELS24 } = defineModels("elevenlabs", [
6362
6371
  description: "Generate music with vocals or instrumental from a text prompt.",
6363
6372
  features: [feat("Vocal & Instrumental", "characteristic")],
6364
6373
  paramConfig: {
6365
- ...params.prompt(),
6374
+ // ElevenLabs music docs state no cap; fal's `elevenlabs/music` schema declares maxLength 4100.
6375
+ ...params.prompt({ maxLength: 4100 }),
6366
6376
  ...params.duration([10, 20, 30, 60, 120, 180, 300, 600], 30),
6367
6377
  ...p.boolean("isInstrumental", false, "Instrumental Only")
6368
6378
  }
@@ -6609,6 +6619,44 @@ var buildMinimaxMusicPayload = (ctx) => ({
6609
6619
  format: ctx.format ?? "mp3"
6610
6620
  }
6611
6621
  });
6622
+ var H3_MAX_PROMPT_MAX = 5e4;
6623
+ var FRAME_REF_EXCLUSIVE2 = "References and start/end frames cannot be combined.";
6624
+ var AUDIO_NEEDS_VISUAL2 = "Audio cannot be the only reference \u2014 add an image or video.";
6625
+ var RATIO_FOLLOWS_FRAME = "Aspect ratio follows the frame image.";
6626
+ var ADAPTIVE_NEEDS_REFS = "Adaptive aspect ratio requires reference inputs.";
6627
+ var H3_MAX_RATIOS = ["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"];
6628
+ var REFERENCE_EXCLUDES_FRAMES = {
6629
+ startFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE2 },
6630
+ endFrame: { disabled: true, reason: FRAME_REF_EXCLUSIVE2 }
6631
+ };
6632
+ var FRAME_EXCLUDES_REFERENCES = {
6633
+ imageUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE2 },
6634
+ videoUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE2 },
6635
+ audioUrls: { disabled: true, reason: FRAME_REF_EXCLUSIVE2 }
6636
+ };
6637
+ var h3MaxConstraints = [
6638
+ { when: { startFrame: { exists: true } }, then: FRAME_EXCLUDES_REFERENCES },
6639
+ { when: { endFrame: { exists: true } }, then: FRAME_EXCLUDES_REFERENCES },
6640
+ { when: { imageUrls: { exists: true } }, then: REFERENCE_EXCLUDES_FRAMES },
6641
+ { when: { videoUrls: { exists: true } }, then: REFERENCE_EXCLUDES_FRAMES },
6642
+ { when: { audioUrls: { exists: true } }, then: REFERENCE_EXCLUDES_FRAMES },
6643
+ // With a frame the output follows that image, so the ratio is not a choice.
6644
+ // An end frame alone is valid — it generates towards that keyframe.
6645
+ { when: { startFrame: { exists: true } }, then: {
6646
+ aspectRatio: { disabled: true, reason: RATIO_FOLLOWS_FRAME }
6647
+ } },
6648
+ { when: { endFrame: { exists: true } }, then: {
6649
+ aspectRatio: { disabled: true, reason: RATIO_FOLLOWS_FRAME }
6650
+ } },
6651
+ // 'adaptive' means "follow the references" — no meaning without them.
6652
+ { when: { imageUrls: { exists: false }, videoUrls: { exists: false }, audioUrls: { exists: false } }, then: {
6653
+ aspectRatio: { allowed: [...H3_MAX_RATIOS], reason: ADAPTIVE_NEEDS_REFS }
6654
+ } },
6655
+ // Audio carries no visual signal, so it cannot be the only reference.
6656
+ { when: { imageUrls: { exists: false }, videoUrls: { exists: false } }, then: {
6657
+ audioUrls: { disabled: true, reason: AUDIO_NEEDS_VISUAL2 }
6658
+ } }
6659
+ ];
6612
6660
  var { MODELS: MODELS26 } = defineModels("minimax", [
6613
6661
  {
6614
6662
  id: "minimax-02-hd",
@@ -6679,55 +6727,51 @@ var { MODELS: MODELS26 } = defineModels("minimax", [
6679
6727
  }
6680
6728
  },
6681
6729
  {
6682
- // Combined T2V/I2V fal.ai-hosted (pa-fal-ai-pluggable-worker), unlike
6683
- // the Hailuo/H3 entries in hailuo.ts which route through the minimax
6684
- // worker. A start frame switches to the image-to-video edit workflow.
6730
+ // One entry for all three H3 Max modes: the inputs pick it — reference
6731
+ // images, videos or audio generate from references; a start and/or end
6732
+ // frame animates those frames; neither generates from the prompt alone.
6685
6733
  id: "minimax-h3-max",
6686
6734
  name: "MiniMax H3 Max",
6687
6735
  modelId: "fal-ai-h3-max",
6688
6736
  addedAt: "2026-08-28",
6689
- workflow: "minimax/h3-max/text-to-video",
6690
- editWorkflow: "minimax/h3-max/image-to-video",
6737
+ workflow: "minimax/h3-max/video-generation",
6691
6738
  estimatedTime: 5,
6692
6739
  mode: "video",
6693
6740
  inputType: "t2v",
6694
- description: "Top-tier MiniMax H3 Max video from text or a start/end frame, with prompt expansion. Up to 15s at 768p.",
6741
+ description: "Top-tier MiniMax H3 Max video from text, a start/end frame, or reference images, videos, and audio \u2014 refer to references in the prompt as Image 1, Video 1, Audio 1, in input order. Up to 15s at 1080p.",
6695
6742
  features: [
6696
- feat("Image Input", "input"),
6697
6743
  feat("Start/End Frame", "frame"),
6698
- feat("768p", "resolution"),
6744
+ feat("Multi-Image Input", "input"),
6745
+ feat("Video Input", "input"),
6746
+ feat("Audio Input", "input"),
6747
+ feat("1080p", "resolution"),
6699
6748
  feat("5-15 sec", "duration")
6700
6749
  ],
6701
6750
  paramConfig: {
6702
- ...params.prompt(),
6751
+ ...params.prompt({ maxLength: H3_MAX_PROMPT_MAX }),
6703
6752
  ...params.startFrame(),
6704
6753
  ...params.endFrame(),
6705
- // Lowercase on purpose: the worker uppercases for the fal wire ('768P')
6706
- // and the pricing qualities are lowercase, so this casing serves both.
6707
- ...params.resolution(["480p", "768p"], "768p"),
6754
+ // Reference slots reference-to-video route. Clips are 2-15s each
6755
+ // (≤15s combined per modality) and images + videos + audios must add up
6756
+ // to ≤12 files — backend-enforced; only the per-array maxima live here.
6757
+ ...params.imageInput(9, "Reference Images"),
6758
+ ...params.videoInputs(3, "Reference Videos"),
6759
+ ...params.audioInputs(3, "Reference Audios"),
6760
+ // 1080p is a latent refinement of a native 768p generation.
6761
+ ...params.resolution(["480p", "768p", "1080p"], "768p"),
6708
6762
  ...params.durationRange(5, 15, 5),
6709
- ...params.aspectRatio(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "16:9"),
6710
- ...p.enum("promptExpansionMode", ["disabled", "balanced", "quality"], "balanced", { label: "Prompt Expansion" }),
6763
+ // 'adaptive' means "follow the references" — constrained below.
6764
+ ...params.aspectRatio(["adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "16:9"),
6765
+ ...p.enum("promptExpansionMode", ["balanced", "quality"], "balanced", { label: "Prompt Expansion" }),
6711
6766
  // -1 (sentinel) means "pick a random seed"; the builder drops it.
6712
6767
  ...p.range("seed", -1, 2147483647, -1),
6713
6768
  ...p.boolean("enableSafetyChecker", true, "Safety Checker")
6714
6769
  },
6715
- constraints: [
6716
- // The T2V wire has no end_image_url — an end frame only reaches the
6717
- // vendor on the I2V route, which needs a start frame to trigger.
6718
- { when: { startFrame: { exists: false } }, then: {
6719
- endFrame: { disabled: true, reason: "An end frame requires a start frame." }
6720
- } },
6721
- // I2V derives the ratio from the input image (no aspect_ratio on that wire).
6722
- { when: { startFrame: { exists: true } }, then: {
6723
- aspectRatio: { disabled: true, reason: "Aspect ratio follows the start frame image." }
6724
- } }
6725
- ]
6770
+ constraints: h3MaxConstraints
6726
6771
  },
6727
6772
  {
6728
- // Turbo sibling of minimax-h3-max — same fal.ai worker, same wire shape,
6729
- // tuned for speed (faster-than-realtime generation). The only schema
6730
- // difference: prompt expansion has no 'disabled' mode on this endpoint.
6773
+ // Turbo sibling of minimax-h3-max — same model family, tuned for speed
6774
+ // (faster-than-realtime generation), text and frames only.
6731
6775
  id: "minimax-h3-max-turbo",
6732
6776
  name: "MiniMax H3 Max Turbo",
6733
6777
  modelId: "fal-ai-h3-max-turbo",
@@ -6737,81 +6781,35 @@ var { MODELS: MODELS26 } = defineModels("minimax", [
6737
6781
  estimatedTime: 5,
6738
6782
  mode: "video",
6739
6783
  inputType: "t2v",
6740
- description: "Faster-than-realtime MiniMax H3 Max Turbo video from text or a start/end frame, with prompt expansion. Up to 15s at 768p.",
6784
+ description: "Faster-than-realtime MiniMax H3 Max Turbo video from text or a start/end frame, with prompt expansion. Up to 15s at 1080p.",
6741
6785
  features: [
6742
6786
  feat("Fast", "characteristic"),
6743
6787
  feat("Image Input", "input"),
6744
6788
  feat("Start/End Frame", "frame"),
6745
- feat("768p", "resolution"),
6789
+ feat("1080p", "resolution"),
6746
6790
  feat("5-15 sec", "duration")
6747
6791
  ],
6748
6792
  paramConfig: {
6749
- ...params.prompt(),
6793
+ ...params.prompt({ maxLength: H3_MAX_PROMPT_MAX }),
6750
6794
  ...params.startFrame(),
6751
6795
  ...params.endFrame(),
6752
- // Lowercase on purpose: the worker uppercases for the fal wire ('768P')
6753
- // and the pricing qualities are lowercase, so this casing serves both.
6754
- ...params.resolution(["480p", "768p"], "768p"),
6796
+ ...params.resolution(["480p", "768p", "1080p"], "768p"),
6755
6797
  ...params.durationRange(5, 15, 5),
6756
6798
  ...params.aspectRatio(["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "16:9"),
6757
- // Unlike minimax-h3-max, the turbo wire has no 'disabled' expansion mode.
6758
6799
  ...p.enum("promptExpansionMode", ["balanced", "quality"], "balanced", { label: "Prompt Expansion" }),
6759
6800
  // -1 (sentinel) means "pick a random seed"; the builder drops it.
6760
6801
  ...p.range("seed", -1, 2147483647, -1),
6761
6802
  ...p.boolean("enableSafetyChecker", true, "Safety Checker")
6762
6803
  },
6763
6804
  constraints: [
6764
- // The T2V wire has no end_image_url an end frame only reaches the
6765
- // vendor on the I2V route, which needs a start frame to trigger.
6766
- { when: { startFrame: { exists: false } }, then: {
6767
- endFrame: { disabled: true, reason: "An end frame requires a start frame." }
6768
- } },
6769
- // I2V derives the ratio from the input image (no aspect_ratio on that wire).
6805
+ // Either frame routes to image-to-video, which derives the ratio from
6806
+ // the image it was given (no aspect_ratio on that wire). An end frame
6807
+ // alone is valid fal documents it as end-only keyframe generation.
6770
6808
  { when: { startFrame: { exists: true } }, then: {
6771
- aspectRatio: { disabled: true, reason: "Aspect ratio follows the start frame image." }
6772
- } }
6773
- ]
6774
- },
6775
- {
6776
- // Reference-to-video sibling of minimax-h3-max (same fal.ai worker).
6777
- // The prompt addresses references by modality and order — Image 1,
6778
- // Video 1, Audio 1, … Reference clips are 2-15s each (≤15s combined per
6779
- // modality) and images + videos + audios must add up to ≤12 files —
6780
- // backend-enforced; paramConfig only carries the per-array maxima.
6781
- id: "minimax-h3-max-r2v",
6782
- name: "MiniMax H3 Max Ref-to-Video",
6783
- modelId: "fal-ai-h3-max",
6784
- addedAt: "2026-09-01",
6785
- workflow: "minimax/h3-max/reference-to-video",
6786
- estimatedTime: 5,
6787
- mode: "video",
6788
- inputType: "i2v",
6789
- description: "MiniMax H3 Max video from reference images, videos, and audio \u2014 refer to them in the prompt as Image 1, Video 1, Audio 1, in input order. Up to 15s at 768p.",
6790
- features: [
6791
- feat("Multi-Image Input", "input"),
6792
- feat("Video Input", "input"),
6793
- feat("Audio Input", "input"),
6794
- feat("768p", "resolution"),
6795
- feat("5-15 sec", "duration")
6796
- ],
6797
- paramConfig: {
6798
- ...params.prompt({ placeholder: "Image 1 is the protagonist. Keep her consistent with the reference while she walks through a sunlit garden..." }),
6799
- ...params.imageInput(9, "Reference Images"),
6800
- ...params.videoInputs(3, "Reference Videos"),
6801
- ...params.audioInputs(3, "Reference Audios"),
6802
- // Lowercase on purpose — same worker normalization as minimax-h3-max.
6803
- ...params.resolution(["480p", "768p"], "768p"),
6804
- ...params.durationRange(5, 15, 5),
6805
- ...params.aspectRatio(["adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"], "adaptive"),
6806
- // Unlike the T2V/I2V entry, this wire has no 'disabled' expansion mode.
6807
- ...p.enum("promptExpansionMode", ["balanced", "quality"], "balanced", { label: "Prompt Expansion" }),
6808
- // -1 (sentinel) means "pick a random seed"; the builder drops it.
6809
- ...p.range("seed", -1, 2147483647, -1),
6810
- ...p.boolean("enableSafetyChecker", true, "Safety Checker")
6811
- },
6812
- constraints: [
6813
- { when: { imageUrls: { exists: false }, videoUrls: { exists: false } }, then: {
6814
- audioUrls: { disabled: true, reason: "Audio cannot be the only reference \u2014 add an image or video." }
6809
+ aspectRatio: { disabled: true, reason: "Aspect ratio follows the frame image." }
6810
+ } },
6811
+ { when: { endFrame: { exists: true } }, then: {
6812
+ aspectRatio: { disabled: true, reason: "Aspect ratio follows the frame image." }
6815
6813
  } }
6816
6814
  ]
6817
6815
  }
@@ -6832,41 +6830,43 @@ var buildMinimaxMusicV3Payload = (input) => ({
6832
6830
  format: input.format ?? "mp3"
6833
6831
  }
6834
6832
  });
6835
- var buildMinimaxH3MaxPayload = (input) => ({
6836
- prompt: input.prompt,
6837
- prompt_expansion_mode: input.promptExpansionMode ?? "balanced",
6838
- duration: input.duration ?? 5,
6839
- resolution: input.resolution ?? "768p",
6840
- ...input.startFrame ? {
6841
- image_url: input.startFrame,
6842
- ...input.endFrame ? { end_image_url: input.endFrame } : {}
6843
- } : { aspect_ratio: input.aspectRatio ?? "16:9" },
6844
- // -1 is the paramConfig sentinel for "random seed" omit it on the wire.
6845
- ...input.seed != null && input.seed !== -1 ? { seed: input.seed } : {},
6846
- enable_safety_checker: input.enableSafetyChecker ?? true
6847
- });
6833
+ var buildMinimaxH3MaxPayload = (input) => {
6834
+ const hasReferences = !!(input.imageUrls?.length || input.videoUrls?.length || input.audioUrls?.length);
6835
+ const hasFrame = !!(input.startFrame || input.endFrame);
6836
+ return {
6837
+ prompt: input.prompt,
6838
+ prompt_expansion_mode: input.promptExpansionMode ?? "balanced",
6839
+ duration: input.duration ?? 5,
6840
+ // The vendor enum is uppercase; paramConfig keeps the lowercase form.
6841
+ resolution: (input.resolution ?? "768p").toUpperCase(),
6842
+ // Frames and references pick different modes and are mutually exclusive
6843
+ // (the model's constraints keep them so), hence whichever the caller
6844
+ // filled is what goes out.
6845
+ ...input.startFrame ? { image_url: input.startFrame } : {},
6846
+ ...input.endFrame ? { end_image_url: input.endFrame } : {},
6847
+ ...input.imageUrls?.length ? { reference_image_urls: input.imageUrls } : {},
6848
+ ...input.videoUrls?.length ? { reference_video_urls: input.videoUrls } : {},
6849
+ ...input.audioUrls?.length ? { reference_audio_urls: input.audioUrls } : {},
6850
+ // A frame decides the ratio itself, so the field is dropped there. With
6851
+ // references the default is 'adaptive' (follow them); from the prompt
6852
+ // alone it is 16:9.
6853
+ ...hasFrame ? {} : { aspect_ratio: input.aspectRatio ?? (hasReferences ? "adaptive" : "16:9") },
6854
+ // -1 is the paramConfig sentinel for "random seed" — omit it on the wire.
6855
+ ...input.seed != null && input.seed !== -1 ? { seed: input.seed } : {},
6856
+ enable_safety_checker: input.enableSafetyChecker ?? true
6857
+ };
6858
+ };
6848
6859
  var buildMinimaxH3MaxTurboPayload = (input) => ({
6849
6860
  prompt: input.prompt,
6850
6861
  prompt_expansion_mode: input.promptExpansionMode ?? "balanced",
6851
6862
  duration: input.duration ?? 5,
6852
6863
  resolution: input.resolution ?? "768p",
6853
- ...input.startFrame ? {
6854
- image_url: input.startFrame,
6855
- ...input.endFrame ? { end_image_url: input.endFrame } : {}
6856
- } : { aspect_ratio: input.aspectRatio ?? "16:9" },
6857
- // -1 is the paramConfig sentinel for "random seed" — omit it on the wire.
6858
- ...input.seed != null && input.seed !== -1 ? { seed: input.seed } : {},
6859
- enable_safety_checker: input.enableSafetyChecker ?? true
6860
- });
6861
- var buildMinimaxH3MaxR2VPayload = (input) => ({
6862
- prompt: input.prompt,
6863
- prompt_expansion_mode: input.promptExpansionMode ?? "balanced",
6864
- duration: input.duration ?? 5,
6865
- resolution: input.resolution ?? "768p",
6866
- aspect_ratio: input.aspectRatio ?? "adaptive",
6867
- ...input.imageUrls?.length ? { reference_image_urls: input.imageUrls } : {},
6868
- ...input.videoUrls?.length ? { reference_video_urls: input.videoUrls } : {},
6869
- ...input.audioUrls?.length ? { reference_audio_urls: input.audioUrls } : {},
6864
+ // Either frame animates frames, and an end frame alone is valid (it
6865
+ // generates towards that keyframe). The ratio follows the frame when one is
6866
+ // supplied, so it goes out only when neither is set.
6867
+ ...input.startFrame ? { image_url: input.startFrame } : {},
6868
+ ...input.endFrame ? { end_image_url: input.endFrame } : {},
6869
+ ...input.startFrame || input.endFrame ? {} : { aspect_ratio: input.aspectRatio ?? "16:9" },
6870
6870
  // -1 is the paramConfig sentinel for "random seed" — omit it on the wire.
6871
6871
  ...input.seed != null && input.seed !== -1 ? { seed: input.seed } : {},
6872
6872
  enable_safety_checker: input.enableSafetyChecker ?? true
@@ -6874,11 +6874,9 @@ var buildMinimaxH3MaxR2VPayload = (input) => ({
6874
6874
  registerPayloads(MODELS26, {
6875
6875
  "minimax-music-v3": buildMinimaxMusicV3Payload,
6876
6876
  "minimax-h3-max": buildMinimaxH3MaxPayload,
6877
- "minimax-h3-max-turbo": buildMinimaxH3MaxTurboPayload,
6878
- "minimax-h3-max-r2v": buildMinimaxH3MaxR2VPayload
6877
+ "minimax-h3-max-turbo": buildMinimaxH3MaxTurboPayload
6879
6878
  });
6880
6879
  registerEditPayloads(MODELS26, {
6881
- "minimax-h3-max": buildMinimaxH3MaxPayload,
6882
6880
  "minimax-h3-max-turbo": buildMinimaxH3MaxTurboPayload
6883
6881
  });
6884
6882
 
@@ -8231,6 +8229,7 @@ var buildLyria3Payload = (apiModelId) => (ctx) => ({
8231
8229
  ...ctx.imageUrls?.length === 1 ? { image: imagePart(ctx.imageUrls[0]) } : {},
8232
8230
  ...(ctx.imageUrls?.length ?? 0) > 1 ? { images: ctx.imageUrls.slice(0, 10).map(imagePart) } : {}
8233
8231
  });
8232
+ var LYRIA_PROMPT_MAX = 5e3;
8234
8233
  var { MODELS: MODELS32 } = defineModels("google", [
8235
8234
  {
8236
8235
  id: "lyria-3-clip",
@@ -8245,7 +8244,7 @@ var { MODELS: MODELS32 } = defineModels("google", [
8245
8244
  description: "Fast music clips from text and image prompts using Google Lyria 3.",
8246
8245
  features: [feat("Image Input", "input"), feat("Vocal & Instrumental", "characteristic")],
8247
8246
  paramConfig: {
8248
- ...params.prompt(),
8247
+ ...params.prompt({ maxLength: LYRIA_PROMPT_MAX }),
8249
8248
  ...params.imageInput(10, "Mood Images")
8250
8249
  }
8251
8250
  },
@@ -8263,7 +8262,7 @@ var { MODELS: MODELS32 } = defineModels("google", [
8263
8262
  description: "Extended music generation up to 184s with vocals, powered by Google Lyria 3 Pro.",
8264
8263
  features: [feat("Image Input", "input"), feat("Vocal & Instrumental", "characteristic"), feat("Up to 184s", "duration")],
8265
8264
  paramConfig: {
8266
- ...params.prompt({ placeholder: "Generate voiceover, music and sound effects" }),
8265
+ ...params.prompt({ maxLength: LYRIA_PROMPT_MAX, placeholder: "Generate voiceover, music and sound effects" }),
8267
8266
  ...params.imageInput(10, "Mood Images")
8268
8267
  }
8269
8268
  },
@@ -11444,7 +11443,6 @@ var Lyria35 = "lyria-3.5";
11444
11443
  var Minimax02Hd = "minimax-02-hd";
11445
11444
  var MinimaxH3 = "minimax-h3";
11446
11445
  var MinimaxH3Max = "minimax-h3-max";
11447
- var MinimaxH3MaxR2v = "minimax-h3-max-r2v";
11448
11446
  var MinimaxH3MaxTurbo = "minimax-h3-max-turbo";
11449
11447
  var MinimaxMusicV2 = "minimax-music-v2";
11450
11448
  var MinimaxMusicV3 = "minimax-music-v3";
@@ -11668,7 +11666,6 @@ var Models = {
11668
11666
  Minimax02Hd,
11669
11667
  MinimaxH3,
11670
11668
  MinimaxH3Max,
11671
- MinimaxH3MaxR2v,
11672
11669
  MinimaxH3MaxTurbo,
11673
11670
  MinimaxMusicV2,
11674
11671
  MinimaxMusicV3,