@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/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
- style?: "korean_baseball" | "pet_skateboard" | "daily_ootd" | "tiny_beast_printer" | "landmark_reveal" | "winter_charm" | "flash_ride" | "maestro_of_magic" | "magic_carpet_ride" | "good_luck_spirit" | "shooting_star" | "sparkler_wand" | "sovereign_scepter" | "dirt_rush" | "return_of_the_king" | "dance_with_dragon" | "minimalist_light" | "martial_meow" | "sassy_shake" | "knock_at_a_door_revenge" | "palm_sized_figure_pro" | "prank_box" | "perler_beads" | "spring_bloom" | "toss_run" | "switch_to_silk" | "get_rich_quick" | "make_it_rain" | "twist_shake" | "the_hip_sway" | "send_my_love" | "funky_martian" | "wealth_drive" | "the_high_kick" | "the_exercise" | "lucky_veggie" | "studio_look" | "flash_drive" | "shush_my_dreams" | "french_elegance" | "finger_swipe" | "advent_of_flora" | "smooth_transition" | "kiss_pro" | "raid_check" | "snow_night_kiss" | "eternal_kiss" | "fortune_in_motion" | "chinese_trend" | "sedan_chair_dance" | "skyfall" | "good_luck_dance" | "laicai_dance" | "yangge_dance" | "color_mixing" | "palm_sized_figure" | "lantern_festival_cuju" | "unique_firework" | "unique_spring_couplets" | "horse_mask" | "fortune_knocks_cartoon" | "tangyuan_to_animal" | "hot_feet_dance" | "swag_dance" | "pigeon_dance" | "bloodline_dance" | "chanel_dance" | "cute_dance" | "love_theme_song" | "pumpitup_dance" | "city_to_village" | "fortune_god_transform" | "new_year_feast" | "ring_in_new" | "horse_year_firework" | "pet_vlogger" | "crystal_horse" | "lateral_shift_transition" | "drunk_dance" | "drunk_dance_pet" | "daoma_dance" | "bouncy_dance" | "smooth_sailing_dance" | "new_year_greeting" | "lion_dance" | "prosperity" | "great_success" | "golden_horse_fortune" | "red_packet_box" | "lucky_horse_year" | "lucky_red_packet" | "lucky_money_come" | "lion_dance_pet" | "dumpling_making_pet" | "fish_making_pet" | "pet_red_packet" | "lantern_glow" | "expression_challenge" | "overdrive" | "heart_gesture_dance" | "poping" | "martial_arts" | "running" | "nezha" | "motorcycle_dance" | "subject_3_dance" | "ghost_step_dance" | "phantom_jewel" | "zoom_out" | "cheers_2026" | "fight_pro" | "hug_pro" | "heart_gesture_pro" | "dollar_rain_pro" | "pet_bee_pro" | "countdown_teleport" | "santa_random_surprise" | "magic_match_tree" | "bullet_time_360" | "happy_birthday" | "birthday_star" | "thumbs_up_pro" | "tiger_hug_pro" | "pet_lion_pro" | "surprise_bouquet" | "bouquet_drop" | "3d_cartoon_1_pro" | "firework_2026" | "glamour_photo_shoot" | "box_of_joy" | "first_toast_of_the_year" | "my_santa_pic" | "santa_gift" | "steampunk_christmas" | "snowglobe" | "christmas_photo_shoot" | "ornament_crash" | "santa_express" | "instant_christmas" | "particle_santa_surround" | "coronation_of_frost" | "building_sweater" | "spark_in_the_snow" | "scarlet_and_snow" | "cozy_toon_wrap" | "bullet_time_lite" | "magic_cloak" | "balloon_parade" | "jumping_ginger_joy" | "bullet_time" | "c4d_cartoon_pro" | "pure_white_wings" | "black_wings" | "golden_wing" | "pink_pink_wings" | "venomous_spider" | "throne_of_king" | "luminous_elf" | "woodland_elf" | "japanese_anime_1" | "american_comics" | "guardian_spirit" | "swish_swish" | "snowboarding" | "witch_transform" | "vampire_transform" | "pumpkin_head_transform" | "demon_transform" | "mummy_transform" | "zombie_transform" | "cute_pumpkin_transform" | "cute_ghost_transform" | "knock_knock_halloween" | "halloween_escape" | "baseball" | "inner_voice" | "a_list_look" | "memory_alive" | "trampoline" | "trampoline_night" | "pucker_up" | "guess_what" | "feed_mooncake" | "rampage_ape" | "flyer" | "dishwasher" | "pet_chinese_opera" | "magic_fireball" | "gallery_ring" | "pet_moto_rider" | "muscle_pet" | "squeeze_scream" | "pet_delivery" | "running_man" | "disappear" | "mythic_style" | "steampunk" | "3d_cartoon_2" | "eagle_snatch" | "hug_from_past" | "firework" | "media_interview" | "pet_chef" | "santa_gifts" | "santa_hug" | "heart_gesture_1" | "pet_wizard" | "smoke_smoke" | "instant_kid" | "dollar_rain" | "cry_cry" | "building_collapse" | "gun_shot" | "mushroom" | "double_gun" | "pet_warrior" | "lightning_power" | "jesus_hug" | "shark_alert" | "long_hair" | "lie_flat" | "polar_bear_hug" | "brown_bear_hug" | "jazz_jazz" | "office_escape_plow" | "fly_fly" | "watermelon_bomb" | "pet_dance" | "boss_coming" | "wool_curly" | "pet_bee" | "marry_me" | "swing_swing" | "day_to_night" | "piggy_morph" | "wig_out" | "car_explosion" | "ski_ski" | "siblings" | "construction_worker" | "let's_ride" | "snatched" | "magic_broom" | "felt_felt" | "jumpdrop" | "surfsurf" | "fairy_wing" | "angel_wing" | "dark_wing" | "skateskate" | "plushcut" | "jelly_press" | "jelly_slice" | "jelly_squish" | "jelly_jiggle" | "pixelpixel" | "yearbook" | "instant_film" | "anime_figure" | "rocketrocket" | "bloombloom" | "dizzydizzy" | "fuzzyfuzzy" | "squish" | "expansion" | "emoji" | "tennis_trend" | "whirling_beverage" | "f1_live" | "football_live" | "spielberg_transition";
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
- * Voice/avatar catalogs — the standard format served by the platform
2141
- * `<vendor>/v1/catalog/<voices|avatars>` tasks, plus the in-memory hydration
2142
- * registry that lets runtime-fetched catalogs back the descriptor system.
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 (voiceId / videoId). */
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 voice/avatar catalog tasks
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 accumulate into the
2230
- * model's `voiceId` options, so pickers see everything loaded so far.
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
- /** Effect scenes that require two input images (e.g. hugs, kisses, swaps). */
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 };