@picsart/ai-sdk 6.51.2 → 6.53.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 +37 -0
  2. package/index.js +209 -1
  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";
@@ -910,6 +931,18 @@ type ModelInputById = {
910
931
  imageUrls?: string[];
911
932
  imageWeight?: number;
912
933
  };
934
+ "ideogram-vector-1": {
935
+ prompt: string;
936
+ imageUrls?: string[];
937
+ aspectRatio?: "auto" | "1:1" | "16:9" | "9:16" | "4:3" | "3:4" | "3:2" | "2:3" | "5:4" | "4:5" | "16:10" | "10:16" | "2:1" | "1:2" | "3:1" | "1:3" | "4:1" | "1:4";
938
+ quality?: "low" | "medium" | "high";
939
+ count?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
940
+ seed?: number;
941
+ };
942
+ "ideogram-vector-1-vectorize": {
943
+ startFrame: string;
944
+ mode?: "default" | "simple";
945
+ };
913
946
  "kimi-k3": {
914
947
  prompt: string;
915
948
  imageUrls?: string[];
@@ -3544,6 +3577,8 @@ declare const Models: {
3544
3577
  readonly Flux2Pro: "flux-2-pro";
3545
3578
  readonly Flux3Image: "flux-3-image";
3546
3579
  readonly Flux3ImageKlein: "flux-3-image-klein";
3580
+ readonly Flux3Max: "flux-3-max";
3581
+ readonly Flux3MaxKeyframes: "flux-3-max-keyframes";
3547
3582
  readonly Flux3Video: "flux-3-video";
3548
3583
  readonly FluxKontextMax: "flux-kontext-max";
3549
3584
  readonly FluxKontextPro: "flux-kontext-pro";
@@ -3617,6 +3652,8 @@ declare const Models: {
3617
3652
  readonly IdeogramPImage: "ideogram-p-image";
3618
3653
  readonly IdeogramV3: "ideogram-v3";
3619
3654
  readonly IdeogramV4: "ideogram-v4";
3655
+ readonly IdeogramVector1: "ideogram-vector-1";
3656
+ readonly IdeogramVector1Vectorize: "ideogram-vector-1-vectorize";
3620
3657
  readonly KimiK3: "kimi-k3";
3621
3658
  readonly Kling30Image: "kling-3.0-image";
3622
3659
  readonly KlingAvatar: "kling-avatar";
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) {
@@ -8461,7 +8579,75 @@ var ideogram45Constraints = [
8461
8579
  resolution: { disabled: true, reason: "The output keeps the source image size." }
8462
8580
  } }
8463
8581
  ];
8582
+ var IDEOGRAM_VECTOR_IMAGE_BOUNDS = {
8583
+ maxBytes: 50 * 1024 * 1024
8584
+ };
8585
+ var IDEOGRAM_VECTOR_ASPECT_RATIOS = [
8586
+ "auto",
8587
+ "1:1",
8588
+ "16:9",
8589
+ "9:16",
8590
+ "4:3",
8591
+ "3:4",
8592
+ "3:2",
8593
+ "2:3",
8594
+ "5:4",
8595
+ "4:5",
8596
+ "16:10",
8597
+ "10:16",
8598
+ "2:1",
8599
+ "1:2",
8600
+ "3:1",
8601
+ "1:3",
8602
+ "4:1",
8603
+ "1:4"
8604
+ ];
8605
+ var IDEOGRAM_VECTOR_QUALITIES = ["low", "medium", "high"];
8464
8606
  var { MODELS: MODELS25 } = defineModels("ideogram", [
8607
+ {
8608
+ id: "ideogram-vector-1",
8609
+ name: "Ideogram Vector",
8610
+ addedAt: "2026-10-21",
8611
+ workflow: "ideogram/vector/generate",
8612
+ // The worker returns SVG and exposes no format param.
8613
+ outputExtension: "svg",
8614
+ estimatedTime: 30,
8615
+ mode: "image",
8616
+ inputType: "t2i",
8617
+ description: "Ideogram Vector \u2014 SVG logos, icons and illustrations from a prompt, optionally guided by up to 5 reference images.",
8618
+ features: [feat("Vector/SVG", "characteristic"), feat("Reference Images", "input")],
8619
+ paramConfig: {
8620
+ ...params.prompt({ maxLength: 9500 }),
8621
+ // imageUrls[0] is the primary source; the rest are additional references.
8622
+ ...params.imageInput(5, "Reference Images", false, "reference", IDEOGRAM_VECTOR_IMAGE_BOUNDS),
8623
+ ...params.aspectRatio(IDEOGRAM_VECTOR_ASPECT_RATIOS, "auto"),
8624
+ ...p.quality(IDEOGRAM_VECTOR_QUALITIES, "medium"),
8625
+ ...params.count(IDEOGRAM_45_COUNTS, 1),
8626
+ ...params.seed()
8627
+ }
8628
+ },
8629
+ {
8630
+ id: "ideogram-vector-1-vectorize",
8631
+ name: "Ideogram Vectorize",
8632
+ addedAt: "2026-10-21",
8633
+ workflow: "ideogram/vector/vectorize",
8634
+ syncExecute: true,
8635
+ // The worker returns SVG and exposes no format param.
8636
+ outputExtension: "svg",
8637
+ estimatedTime: 8,
8638
+ mode: "image",
8639
+ inputType: "i2i",
8640
+ description: "Ideogram Vectorize \u2014 convert a raster image (JPEG, PNG or WebP) into an SVG.",
8641
+ features: [feat("Vector/SVG", "characteristic"), feat("Image to SVG", "input")],
8642
+ paramConfig: {
8643
+ ...params.startFrame("Source Image", true, IDEOGRAM_VECTOR_IMAGE_BOUNDS),
8644
+ // `simple` traces fewer, simpler shapes; `default` preserves finer details.
8645
+ ...p.enum("mode", [
8646
+ { id: "default", label: "Detailed" },
8647
+ { id: "simple", label: "Simple" }
8648
+ ], "default", { label: "Detail" })
8649
+ }
8650
+ },
8465
8651
  {
8466
8652
  id: "ideogram-4-5",
8467
8653
  name: "Ideogram 4.5",
@@ -8760,9 +8946,23 @@ var buildIdeogram45PreciseEditPayload = (input) => {
8760
8946
  ...input.enableCopyrightDetection ? { enable_copyright_detection: true } : {}
8761
8947
  };
8762
8948
  };
8949
+ var buildIdeogramVectorPayload = (input) => ({
8950
+ prompt: input.prompt,
8951
+ ...input.imageUrls?.length ? { images: input.imageUrls } : {},
8952
+ ...input.aspectRatio ? { aspect_ratio: input.aspectRatio } : {},
8953
+ quality: input.quality ?? "medium",
8954
+ num_images: input.count ?? 1,
8955
+ ...input.seed != null ? { seed: input.seed } : {}
8956
+ });
8957
+ var buildIdeogramVectorizePayload = (input) => ({
8958
+ image: input.startFrame,
8959
+ mode: input.mode ?? "default"
8960
+ });
8763
8961
  registerPayloads(MODELS25, {
8764
8962
  "ideogram-4-5": buildIdeogram45Payload,
8765
- "ideogram-4-5-precise-edit": buildIdeogram45PreciseEditPayload
8963
+ "ideogram-4-5-precise-edit": buildIdeogram45PreciseEditPayload,
8964
+ "ideogram-vector-1": buildIdeogramVectorPayload,
8965
+ "ideogram-vector-1-vectorize": buildIdeogramVectorizePayload
8766
8966
  });
8767
8967
 
8768
8968
  // src/vendors/catalog/qwen.ts
@@ -15059,6 +15259,8 @@ var Flux2Max = "flux-2-max";
15059
15259
  var Flux2Pro = "flux-2-pro";
15060
15260
  var Flux3Image = "flux-3-image";
15061
15261
  var Flux3ImageKlein = "flux-3-image-klein";
15262
+ var Flux3Max = "flux-3-max";
15263
+ var Flux3MaxKeyframes = "flux-3-max-keyframes";
15062
15264
  var Flux3Video = "flux-3-video";
15063
15265
  var FluxKontextMax = "flux-kontext-max";
15064
15266
  var FluxKontextPro = "flux-kontext-pro";
@@ -15132,6 +15334,8 @@ var IdeogramCharacter = "ideogram-character";
15132
15334
  var IdeogramPImage = "ideogram-p-image";
15133
15335
  var IdeogramV3 = "ideogram-v3";
15134
15336
  var IdeogramV4 = "ideogram-v4";
15337
+ var IdeogramVector1 = "ideogram-vector-1";
15338
+ var IdeogramVector1Vectorize = "ideogram-vector-1-vectorize";
15135
15339
  var KimiK3 = "kimi-k3";
15136
15340
  var Kling30Image = "kling-3.0-image";
15137
15341
  var KlingAvatar = "kling-avatar";
@@ -15323,6 +15527,8 @@ var Models = {
15323
15527
  Flux2Pro,
15324
15528
  Flux3Image,
15325
15529
  Flux3ImageKlein,
15530
+ Flux3Max,
15531
+ Flux3MaxKeyframes,
15326
15532
  Flux3Video,
15327
15533
  FluxKontextMax,
15328
15534
  FluxKontextPro,
@@ -15396,6 +15602,8 @@ var Models = {
15396
15602
  IdeogramPImage,
15397
15603
  IdeogramV3,
15398
15604
  IdeogramV4,
15605
+ IdeogramVector1,
15606
+ IdeogramVector1Vectorize,
15399
15607
  KimiK3,
15400
15608
  Kling30Image,
15401
15609
  KlingAvatar,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "6.51.2",
3
+ "version": "6.53.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",