@picsart/ai-sdk 5.7.0 → 5.9.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/README.md +2 -3
- package/_vendor/workflows-types/index.d.ts +1428 -1348
- package/index.d.ts +46 -10
- package/index.js +155 -306
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -305,6 +305,14 @@ type ModelInputById = {
|
|
|
305
305
|
count?: 1 | 2 | 4;
|
|
306
306
|
imageUrls?: string[];
|
|
307
307
|
};
|
|
308
|
+
"grok-imagine-image-2.0": {
|
|
309
|
+
prompt: string;
|
|
310
|
+
aspectRatio?: "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";
|
|
311
|
+
resolution?: "1k" | "2k";
|
|
312
|
+
quality?: "low" | "medium";
|
|
313
|
+
count?: 1 | 2 | 4;
|
|
314
|
+
imageUrls?: string[];
|
|
315
|
+
};
|
|
308
316
|
"grok-imagine-image-quality": {
|
|
309
317
|
prompt: string;
|
|
310
318
|
aspectRatio?: "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";
|
|
@@ -629,7 +637,7 @@ type ModelInputById = {
|
|
|
629
637
|
staticMask?: string;
|
|
630
638
|
};
|
|
631
639
|
"kling-video-effects": {
|
|
632
|
-
|
|
640
|
+
templateId?: string;
|
|
633
641
|
imageUrls: [string, ...string[]];
|
|
634
642
|
};
|
|
635
643
|
"kling-video-o1": {
|
|
@@ -796,6 +804,14 @@ type ModelInputById = {
|
|
|
796
804
|
"picsart-enhance": {
|
|
797
805
|
imageUrls: [string, ...string[]];
|
|
798
806
|
};
|
|
807
|
+
"picsart-flow": {
|
|
808
|
+
templateId: string;
|
|
809
|
+
imageUrls: [string, ...string[]];
|
|
810
|
+
};
|
|
811
|
+
"picsart-flow-video": {
|
|
812
|
+
templateId: string;
|
|
813
|
+
imageUrls: [string, ...string[]];
|
|
814
|
+
};
|
|
799
815
|
"picsart-flux-2-klein": {
|
|
800
816
|
prompt: string;
|
|
801
817
|
aspectRatio?: "1:1" | "5:3" | "3:5" | "4:3" | "3:4";
|
|
@@ -2009,6 +2025,12 @@ interface GenerationContext {
|
|
|
2009
2025
|
/** Recraft V4 Styles — style-reference image URLs (max 5, t2i only).
|
|
2010
2026
|
* Required: the V4 Styles API rejects requests without a style. */
|
|
2011
2027
|
styleReferenceUrls?: string[];
|
|
2028
|
+
/**
|
|
2029
|
+
* Effect template id — a catalog-served content preset id (e.g. a Kling effect
|
|
2030
|
+
* scene from `kling/v1/catalog/templates`). Free string; the live catalog is
|
|
2031
|
+
* the source of truth.
|
|
2032
|
+
*/
|
|
2033
|
+
templateId?: string;
|
|
2012
2034
|
quality?: string;
|
|
2013
2035
|
size?: string;
|
|
2014
2036
|
negativePrompt?: string;
|
|
@@ -2137,9 +2159,10 @@ interface ModelDefinition {
|
|
|
2137
2159
|
}
|
|
2138
2160
|
|
|
2139
2161
|
/**
|
|
2140
|
-
*
|
|
2141
|
-
* `<vendor>/v1/catalog/<voices|avatars
|
|
2142
|
-
* registry that lets runtime-fetched
|
|
2162
|
+
* Runtime catalogs — the standard format served by the platform
|
|
2163
|
+
* `<vendor>/v1/catalog/<voices|avatars|…>` tasks (voices, avatars, effect
|
|
2164
|
+
* templates), plus the in-memory hydration registry that lets runtime-fetched
|
|
2165
|
+
* catalogs back the descriptor system.
|
|
2143
2166
|
*
|
|
2144
2167
|
* The wire types mirror the shared backend contract (`@picsart/pa-genai-common`);
|
|
2145
2168
|
* the SDK owns its own copy so it carries no backend dependency.
|
|
@@ -2151,7 +2174,7 @@ interface CatalogPreview {
|
|
|
2151
2174
|
audioUrl?: string;
|
|
2152
2175
|
}
|
|
2153
2176
|
interface CatalogItem {
|
|
2154
|
-
/** Vendor-native id, sent back verbatim on generate
|
|
2177
|
+
/** Vendor-native id, sent back verbatim on generate as the bound param's value. */
|
|
2155
2178
|
id: string;
|
|
2156
2179
|
name: string;
|
|
2157
2180
|
description?: string;
|
|
@@ -2178,6 +2201,7 @@ interface CatalogResult {
|
|
|
2178
2201
|
/** `null` when the list is complete. */
|
|
2179
2202
|
nextCursor: string | null;
|
|
2180
2203
|
}
|
|
2204
|
+
/** @deprecated No longer drives behavior — catalogs are addressed by param key. */
|
|
2181
2205
|
type CatalogKind = 'voices' | 'avatars';
|
|
2182
2206
|
/** Binds a param's options to a platform catalog task. */
|
|
2183
2207
|
interface CatalogSource {
|
|
@@ -2190,8 +2214,9 @@ declare function toVoiceOption(item: CatalogItem, provider: Provider): VoiceOpti
|
|
|
2190
2214
|
declare function toAvatarOption(item: CatalogItem, provider: Provider): AvatarOption;
|
|
2191
2215
|
|
|
2192
2216
|
/**
|
|
2193
|
-
* ai.catalogs — runtime access to the platform
|
|
2194
|
-
* (`<vendor>/v1/catalog/<voices|avatars
|
|
2217
|
+
* ai.catalogs — runtime access to the platform catalog tasks
|
|
2218
|
+
* (`<vendor>/v1/catalog/<voices|avatars|…>`) serving any catalog-bound param
|
|
2219
|
+
* (`kind: 'catalog'` descriptor): voices, avatars, effect templates.
|
|
2195
2220
|
*
|
|
2196
2221
|
* Loading is page-by-page: each call fetches ONE page (UI loads more on
|
|
2197
2222
|
* scroll/pagination via `nextCursor`). Pages are cached per the `ttlSeconds`
|
|
@@ -2226,12 +2251,15 @@ interface CatalogPageOptions {
|
|
|
2226
2251
|
}
|
|
2227
2252
|
interface CatalogsClient {
|
|
2228
2253
|
/**
|
|
2229
|
-
* One page of the model's voice catalog. Fetched pages
|
|
2230
|
-
*
|
|
2254
|
+
* One page of the model's voice catalog (`voiceId` param). Fetched pages
|
|
2255
|
+
* accumulate into `Model(id).params().catalog('voiceId').catalogOptions`,
|
|
2256
|
+
* so pickers see everything loaded so far.
|
|
2231
2257
|
*/
|
|
2232
2258
|
voices(model: ModelId, options?: CatalogPageOptions): Promise<CatalogPage>;
|
|
2233
2259
|
/** One page of the model's avatar catalog — same semantics, for `videoId`. */
|
|
2234
2260
|
avatars(model: ModelId, options?: CatalogPageOptions): Promise<CatalogPage>;
|
|
2261
|
+
/** One page of the model's effect-template catalog — same semantics, for `templateId`. */
|
|
2262
|
+
templates(model: ModelId, options?: CatalogPageOptions): Promise<CatalogPage>;
|
|
2235
2263
|
}
|
|
2236
2264
|
interface CatalogsOptions {
|
|
2237
2265
|
/**
|
|
@@ -2446,6 +2474,7 @@ declare const Models: {
|
|
|
2446
2474
|
readonly GrokEditVideo: "grok-edit-video";
|
|
2447
2475
|
readonly GrokExtendVideo: "grok-extend-video";
|
|
2448
2476
|
readonly GrokImagineImage: "grok-imagine-image";
|
|
2477
|
+
readonly GrokImagineImage20: "grok-imagine-image-2.0";
|
|
2449
2478
|
readonly GrokImagineImageQuality: "grok-imagine-image-quality";
|
|
2450
2479
|
readonly GrokImagineVideo: "grok-imagine-video";
|
|
2451
2480
|
readonly GrokImagineVideo15: "grok-imagine-video-1.5";
|
|
@@ -2512,6 +2541,8 @@ declare const Models: {
|
|
|
2512
2541
|
readonly Ovi: "ovi";
|
|
2513
2542
|
readonly PicsartChangeBg: "picsart-change-bg";
|
|
2514
2543
|
readonly PicsartEnhance: "picsart-enhance";
|
|
2544
|
+
readonly PicsartFlow: "picsart-flow";
|
|
2545
|
+
readonly PicsartFlowVideo: "picsart-flow-video";
|
|
2515
2546
|
readonly PicsartFlux2Klein: "picsart-flux-2-klein";
|
|
2516
2547
|
readonly PicsartHidreamT2i: "picsart-hidream-t2i";
|
|
2517
2548
|
readonly PicsartQwenImageEdit: "picsart-qwen-image-edit";
|
|
@@ -2755,7 +2786,12 @@ declare const getModel: (id: string) => ModelDefinition | undefined;
|
|
|
2755
2786
|
/** Find a model by ID, workflow name, or display name (case-insensitive). */
|
|
2756
2787
|
declare const findModel: (ref: string) => ModelDefinition | undefined;
|
|
2757
2788
|
|
|
2758
|
-
/**
|
|
2789
|
+
/**
|
|
2790
|
+
* Effect scenes that require two input images (e.g. hugs, kisses, swaps).
|
|
2791
|
+
* @deprecated Read `meta.imageSlots` on the `kling/v1/catalog/templates`
|
|
2792
|
+
* catalog items instead — this frozen copy is no longer maintained and will be
|
|
2793
|
+
* removed in the next major.
|
|
2794
|
+
*/
|
|
2759
2795
|
declare const KLING_DUAL_IMAGE_EFFECTS: ReadonlySet<string>;
|
|
2760
2796
|
|
|
2761
2797
|
export { ALL_MODELS, type AiClient, 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 CatalogKind, type CatalogPage, type CatalogPageOptions, type CatalogPreview, type CatalogQuery, type CatalogResult, type CatalogSource, type CatalogsClient, type CatalogsOptions, type ClientConfig, type CreditRange, type CreditRangeContext, type CreditTier, 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 GenerateTextResult, type GenerationContext, type GenerationFile, type GenerationMode, KLING_DUAL_IMAGE_EFFECTS, type ListOptions, type MediaModelId, type MediaTypeFilter, Model, type ModelDefinition, type ModelDescriptor, type ModelFilter$1 as 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 PricingOptions, type ProviderInfo, type RangeDescriptor, type RangeEntry, type ReleaseTag, type SaveParams, type SdkPayload, type SdkTransport, type TextDescriptor, type TextEntry, type TextModelId, type TextModelInputById, type TypedModelId, type UserReaction, type ValidationResult$1 as ValidationResult, type VoiceOption, type WorkflowJobHandle, buildFilename, buildGenerationAttributes, catalog, createClient, decodeDeepLinkPayload, encodeDeepLinkPayload, findModel, getModel, getModelsByMode, getVoiceById, inferResourceType, isVisibleForReleases, parseGeneration, releaseOf, toAvatarOption, toVoiceOption };
|