@picsart/ai-sdk 6.51.2 → 6.52.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 +23 -0
  2. package/index.js +122 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -379,6 +379,27 @@ type ModelInputById = {
379
379
  steps?: number;
380
380
  safetyTolerance?: number;
381
381
  };
382
+ "flux-3-max": {
383
+ prompt: string;
384
+ startFrame?: string;
385
+ endFrame?: string;
386
+ aspectRatio?: "auto" | "21:9" | "2:1" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
387
+ resolution?: "720p" | "1080p";
388
+ duration?: number;
389
+ generateAudio?: boolean;
390
+ reasoningLevel?: "low" | "high";
391
+ seed?: number;
392
+ };
393
+ "flux-3-max-keyframes": {
394
+ prompt: string;
395
+ imageUrls: [string, ...string[]];
396
+ aspectRatio?: "auto" | "21:9" | "2:1" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
397
+ resolution?: "720p" | "1080p";
398
+ duration?: number;
399
+ generateAudio?: boolean;
400
+ reasoningLevel?: "low" | "high";
401
+ seed?: number;
402
+ };
382
403
  "flux-3-video": {
383
404
  prompt: string;
384
405
  aspectRatio?: "auto" | "21:9" | "2:1" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16";
@@ -3544,6 +3565,8 @@ declare const Models: {
3544
3565
  readonly Flux2Pro: "flux-2-pro";
3545
3566
  readonly Flux3Image: "flux-3-image";
3546
3567
  readonly Flux3ImageKlein: "flux-3-image-klein";
3568
+ readonly Flux3Max: "flux-3-max";
3569
+ readonly Flux3MaxKeyframes: "flux-3-max-keyframes";
3547
3570
  readonly Flux3Video: "flux-3-video";
3548
3571
  readonly FluxKontextMax: "flux-kontext-max";
3549
3572
  readonly FluxKontextPro: "flux-kontext-pro";
package/index.js CHANGED
@@ -6283,6 +6283,7 @@ var flux3ImageAspectRatios = [
6283
6283
  "9:21",
6284
6284
  "1:2"
6285
6285
  ];
6286
+ var flux3MaxAspectRatios = ["auto", "21:9", "2:1", "16:9", "4:3", "1:1", "3:4", "9:16"];
6286
6287
  var flux3ImageResolutions = ["768sq", "1k", "1.5k", "2k", "4k"];
6287
6288
  var buildFluxV2Payload = (modelId) => (ctx) => ({
6288
6289
  prompt: ctx.prompt,
@@ -6610,6 +6611,84 @@ var { MODELS: MODELS20 } = defineModels("flux", [
6610
6611
  // Moderation level: 0 (strict) … 4 (permissive).
6611
6612
  ...p.range("safetyTolerance", 0, 4, 2, { label: "Safety Tolerance" })
6612
6613
  }
6614
+ },
6615
+ {
6616
+ // FLUX 3 Max video — text-to-video, or image-to-video from a start (and
6617
+ // optional end) frame: a frame routes to the `flux-3-max/image-to-video`
6618
+ // endpoint via editWorkflow. Keyframe interpolation is its own entry
6619
+ // (flux-3-max-keyframes) because routing has only two slots. The worker
6620
+ // forwards the command straight to fal, so the builders emit fal snake_case.
6621
+ id: "flux-3-max",
6622
+ name: "Flux 3 Max",
6623
+ modelId: "fal-ai-flux-3-max",
6624
+ workflow: "flux-3-max/text-to-video",
6625
+ editWorkflow: "flux-3-max/image-to-video",
6626
+ mode: "video",
6627
+ inputType: "t2v",
6628
+ addedAt: "2026-10-21",
6629
+ estimatedTime: 60,
6630
+ description: "Text-to-video with synchronized audio, or image-to-video from a start (and optional end) frame. Up to 20s at 1080p.",
6631
+ features: [
6632
+ feat("Start/End Frame", "frame"),
6633
+ feat("Audio", "audio"),
6634
+ feat("Up to 20s", "duration"),
6635
+ feat("1080p", "resolution")
6636
+ ],
6637
+ paramConfig: {
6638
+ ...params.prompt(),
6639
+ // A start frame routes to image-to-video (image_url); end frame is the
6640
+ // optional end_image_url.
6641
+ ...params.startFrame("Start Frame", false),
6642
+ ...params.endFrame("End Frame"),
6643
+ ...params.aspectRatio(flux3MaxAspectRatios, "16:9"),
6644
+ ...params.resolution(["720p", "1080p"], "720p"),
6645
+ ...params.durationRange(5, 20, 5),
6646
+ ...params.generateAudio(true),
6647
+ // Vendor reasoning tier for the planner; vendor default high.
6648
+ ...p.enum("reasoningLevel", ["low", "high"], "high", { label: "Reasoning" }),
6649
+ // -1 (sentinel) means "pick a random seed"; the builder drops it.
6650
+ ...p.range("seed", -1, 2147483647, -1)
6651
+ },
6652
+ constraints: [
6653
+ // image-to-video requires image_url; end_image_url alone is invalid. An
6654
+ // end frame is only ever a second keyframe, so require a start frame
6655
+ // whenever one is supplied rather than let the request reach fal and 400.
6656
+ { when: { endFrame: { exists: true } }, then: {
6657
+ startFrame: { required: true, reason: "An end frame needs a start frame \u2014 image-to-video animates from the start image." }
6658
+ } }
6659
+ ]
6660
+ },
6661
+ {
6662
+ // Keyframe-interpolation sibling: 1–10 positioned images animate into a
6663
+ // video via `flux-3-max/keyframes-to-video`. Shares the image-to-video
6664
+ // pricing tier (same modelId). The images are spaced evenly across the
6665
+ // 24 fps timeline in flux.payloads.ts.
6666
+ id: "flux-3-max-keyframes",
6667
+ name: "Flux 3 Max Keyframes",
6668
+ modelId: "fal-ai-flux-3-max",
6669
+ workflow: "flux-3-max/keyframes-to-video",
6670
+ mode: "video",
6671
+ inputType: "i2v",
6672
+ addedAt: "2026-10-21",
6673
+ estimatedTime: 60,
6674
+ description: "Animate a video between up to 10 positioned keyframe images, with synchronized audio. Up to 20s at 1080p.",
6675
+ features: [
6676
+ feat("Multi-Image Input", "input"),
6677
+ feat("Audio", "audio"),
6678
+ feat("Up to 20s", "duration"),
6679
+ feat("1080p", "resolution")
6680
+ ],
6681
+ paramConfig: {
6682
+ ...params.prompt(),
6683
+ // imageUrls → keyframes[]; combined ≤10 is backend-enforced.
6684
+ ...params.imageInput(10, "Keyframes", true, "asset"),
6685
+ ...params.aspectRatio(flux3MaxAspectRatios, "16:9"),
6686
+ ...params.resolution(["720p", "1080p"], "720p"),
6687
+ ...params.durationRange(5, 20, 5),
6688
+ ...params.generateAudio(true),
6689
+ ...p.enum("reasoningLevel", ["low", "high"], "high", { label: "Reasoning" }),
6690
+ ...p.range("seed", -1, 2147483647, -1)
6691
+ }
6613
6692
  }
6614
6693
  ]);
6615
6694
 
@@ -6634,6 +6713,45 @@ var buildFlux3VideoPayload = (input) => {
6634
6713
  registerPayloads(MODELS20, {
6635
6714
  "flux-3-video": buildFlux3VideoPayload
6636
6715
  });
6716
+ var flux3MaxShared = (i) => ({
6717
+ aspect_ratio: i.aspectRatio ?? "16:9",
6718
+ resolution: i.resolution ?? "720p",
6719
+ duration: Number(i.duration ?? 5),
6720
+ generate_audio: i.generateAudio ?? true,
6721
+ reasoning_level: i.reasoningLevel ?? "high",
6722
+ // -1 is the "random seed" sentinel — omit so fal picks one.
6723
+ ...i.seed != null && i.seed !== -1 ? { seed: i.seed } : {}
6724
+ });
6725
+ var buildFlux3MaxPayload = (i) => ({
6726
+ prompt: i.prompt,
6727
+ ...flux3MaxShared(i)
6728
+ });
6729
+ var buildFlux3MaxEditPayload = (i) => ({
6730
+ prompt: i.prompt,
6731
+ image_url: i.startFrame,
6732
+ ...i.endFrame ? { end_image_url: i.endFrame } : {},
6733
+ ...flux3MaxShared(i)
6734
+ });
6735
+ var buildFlux3MaxKeyframesPayload = (i) => {
6736
+ const imgs = i.imageUrls ?? [];
6737
+ const last = Number(i.duration ?? 5) * 24;
6738
+ const keyframes = imgs.map((url, idx) => ({
6739
+ image_url: url,
6740
+ frame_index: imgs.length <= 1 ? 0 : Math.round(last * idx / (imgs.length - 1))
6741
+ }));
6742
+ return {
6743
+ prompt: i.prompt,
6744
+ keyframes,
6745
+ ...flux3MaxShared(i)
6746
+ };
6747
+ };
6748
+ registerPayloads(MODELS20, {
6749
+ "flux-3-max": buildFlux3MaxPayload,
6750
+ "flux-3-max-keyframes": buildFlux3MaxKeyframesPayload
6751
+ });
6752
+ registerEditPayloads(MODELS20, {
6753
+ "flux-3-max": buildFlux3MaxEditPayload
6754
+ });
6637
6755
 
6638
6756
  // src/vendors/catalog/gemini.ts
6639
6757
  function buildThinkingConfig(ctx) {
@@ -15059,6 +15177,8 @@ var Flux2Max = "flux-2-max";
15059
15177
  var Flux2Pro = "flux-2-pro";
15060
15178
  var Flux3Image = "flux-3-image";
15061
15179
  var Flux3ImageKlein = "flux-3-image-klein";
15180
+ var Flux3Max = "flux-3-max";
15181
+ var Flux3MaxKeyframes = "flux-3-max-keyframes";
15062
15182
  var Flux3Video = "flux-3-video";
15063
15183
  var FluxKontextMax = "flux-kontext-max";
15064
15184
  var FluxKontextPro = "flux-kontext-pro";
@@ -15323,6 +15443,8 @@ var Models = {
15323
15443
  Flux2Pro,
15324
15444
  Flux3Image,
15325
15445
  Flux3ImageKlein,
15446
+ Flux3Max,
15447
+ Flux3MaxKeyframes,
15326
15448
  Flux3Video,
15327
15449
  FluxKontextMax,
15328
15450
  FluxKontextPro,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "6.51.2",
3
+ "version": "6.52.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",