@picsart/ai-sdk 6.10.0 → 6.10.1

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.
@@ -111,7 +111,7 @@ interface SpeakerVoiceConfig$2 {
111
111
  speaker: string;
112
112
  voiceConfig: VoiceConfig$2;
113
113
  }
114
- type GeminiModel$1 = "gemini-2.5-pro" | "gemini-2.5-flash" | "gemini-embedding-exp" | "gemini-3-pro" | "gemini-3-pro-preview" | "gemini-3.1-pro-preview" | "gemini-3.1-flash-lite" | "gemini-3.5-flash-lite" | "gemini-3.6-flash" | "gemini-3.7-flash" | "gemini-3.8-flash" | "gemini-3.1-flash-lite-preview";
114
+ type GeminiModel$1 = "gemini-2.5-pro" | "gemini-2.5-flash" | "gemini-embedding-exp" | "gemini-2.5-flash-image" | "gemini-3-pro-image" | "gemini-3-pro-image-preview" | "gemini-3.1-flash-image" | "gemini-3.1-flash-image-preview" | "gemini-3-pro" | "gemini-3-pro-preview" | "gemini-3.1-pro-preview" | "gemini-3.1-flash-lite" | "gemini-3.5-flash-lite" | "gemini-3.6-flash" | "gemini-3.7-flash" | "gemini-3.8-flash" | "gemini-3.1-flash-lite-preview";
115
115
  interface GeminiResult$1 {
116
116
  id: string;
117
117
  status: "ACCEPTED" | "IN_PROGRESS" | "COMPLETED" | "FAILED";
@@ -476,7 +476,7 @@ interface SpeakerVoiceConfig$1 {
476
476
  speaker: string;
477
477
  voiceConfig: VoiceConfig$1;
478
478
  }
479
- type GeminiModel = "gemini-2.5-pro" | "gemini-2.5-flash" | "gemini-embedding-exp" | "gemini-3-pro" | "gemini-3-pro-preview" | "gemini-3.1-pro-preview" | "gemini-3.1-flash-lite" | "gemini-3.5-flash-lite" | "gemini-3.6-flash" | "gemini-3.7-flash" | "gemini-3.8-flash" | "gemini-3.1-flash-lite-preview";
479
+ type GeminiModel = "gemini-2.5-pro" | "gemini-2.5-flash" | "gemini-embedding-exp" | "gemini-2.5-flash-image" | "gemini-3-pro-image" | "gemini-3-pro-image-preview" | "gemini-3.1-flash-image" | "gemini-3.1-flash-image-preview" | "gemini-3-pro" | "gemini-3-pro-preview" | "gemini-3.1-pro-preview" | "gemini-3.1-flash-lite" | "gemini-3.5-flash-lite" | "gemini-3.6-flash" | "gemini-3.7-flash" | "gemini-3.8-flash" | "gemini-3.1-flash-lite-preview";
480
480
  interface GeminiResult {
481
481
  id: string;
482
482
  status: "ACCEPTED" | "IN_PROGRESS" | "COMPLETED" | "FAILED";
@@ -776,7 +776,7 @@ interface ClaudeV1MessagesCommand {
776
776
  context_management?: ClaudeContextManagement;
777
777
  options?: GenAIOptions$2A;
778
778
  }
779
- type ClaudeV1Models = "claude-opus-4-8" | "claude-opus-5" | "claude-sonnet-4-5" | "claude-sonnet-4-6" | "claude-sonnet-5" | "claude-3-7-sonnet" | "claude-3-5-sonnet" | "claude-3-5-haiku-latest" | "claude-haiku-4-5" | "claude-sonnet-4-0" | "claude-opus-4-0" | "claude-opus-4-5" | "claude-fable-5" | "claude-fable-5-1";
779
+ type ClaudeV1Models = "claude-opus-4-8" | "claude-opus-5" | "claude-sonnet-4-5" | "claude-sonnet-4-6" | "claude-sonnet-5" | "claude-haiku-4-5" | "claude-fable-5" | "claude-fable-5-1";
780
780
  interface ClaudeMessageParam {
781
781
  role: string;
782
782
  content: ClaudeContentBlock[];
@@ -5568,6 +5568,7 @@ interface GeneratedImageResult$4 {
5568
5568
  interface SeedanceCommand {
5569
5569
  model?: SeedanceModelAlias;
5570
5570
  content?: ContentItem[];
5571
+ draft?: boolean;
5571
5572
  resolution?: Resolution;
5572
5573
  ratio?: Ratio;
5573
5574
  output_format?: OutputFormat;
@@ -5585,9 +5586,10 @@ interface ContentItem {
5585
5586
  image_url?: ImageUrl;
5586
5587
  video_url?: VideoUrl;
5587
5588
  audio_url?: AudioUrl;
5589
+ draft_task?: DraftTask;
5588
5590
  role?: FrameRole;
5589
5591
  }
5590
- type ContentType = "text" | "image_url" | "video_url" | "audio_url";
5592
+ type ContentType = "text" | "image_url" | "video_url" | "audio_url" | "draft_task";
5591
5593
  interface ImageUrl {
5592
5594
  url: string;
5593
5595
  }
@@ -5597,6 +5599,11 @@ interface VideoUrl {
5597
5599
  interface AudioUrl {
5598
5600
  url: string;
5599
5601
  }
5602
+ interface DraftTask {
5603
+ id: string;
5604
+ video_input: boolean;
5605
+ signature: string;
5606
+ }
5600
5607
  type FrameRole = "first_frame" | "last_frame" | "reference_image" | "reference_video" | "reference_audio";
5601
5608
  type Resolution = "480p" | "720p" | "1080p" | "4k";
5602
5609
  type Ratio = "16:9" | "4:3" | "1:1" | "3:4" | "9:16" | "21:9" | "adaptive";
@@ -5628,6 +5635,7 @@ interface GeneratedVideoResult$3 {
5628
5635
  video_url: string;
5629
5636
  last_frame_url?: string;
5630
5637
  output_format?: string;
5638
+ draft_task?: Record<string, unknown>;
5631
5639
  mimeType?: string;
5632
5640
  driveFile?: Record<string, unknown>;
5633
5641
  }
@@ -8904,7 +8912,6 @@ interface SegmentAnythingSam3Command {
8904
8912
  prompt: string;
8905
8913
  score_threshold?: number;
8906
8914
  mask_threshold?: number;
8907
- model?: string;
8908
8915
  }
8909
8916
  interface SegmentAnythingSam3Response {
8910
8917
  id: string;
@@ -12118,6 +12125,96 @@ interface LTXV23ImageToVideoFastResponse {
12118
12125
  };
12119
12126
  }
12120
12127
 
12128
+ interface LTXV23ReframeVideoRequest {
12129
+ resolution?: "720p" | "1080p";
12130
+ aspect_ratio?: "1:1" | "4:5" | "5:4" | "9:16" | "16:9";
12131
+ video_url: string;
12132
+ options?: {
12133
+ safety_checks?: {
12134
+ enabled?: boolean;
12135
+ };
12136
+ drive?: {
12137
+ name: string;
12138
+ attributes?: Record<string, string>;
12139
+ folder?: {
12140
+ path?: string;
12141
+ id?: string;
12142
+ };
12143
+ };
12144
+ };
12145
+ }
12146
+ interface Ltx23ReframeResponse {
12147
+ id: string;
12148
+ status: "ACCEPTED" | "IN_PROGRESS" | "COMPLETED" | "FAILED";
12149
+ result: LTXV23ReframeVideoResponse;
12150
+ }
12151
+ interface LTXV23ReframeVideoResponse {
12152
+ video: {
12153
+ content_type?: string | unknown;
12154
+ fps?: number | unknown;
12155
+ width?: number | unknown;
12156
+ num_frames?: number | unknown;
12157
+ file_size?: number | unknown;
12158
+ file_name?: string | unknown;
12159
+ duration?: number | unknown;
12160
+ height?: number | unknown;
12161
+ url: string;
12162
+ };
12163
+ }
12164
+
12165
+ interface LTX23QualityOutpaintInput {
12166
+ guidance_scale?: number;
12167
+ enable_prompt_expansion?: boolean;
12168
+ num_inference_steps?: number;
12169
+ prompt: string;
12170
+ generate_audio?: boolean;
12171
+ enable_safety_checker?: boolean;
12172
+ frames_per_second?: number;
12173
+ seed?: number | unknown;
12174
+ video_url: string;
12175
+ num_frames?: number;
12176
+ resolution?: {
12177
+ height?: number;
12178
+ width?: number;
12179
+ } | "auto" | "square_hd" | "square" | "portrait_4_3" | "portrait_16_9" | "landscape_4_3" | "landscape_16_9";
12180
+ output_resolution?: "480p" | "720p" | "1080p";
12181
+ negative_prompt?: string;
12182
+ video_strength?: number;
12183
+ aspect_ratio?: "21:9" | "16:9" | "4:3" | "1:1" | "3:4" | "9:16" | "9:21";
12184
+ sync_mode?: boolean;
12185
+ video_write_mode?: "fast" | "balanced" | "small";
12186
+ video_quality?: "low" | "medium" | "high" | "maximum";
12187
+ source_scale?: number;
12188
+ options?: {
12189
+ safety_checks?: {
12190
+ enabled?: boolean;
12191
+ };
12192
+ drive?: {
12193
+ name: string;
12194
+ attributes?: Record<string, string>;
12195
+ folder?: {
12196
+ path?: string;
12197
+ id?: string;
12198
+ };
12199
+ };
12200
+ };
12201
+ }
12202
+ interface Ltx23QualityOutpaintResponse {
12203
+ id: string;
12204
+ status: "ACCEPTED" | "IN_PROGRESS" | "COMPLETED" | "FAILED";
12205
+ result: LTX23QualityOutput;
12206
+ }
12207
+ interface LTX23QualityOutput {
12208
+ prompt: string;
12209
+ seed: number;
12210
+ video: {
12211
+ url: string;
12212
+ content_type?: string | unknown;
12213
+ file_size?: number | unknown;
12214
+ file_name?: string | unknown;
12215
+ };
12216
+ }
12217
+
12121
12218
  interface WorkflowTypes {
12122
12219
  'check-text': {
12123
12220
  params: CheckTextCommand;
@@ -13227,6 +13324,14 @@ interface WorkflowTypes {
13227
13324
  params: LTXV25ImageToVideoFastRequest;
13228
13325
  result: LightricksLtx25ImageToVideoFastResponse;
13229
13326
  };
13327
+ 'ltx-2.3/reframe': {
13328
+ params: LTXV23ReframeVideoRequest;
13329
+ result: Ltx23ReframeResponse;
13330
+ };
13331
+ 'ltx-2.3-quality/outpaint': {
13332
+ params: LTX23QualityOutpaintInput;
13333
+ result: Ltx23QualityOutpaintResponse;
13334
+ };
13230
13335
  }
13231
13336
 
13232
13337
  export type { WorkflowTypes };
package/index.d.ts CHANGED
@@ -1607,7 +1607,7 @@ type ModelInputById = {
1607
1607
  videoUrls: [string, ...string[]];
1608
1608
  };
1609
1609
  "seedance-2.5": {
1610
- prompt: string;
1610
+ prompt?: string;
1611
1611
  aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
1612
1612
  resolution?: "480p" | "720p" | "1080p";
1613
1613
  duration?: number;
@@ -1615,6 +1615,12 @@ type ModelInputById = {
1615
1615
  returnLastFrame?: boolean;
1616
1616
  outputFormat?: "mp4" | "mov";
1617
1617
  colorDepth?: "10bit" | "8bit";
1618
+ draft?: boolean;
1619
+ draftTask?: {
1620
+ id: string;
1621
+ video_input: boolean;
1622
+ signature: string;
1623
+ };
1618
1624
  imageUrls?: string[];
1619
1625
  videoUrls?: string[];
1620
1626
  audioUrls?: string[];
@@ -1629,6 +1635,7 @@ type ModelInputById = {
1629
1635
  returnLastFrame?: boolean;
1630
1636
  outputFormat?: "mp4" | "mov";
1631
1637
  colorDepth?: "10bit" | "8bit";
1638
+ draft?: boolean;
1632
1639
  videoUrl: string;
1633
1640
  imageUrls?: string[];
1634
1641
  };
@@ -1640,10 +1647,11 @@ type ModelInputById = {
1640
1647
  generateAudio?: boolean;
1641
1648
  outputFormat?: "mp4" | "mov";
1642
1649
  colorDepth?: "10bit" | "8bit";
1650
+ draft?: boolean;
1643
1651
  videoUrls: [string, ...string[]];
1644
1652
  };
1645
1653
  "seedance-2.5-without-moderation": {
1646
- prompt: string;
1654
+ prompt?: string;
1647
1655
  aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive";
1648
1656
  resolution?: "480p" | "720p" | "1080p";
1649
1657
  duration?: number;
@@ -1651,6 +1659,12 @@ type ModelInputById = {
1651
1659
  returnLastFrame?: boolean;
1652
1660
  outputFormat?: "mp4" | "mov";
1653
1661
  colorDepth?: "10bit" | "8bit";
1662
+ draft?: boolean;
1663
+ draftTask?: {
1664
+ id: string;
1665
+ video_input: boolean;
1666
+ signature: string;
1667
+ };
1654
1668
  imageUrls?: string[];
1655
1669
  videoUrls?: string[];
1656
1670
  audioUrls?: string[];
@@ -1665,6 +1679,7 @@ type ModelInputById = {
1665
1679
  returnLastFrame?: boolean;
1666
1680
  outputFormat?: "mp4" | "mov";
1667
1681
  colorDepth?: "10bit" | "8bit";
1682
+ draft?: boolean;
1668
1683
  videoUrl: string;
1669
1684
  imageUrls?: string[];
1670
1685
  };
@@ -1676,6 +1691,7 @@ type ModelInputById = {
1676
1691
  generateAudio?: boolean;
1677
1692
  outputFormat?: "mp4" | "mov";
1678
1693
  colorDepth?: "10bit" | "8bit";
1694
+ draft?: boolean;
1679
1695
  videoUrls: [string, ...string[]];
1680
1696
  };
1681
1697
  "seedance-i2v": {
@@ -2707,6 +2723,17 @@ interface GenerateResultItemMetadata {
2707
2723
  /** URL of the generated video's last frame, when the model was asked for it
2708
2724
  * (`returnLastFrame`, seedance) — the seed for frame-chaining flows. */
2709
2725
  lastFrameUrl?: string;
2726
+ /** The draft a Seedance 2.5 Draft generation produced — pass it back
2727
+ * unchanged as `draftTask` to the matching `-draft-final` model to render
2728
+ * the final 1080p video (valid 7 days). Wire field names on purpose: the
2729
+ * worker signs it, so any change is rejected. */
2730
+ draftTask?: SeedanceDraftTask;
2731
+ }
2732
+ /** A Seedance 2.5 draft reference, as the worker issues it. */
2733
+ interface SeedanceDraftTask {
2734
+ id: string;
2735
+ video_input: boolean;
2736
+ signature: string;
2710
2737
  }
2711
2738
 
2712
2739
  /**
@@ -3416,4 +3443,4 @@ declare const getModel: (id: string) => ModelDefinition | undefined;
3416
3443
  */
3417
3444
  declare const findModel: (ref: string) => ModelDefinition | undefined;
3418
3445
 
3419
- export { ALL_MODELS, type AiClient, ApiError, type ApiErrorCode, type ApiErrorInit, type ApiResponse, type ApiRunOptions, type ApiSchemas, type ApisClient, type AppIdentity, type AppType, type AuthenticatedFetch, type AvatarOption, type BooleanDescriptor, type BooleanEntry, type CatalogDescriptor, type CatalogEntry, type CatalogItem, type CatalogPage, type CatalogPageOptions, type CatalogPreview, type CatalogQuery, type CatalogResult, type CatalogSource, type CatalogsClient, type CatalogsOptions, type ClientConfig, type CreditRange, type CreditRangeContext, type CreditTier, type CreditUsage, DEFAULT_VISIBLE_RELEASES, type DeepLinkResult, type DriveAttributes, type DriveClient, type DriveConfig, type DriveFile, type DriveFileDetails, type DriveFolder, type DriveMediaItem, type DriveSaveResult, type EntryMeta, type EnumDescriptor, type EnumEntry, type EnumOption, type FileDescriptor, type FileEntry, type FlatParamEntry, type GenerateOptions, type GenerateResult, type GenerateResultItem, type GenerateResultItemMetadata, type GenerateTextResult, type GenerationContext, type GenerationEvent, GenerationEventType, type GenerationFile, type GenerationMode, type GenerationOptions, type GenerationProgress, type ListOptions, type MediaModelId, type MediaTypeFilter, Model, type ModelDefinition, type ModelDescriptor, type ModelFilter, type ModelInput, type ModelInputById, type ModelMeta, type ModelParams, type ModelParamsAccessor, Models, type ObjectDescriptor, type ObjectEntry, type ParamDescriptor, type ParamEntry, type ParamOption, type PayloadDriveFolderOptions, type PayloadDriveOptions, type PayloadInputsTransformationOptions, type PricingOptions, type ProviderInfo, type RangeDescriptor, type RangeEntry, type ReleaseTag, type SaveParams, type SdkPayload, type SdkTransport, type TextDescriptor, type TextEntry, type TextModelId, type TextModelInputById, type ToolUsage, type TransportPollOptions, type TransportResult, type TypedModelId, type UserReaction, type ValidationResult, type VoiceOption, type WorkflowJobHandle, type WorkflowSubmitRequest, buildFilename, buildGenerationAttributes, catalog, createClient, decodeDeepLinkPayload, encodeDeepLinkPayload, findModel, getModel, getModelsByMode, getVoiceById, inferResourceType, isVisibleForReleases, parseGeneration, releaseOf, toAvatarOption, toVoiceOption };
3446
+ export { ALL_MODELS, type AiClient, ApiError, type ApiErrorCode, type ApiErrorInit, type ApiResponse, type ApiRunOptions, type ApiSchemas, type ApisClient, type AppIdentity, type AppType, type AuthenticatedFetch, type AvatarOption, type BooleanDescriptor, type BooleanEntry, type CatalogDescriptor, type CatalogEntry, type CatalogItem, type CatalogPage, type CatalogPageOptions, type CatalogPreview, type CatalogQuery, type CatalogResult, type CatalogSource, type CatalogsClient, type CatalogsOptions, type ClientConfig, type CreditRange, type CreditRangeContext, type CreditTier, type CreditUsage, DEFAULT_VISIBLE_RELEASES, type DeepLinkResult, type DriveAttributes, type DriveClient, type DriveConfig, type DriveFile, type DriveFileDetails, type DriveFolder, type DriveMediaItem, type DriveSaveResult, type EntryMeta, type EnumDescriptor, type EnumEntry, type EnumOption, type FileDescriptor, type FileEntry, type FlatParamEntry, type GenerateOptions, type GenerateResult, type GenerateResultItem, type GenerateResultItemMetadata, type GenerateTextResult, type GenerationContext, type GenerationEvent, GenerationEventType, type GenerationFile, type GenerationMode, type GenerationOptions, type GenerationProgress, type ListOptions, type MediaModelId, type MediaTypeFilter, Model, type ModelDefinition, type ModelDescriptor, type ModelFilter, type ModelInput, type ModelInputById, type ModelMeta, type ModelParams, type ModelParamsAccessor, Models, type ObjectDescriptor, type ObjectEntry, type ParamDescriptor, type ParamEntry, type ParamOption, type PayloadDriveFolderOptions, type PayloadDriveOptions, type PayloadInputsTransformationOptions, type PricingOptions, type ProviderInfo, type RangeDescriptor, type RangeEntry, type ReleaseTag, type SaveParams, type SdkPayload, type SdkTransport, type SeedanceDraftTask, type TextDescriptor, type TextEntry, type TextModelId, type TextModelInputById, type ToolUsage, type TransportPollOptions, type TransportResult, type TypedModelId, type UserReaction, type ValidationResult, type VoiceOption, type WorkflowJobHandle, type WorkflowSubmitRequest, buildFilename, buildGenerationAttributes, catalog, createClient, decodeDeepLinkPayload, encodeDeepLinkPayload, findModel, getModel, getModelsByMode, getVoiceById, inferResourceType, isVisibleForReleases, parseGeneration, releaseOf, toAvatarOption, toVoiceOption };
package/index.js CHANGED
@@ -4051,7 +4051,61 @@ var seedance25OutputFormat = (ctx) => {
4051
4051
  if (ctx.outputFormat === "mov") return "mov";
4052
4052
  return ctx.colorDepth === "8bit" ? "mp4_8bit" : "mp4";
4053
4053
  };
4054
- var buildSeedance25PayloadFor = (modelAlias) => (ctx) => {
4054
+ var SEEDANCE_25_DRAFT_RESOLUTION = "480p";
4055
+ var SEEDANCE_25_DRAFT_FINAL_RESOLUTION = "1080p";
4056
+ var withSeedance25DraftMode = (modelAlias, build) => (ctx) => {
4057
+ const { draft, draftTask } = ctx;
4058
+ if (draftTask) {
4059
+ const sentContent = build(ctx).content ?? [];
4060
+ return {
4061
+ model: modelAlias,
4062
+ content: [{ type: "draft_task", draft_task: draftTask }, ...sentContent],
4063
+ resolution: ctx.resolution ?? SEEDANCE_25_DRAFT_FINAL_RESOLUTION,
4064
+ output_format: seedance25OutputFormat(ctx),
4065
+ ...ctx.returnLastFrame ? { return_last_frame: true } : {},
4066
+ ...ctx.aspectRatio !== void 0 ? { ratio: ctx.aspectRatio } : {},
4067
+ ...ctx.duration !== void 0 ? { duration: ctx.duration } : {},
4068
+ ...ctx.generateAudio !== void 0 ? { generate_audio: ctx.generateAudio } : {},
4069
+ ...draft !== void 0 ? { draft } : {}
4070
+ };
4071
+ }
4072
+ const payload = build(ctx);
4073
+ return draft ? { ...payload, draft: true, resolution: ctx.resolution ?? SEEDANCE_25_DRAFT_RESOLUTION } : payload;
4074
+ };
4075
+ var SEEDANCE_25_DRAFT_RESOLUTION_REASON = "Draft previews render at 480p only.";
4076
+ var SEEDANCE_25_DRAFT_FINAL_RESOLUTION_REASON = "The final video from a draft renders at 1080p only.";
4077
+ var SEEDANCE_25_DRAFT_REUSED_REASON = "A final from a draft reuses the draft's settings.";
4078
+ var seedance25DraftConstraints = [
4079
+ {
4080
+ when: { draft: { is: true } },
4081
+ then: { resolution: { allowed: [SEEDANCE_25_DRAFT_RESOLUTION], reason: SEEDANCE_25_DRAFT_RESOLUTION_REASON } }
4082
+ }
4083
+ ];
4084
+ var seedance25DraftFinalConstraints = [
4085
+ ...seedance25DraftConstraints,
4086
+ {
4087
+ when: { draftTask: { exists: true } },
4088
+ then: {
4089
+ resolution: { allowed: [SEEDANCE_25_DRAFT_FINAL_RESOLUTION], reason: SEEDANCE_25_DRAFT_FINAL_RESOLUTION_REASON },
4090
+ draft: { disabled: true, reason: "A final video is rendered from a draft, not as one." },
4091
+ ...Object.fromEntries([
4092
+ "prompt",
4093
+ "imageUrls",
4094
+ "videoUrls",
4095
+ "audioUrls",
4096
+ "startFrame",
4097
+ "endFrame",
4098
+ "aspectRatio",
4099
+ "duration",
4100
+ "generateAudio"
4101
+ ].map((key) => [
4102
+ key,
4103
+ { disabled: true, reason: SEEDANCE_25_DRAFT_REUSED_REASON }
4104
+ ]))
4105
+ }
4106
+ }
4107
+ ];
4108
+ var buildSeedance25PayloadFor = (modelAlias) => withSeedance25DraftMode(modelAlias, (ctx) => {
4055
4109
  const refImages = ctx.imageUrls ?? [];
4056
4110
  const refVideos = ctx.videoUrls ?? [];
4057
4111
  const refAudios = ctx.audioUrls ?? [];
@@ -4076,7 +4130,9 @@ var buildSeedance25PayloadFor = (modelAlias) => (ctx) => {
4076
4130
  role: "reference_audio"
4077
4131
  })),
4078
4132
  ...ctx.endFrame ? [{ type: "image_url", image_url: { url: ctx.endFrame }, role: "last_frame" }] : [],
4079
- { type: "text", text: ctx.prompt }
4133
+ // The prompt is optional on 2.5 (media-only input is valid); an empty
4134
+ // text item is not sent.
4135
+ ...ctx.prompt?.trim() ? [{ type: "text", text: ctx.prompt }] : []
4080
4136
  ],
4081
4137
  ratio: usesFrame ? "adaptive" : ctx.aspectRatio ?? "16:9",
4082
4138
  duration: ctx.duration ?? 5,
@@ -4085,8 +4141,8 @@ var buildSeedance25PayloadFor = (modelAlias) => (ctx) => {
4085
4141
  output_format: seedance25OutputFormat(ctx),
4086
4142
  ...ctx.returnLastFrame ? { return_last_frame: true } : {}
4087
4143
  };
4088
- };
4089
- var buildSeedance25VideoEditPayloadFor = (modelAlias) => (ctx) => ({
4144
+ });
4145
+ var buildSeedance25VideoEditPayloadFor = (modelAlias) => withSeedance25DraftMode(modelAlias, (ctx) => ({
4090
4146
  model: modelAlias,
4091
4147
  content: [
4092
4148
  { type: "text", text: ctx.prompt },
@@ -4103,8 +4159,8 @@ var buildSeedance25VideoEditPayloadFor = (modelAlias) => (ctx) => ({
4103
4159
  generate_audio: ctx.generateAudio ?? true,
4104
4160
  output_format: seedance25OutputFormat(ctx),
4105
4161
  ...ctx.returnLastFrame ? { return_last_frame: true } : {}
4106
- });
4107
- var buildSeedance25VideoExtendPayloadFor = (modelAlias) => (ctx) => ({
4162
+ }));
4163
+ var buildSeedance25VideoExtendPayloadFor = (modelAlias) => withSeedance25DraftMode(modelAlias, (ctx) => ({
4108
4164
  model: modelAlias,
4109
4165
  content: [
4110
4166
  { type: "text", text: ctx.prompt },
@@ -4119,12 +4175,27 @@ var buildSeedance25VideoExtendPayloadFor = (modelAlias) => (ctx) => ({
4119
4175
  resolution: ctx.resolution ?? "1080p",
4120
4176
  generate_audio: ctx.generateAudio ?? true,
4121
4177
  output_format: seedance25OutputFormat(ctx)
4122
- });
4178
+ }));
4123
4179
  var SEEDANCE_AR = ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "adaptive"];
4124
4180
  var SEEDANCE_25_FORMATS = ["mp4", "mov"];
4125
4181
  var SEEDANCE_25_COLOR_DEPTHS = ["10bit", "8bit"];
4126
4182
  var SEEDANCE_V2_DURATIONS = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
4127
4183
  var SEEDANCE_25_DURATION = { min: 4, max: 30 };
4184
+ var seedance25DraftParam = p.boolean("draft", false, "Draft");
4185
+ var seedance25DraftTaskParam = {
4186
+ draftTask: {
4187
+ label: "Draft",
4188
+ required: false,
4189
+ descriptor: {
4190
+ kind: "object",
4191
+ fields: {
4192
+ id: { kind: "text" },
4193
+ video_input: { kind: "boolean", default: false },
4194
+ signature: { kind: "text" }
4195
+ }
4196
+ }
4197
+ }
4198
+ };
4128
4199
  var { MODELS: MODELS12 } = defineModels("seedance", [
4129
4200
  {
4130
4201
  id: "seedance-2.5",
@@ -4133,7 +4204,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4133
4204
  addedAt: "2026-08-06",
4134
4205
  workflow: "seedance",
4135
4206
  buildPayload: buildSeedance25PayloadFor("seedance_2_5"),
4136
- constraints: seedance25Constraints,
4207
+ constraints: [...seedance25Constraints, ...seedance25DraftFinalConstraints],
4137
4208
  estimatedTime: 20,
4138
4209
  mode: "video",
4139
4210
  inputType: "t2v",
@@ -4141,7 +4212,9 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4141
4212
  description: "Latest cinematic video with audio, multi-reference input, and mp4/mov output in 10- or 8-bit. Up to 30s.",
4142
4213
  features: [feat("Reference Image", "frame"), feat("Start/End Frame", "frame"), feat("Audio", "audio"), feat("1080p", "resolution"), feat("4-30 sec", "duration")],
4143
4214
  paramConfig: {
4144
- ...params.prompt(),
4215
+ // Optional on 2.5 (media-only input is valid) — and a final from a
4216
+ // draft must not carry one (the vendor refuses it).
4217
+ ...params.prompt({ required: false }),
4145
4218
  ...params.aspectRatio(SEEDANCE_AR),
4146
4219
  ...params.resolution(["480p", "720p", "1080p"], "1080p"),
4147
4220
  ...params.durationRange(SEEDANCE_25_DURATION.min, SEEDANCE_25_DURATION.max, 5),
@@ -4149,6 +4222,8 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4149
4222
  ...params.returnLastFrame(),
4150
4223
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
4151
4224
  ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
4225
+ ...seedance25DraftParam,
4226
+ ...seedance25DraftTaskParam,
4152
4227
  // 2.5 lifts the reference caps to 30 images / 10 videos / 10 audios.
4153
4228
  ...params.imageInput(30, "Reference Images", false, "reference", SEEDANCE_IMAGE_BOUNDS),
4154
4229
  ...params.videoInputs(10, "Reference Videos", false, SEEDANCE_25_VIDEO_BOUNDS),
@@ -4168,7 +4243,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4168
4243
  release: "preview",
4169
4244
  workflow: "seedance",
4170
4245
  buildPayload: buildSeedance25PayloadFor("seedance_2_5_without_moderation"),
4171
- constraints: seedance25Constraints,
4246
+ constraints: [...seedance25Constraints, ...seedance25DraftFinalConstraints],
4172
4247
  estimatedTime: 20,
4173
4248
  mode: "video",
4174
4249
  inputType: "t2v",
@@ -4176,7 +4251,9 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4176
4251
  description: "Seedance 2.5 with vendor moderation disabled \u2014 cinematic video with audio, multi-reference input, and mp4/mov output in 10- or 8-bit. Up to 30s.",
4177
4252
  features: [feat("Reference Image", "frame"), feat("Start/End Frame", "frame"), feat("Audio", "audio"), feat("1080p", "resolution"), feat("4-30 sec", "duration")],
4178
4253
  paramConfig: {
4179
- ...params.prompt(),
4254
+ // Optional on 2.5 (media-only input is valid) — and a final from a
4255
+ // draft must not carry one (the vendor refuses it).
4256
+ ...params.prompt({ required: false }),
4180
4257
  ...params.aspectRatio(SEEDANCE_AR),
4181
4258
  ...params.resolution(["480p", "720p", "1080p"], "1080p"),
4182
4259
  ...params.durationRange(SEEDANCE_25_DURATION.min, SEEDANCE_25_DURATION.max, 5),
@@ -4184,6 +4261,8 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4184
4261
  ...params.returnLastFrame(),
4185
4262
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
4186
4263
  ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
4264
+ ...seedance25DraftParam,
4265
+ ...seedance25DraftTaskParam,
4187
4266
  // 2.5 lifts the reference caps to 30 images / 10 videos / 10 audios.
4188
4267
  ...params.imageInput(30, "Reference Images", false, "reference", SEEDANCE_IMAGE_BOUNDS),
4189
4268
  ...params.videoInputs(10, "Reference Videos", false, SEEDANCE_25_VIDEO_BOUNDS),
@@ -4199,7 +4278,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4199
4278
  addedAt: "2026-08-06",
4200
4279
  workflow: "seedance",
4201
4280
  buildPayload: buildSeedance25VideoEditPayloadFor("seedance_2_5"),
4202
- constraints: seedance25ColorDepthConstraints,
4281
+ constraints: [...seedance25ColorDepthConstraints, ...seedance25DraftConstraints],
4203
4282
  estimatedTime: 60,
4204
4283
  mode: "video",
4205
4284
  inputType: "v2v",
@@ -4216,6 +4295,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4216
4295
  ...params.returnLastFrame(),
4217
4296
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
4218
4297
  ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
4298
+ ...seedance25DraftParam,
4219
4299
  // Every limit rides in `bounds`; the positional maxDuration / maxShortSide
4220
4300
  // / maxBytes args predate it and are skipped rather than duplicated.
4221
4301
  ...params.videoInput("Source Video", "reference", true, void 0, void 0, void 0, SEEDANCE_25_VIDEO_BOUNDS),
@@ -4230,7 +4310,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4230
4310
  release: "preview",
4231
4311
  workflow: "seedance",
4232
4312
  buildPayload: buildSeedance25VideoEditPayloadFor("seedance_2_5_without_moderation"),
4233
- constraints: seedance25ColorDepthConstraints,
4313
+ constraints: [...seedance25ColorDepthConstraints, ...seedance25DraftConstraints],
4234
4314
  estimatedTime: 60,
4235
4315
  mode: "video",
4236
4316
  inputType: "v2v",
@@ -4247,6 +4327,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4247
4327
  ...params.returnLastFrame(),
4248
4328
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
4249
4329
  ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
4330
+ ...seedance25DraftParam,
4250
4331
  // Every limit rides in `bounds`; the positional maxDuration / maxShortSide
4251
4332
  // / maxBytes args predate it and are skipped rather than duplicated.
4252
4333
  ...params.videoInput("Source Video", "reference", true, void 0, void 0, void 0, SEEDANCE_25_VIDEO_BOUNDS),
@@ -4260,7 +4341,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4260
4341
  addedAt: "2026-08-06",
4261
4342
  workflow: "seedance",
4262
4343
  buildPayload: buildSeedance25VideoExtendPayloadFor("seedance_2_5"),
4263
- constraints: seedance25ColorDepthConstraints,
4344
+ constraints: [...seedance25ColorDepthConstraints, ...seedance25DraftConstraints],
4264
4345
  estimatedTime: 200,
4265
4346
  mode: "video",
4266
4347
  inputType: "v2v",
@@ -4277,6 +4358,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4277
4358
  ...params.generateAudio(),
4278
4359
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
4279
4360
  ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
4361
+ ...seedance25DraftParam,
4280
4362
  ...params.videoInputs(10, "Source Videos", true, SEEDANCE_25_VIDEO_BOUNDS)
4281
4363
  }
4282
4364
  },
@@ -4288,7 +4370,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4288
4370
  release: "preview",
4289
4371
  workflow: "seedance",
4290
4372
  buildPayload: buildSeedance25VideoExtendPayloadFor("seedance_2_5_without_moderation"),
4291
- constraints: seedance25ColorDepthConstraints,
4373
+ constraints: [...seedance25ColorDepthConstraints, ...seedance25DraftConstraints],
4292
4374
  estimatedTime: 200,
4293
4375
  mode: "video",
4294
4376
  inputType: "v2v",
@@ -4305,6 +4387,7 @@ var { MODELS: MODELS12 } = defineModels("seedance", [
4305
4387
  ...params.generateAudio(),
4306
4388
  ...p.enum("outputFormat", SEEDANCE_25_FORMATS, "mp4", { label: "Format" }),
4307
4389
  ...p.enum("colorDepth", SEEDANCE_25_COLOR_DEPTHS, "10bit", { label: "Color Depth" }),
4390
+ ...seedance25DraftParam,
4308
4391
  ...params.videoInputs(10, "Source Videos", true, SEEDANCE_25_VIDEO_BOUNDS)
4309
4392
  }
4310
4393
  },
@@ -10168,6 +10251,10 @@ var extractAllResults = (result) => {
10168
10251
  }
10169
10252
  return items.length > 0 ? items : void 0;
10170
10253
  };
10254
+ var isSeedanceDraftTask = (value) => {
10255
+ const v = value;
10256
+ return !!v && typeof v === "object" && typeof v.id === "string" && typeof v.video_input === "boolean" && typeof v.signature === "string";
10257
+ };
10171
10258
  function buildItemMetadata(parsed, item, _index, provider) {
10172
10259
  const meta = {};
10173
10260
  const top = parsed && typeof parsed === "object" ? parsed : void 0;
@@ -10176,6 +10263,10 @@ function buildItemMetadata(parsed, item, _index, provider) {
10176
10263
  if (provider === "elevenlabs" && typeof it?.generated_voice_id === "string") meta.generatedVoiceId = it.generated_voice_id;
10177
10264
  const lastFrame = it?.last_frame_url ?? top?.last_frame_url;
10178
10265
  if (typeof lastFrame === "string") meta.lastFrameUrl = lastFrame;
10266
+ const draftTask = top?.draft_task;
10267
+ if (provider === "seedance" && isSeedanceDraftTask(draftTask)) {
10268
+ meta.draftTask = { id: draftTask.id, video_input: draftTask.video_input, signature: draftTask.signature };
10269
+ }
10179
10270
  return Object.keys(meta).length > 0 ? meta : void 0;
10180
10271
  }
10181
10272
  function toCompletedStatus(handle, result, raw, usage) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "6.10.0",
3
+ "version": "6.10.1",
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",