@picsart/ai-sdk 3.21.0 → 3.23.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 +17 -0
  2. package/index.js +84 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -161,6 +161,22 @@ type ModelInputById = {
161
161
  count?: 1 | 2 | 4 | 6 | 8 | 10;
162
162
  imageUrls?: string[];
163
163
  };
164
+ "flux-3-video": {
165
+ prompt: string;
166
+ model?: "flux-3-preview-high" | "flux-3-preview-optimized";
167
+ aspectRatio?: "auto" | "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16" | "9:21";
168
+ resolution?: "480p" | "720p";
169
+ duration?: "auto" | "5" | "10" | "15" | "20";
170
+ startFrame?: string;
171
+ endFrame?: string;
172
+ imageUrls?: string[];
173
+ videoUrl?: string;
174
+ videoUrls?: string[];
175
+ generateAudio?: boolean;
176
+ grounding?: boolean;
177
+ seed?: number;
178
+ version?: string;
179
+ };
164
180
  "flux-kontext-max": {
165
181
  prompt: string;
166
182
  aspectRatio?: "1:1" | "16:9" | "9:16" | "4:3" | "3:4" | "21:9" | "9:21";
@@ -2108,6 +2124,7 @@ declare const Models: {
2108
2124
  readonly Flux2Flex: "flux-2-flex";
2109
2125
  readonly Flux2Max: "flux-2-max";
2110
2126
  readonly Flux2Pro: "flux-2-pro";
2127
+ readonly Flux3Video: "flux-3-video";
2111
2128
  readonly FluxKontextMax: "flux-kontext-max";
2112
2129
  readonly FluxKontextPro: "flux-kontext-pro";
2113
2130
  readonly Gemini25FlashImage: "gemini-2.5-flash-image";
package/index.js CHANGED
@@ -5246,9 +5246,90 @@ var { MODELS: MODELS20 } = defineModels("flux", [
5246
5246
  ...params.count(),
5247
5247
  ...params.imageInput(1, "Source Image")
5248
5248
  }
5249
+ },
5250
+ {
5251
+ // Single workflow `flux/v1/video` handles t2v plus every conditioning
5252
+ // mode (i2v via start frame, morph via start/end frame, reference images,
5253
+ // reference video, video continuation) through optional inputs — no
5254
+ // editWorkflow needed. Payload assembly lives in flux.payloads.ts.
5255
+ id: "flux-3-video",
5256
+ name: "Flux 3 Video",
5257
+ workflow: "flux/v1/video",
5258
+ mode: "video",
5259
+ inputType: "t2v",
5260
+ release: "preview",
5261
+ addedAt: "2026-07-27",
5262
+ estimatedTime: 120,
5263
+ description: "Text-to-video with synchronized audio, plus image and video conditioning (continuation, references, first/last frame).",
5264
+ features: [
5265
+ feat("Image & Video Input", "input"),
5266
+ feat("Start/End Frame", "frame"),
5267
+ feat("Audio", "audio"),
5268
+ feat("Up to 20s", "duration"),
5269
+ feat("720p", "resolution")
5270
+ ],
5271
+ paramConfig: {
5272
+ ...params.prompt(),
5273
+ // Checkpoint: `high` (default, full conditioning + draft) vs `optimized`
5274
+ // (faster, text-to-video only). Sent as the wire `model` field.
5275
+ ...p.enum("model", [
5276
+ { id: "flux-3-preview-high", label: "High" },
5277
+ { id: "flux-3-preview-optimized", label: "Optimized" }
5278
+ ], "flux-3-preview-high", { label: "Model" }),
5279
+ ...params.aspectRatio(["auto", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16", "9:21"], "auto"),
5280
+ ...params.resolution(["480p", "720p"], "720p"),
5281
+ // 'auto' lets the model fit length; an explicit whole number is required
5282
+ // for a two-image (start+end) morph.
5283
+ ...p.enum("duration", ["auto", "5", "10", "15", "20"], "auto", { label: "Duration" }),
5284
+ // startFrame → keyframe @0 (i2v); endFrame → keyframe @duration×24 (morph).
5285
+ ...params.startFrame("Start Frame"),
5286
+ ...params.endFrame("End Frame"),
5287
+ // referenceImages (ir2v): who/what appears, never shown on screen.
5288
+ ...params.imageInput(10, "Reference Images", false, "reference"),
5289
+ // startVideo (f2v): continue from a clip's final frames.
5290
+ ...params.videoInput("Start Video", "asset", false, 15),
5291
+ // referenceVideo (vr2v): carry subjects into a brand-new clip.
5292
+ ...params.videoInputs(1, "Reference Video", false),
5293
+ ...params.generateAudio(true),
5294
+ ...p.boolean("grounding", true, "Grounding"),
5295
+ ...p.range("seed", 0, 4294967295, 0, { label: "Seed" }),
5296
+ ...p.text("version", { label: "Version", placeholder: "latest" })
5297
+ }
5249
5298
  }
5250
5299
  ]);
5251
5300
 
5301
+ // src/vendors/catalog/flux.payloads.ts
5302
+ var buildFlux3VideoPayload = (input) => {
5303
+ const duration = input.duration && input.duration !== "auto" ? Number(input.duration) : "auto";
5304
+ const keyframes = [];
5305
+ if (input.startFrame) keyframes.push({ imageUrl: input.startFrame, frameIndex: 0 });
5306
+ if (input.endFrame && typeof duration === "number") {
5307
+ keyframes.push({ imageUrl: input.endFrame, frameIndex: duration * 24 });
5308
+ }
5309
+ return {
5310
+ prompt: input.prompt,
5311
+ model: input.model ?? "flux-3-preview-high",
5312
+ aspectRatio: input.aspectRatio ?? "auto",
5313
+ resolution: input.resolution ?? "720p",
5314
+ duration,
5315
+ generateAudio: input.generateAudio ?? true,
5316
+ grounding: input.grounding ?? true,
5317
+ ...keyframes.length ? { keyframes } : {},
5318
+ // referenceImages (ir2v) — reference images that define who/what appears.
5319
+ ...input.imageUrls?.length ? { referenceImages: input.imageUrls } : {},
5320
+ // startVideo (f2v) — continue from a clip's final frames.
5321
+ ...input.videoUrl ? { startVideo: input.videoUrl } : {},
5322
+ // referenceVideo (vr2v) — carry a clip's subjects into a brand-new video.
5323
+ ...input.videoUrls?.length ? { referenceVideo: input.videoUrls[0] } : {},
5324
+ // seed omitted when unset → vendor randomizes.
5325
+ ...input.seed != null ? { seed: input.seed } : {},
5326
+ ...input.version ? { version: input.version } : {}
5327
+ };
5328
+ };
5329
+ registerPayloads(MODELS20, {
5330
+ "flux-3-video": buildFlux3VideoPayload
5331
+ });
5332
+
5252
5333
  // src/vendors/catalog/gemini.ts
5253
5334
  function buildThinkingConfig(ctx) {
5254
5335
  const tc = {};
@@ -6425,6 +6506,7 @@ var { MODELS: MODELS28 } = defineModels("qwen", [
6425
6506
  id: "qwen-image-3.0",
6426
6507
  name: "Qwen 3.0",
6427
6508
  addedAt: "2026-07-27",
6509
+ release: "preview",
6428
6510
  workflow: "qwen/v1/text-to-image",
6429
6511
  editWorkflow: "qwen/v1/image-to-image",
6430
6512
  buildPayload: buildQwenV1("qwen-image-3.0"),
@@ -9838,6 +9920,7 @@ var ElevenlabsSfx = "elevenlabs-sfx";
9838
9920
  var Flux2Flex = "flux-2-flex";
9839
9921
  var Flux2Max = "flux-2-max";
9840
9922
  var Flux2Pro = "flux-2-pro";
9923
+ var Flux3Video = "flux-3-video";
9841
9924
  var FluxKontextMax = "flux-kontext-max";
9842
9925
  var FluxKontextPro = "flux-kontext-pro";
9843
9926
  var Gemini25FlashImage = "gemini-2.5-flash-image";
@@ -10030,6 +10113,7 @@ var Models = {
10030
10113
  Flux2Flex,
10031
10114
  Flux2Max,
10032
10115
  Flux2Pro,
10116
+ Flux3Video,
10033
10117
  FluxKontextMax,
10034
10118
  FluxKontextPro,
10035
10119
  Gemini25FlashImage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "3.21.0",
3
+ "version": "3.23.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",