@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.js
CHANGED
|
@@ -1067,6 +1067,20 @@ var p = {
|
|
|
1067
1067
|
}
|
|
1068
1068
|
};
|
|
1069
1069
|
},
|
|
1070
|
+
/**
|
|
1071
|
+
* Any param whose options are served by a platform catalog task (effect
|
|
1072
|
+
* templates, and anything the voiceId/videoId presets don't cover). The
|
|
1073
|
+
* value is a free-string id — the live catalog is the source of truth.
|
|
1074
|
+
*/
|
|
1075
|
+
catalog(key, cfg) {
|
|
1076
|
+
return {
|
|
1077
|
+
[key]: {
|
|
1078
|
+
label: cfg.label,
|
|
1079
|
+
required: cfg.required,
|
|
1080
|
+
descriptor: { kind: "catalog", source: cfg.source, default: cfg.default }
|
|
1081
|
+
}
|
|
1082
|
+
};
|
|
1083
|
+
},
|
|
1070
1084
|
voiceId(options, def, opts) {
|
|
1071
1085
|
return {
|
|
1072
1086
|
voiceId: {
|
|
@@ -1215,6 +1229,7 @@ var params = {
|
|
|
1215
1229
|
renderingSpeed: p.renderingSpeed,
|
|
1216
1230
|
voiceId: p.voiceId,
|
|
1217
1231
|
videoId: p.videoId,
|
|
1232
|
+
catalog: p.catalog,
|
|
1218
1233
|
language: p.language,
|
|
1219
1234
|
// File presets — key matches the runtime GenerationContext field name.
|
|
1220
1235
|
// `category` defaults to the most common role for the slot (overridable per call):
|
|
@@ -1451,283 +1466,6 @@ var klingOmniAdvancedParams = {
|
|
|
1451
1466
|
};
|
|
1452
1467
|
|
|
1453
1468
|
// src/vendors/catalog/kling/index.ts
|
|
1454
|
-
var KLING_EFFECT_SCENES = [
|
|
1455
|
-
"korean_baseball",
|
|
1456
|
-
"pet_skateboard",
|
|
1457
|
-
"daily_ootd",
|
|
1458
|
-
"tiny_beast_printer",
|
|
1459
|
-
"landmark_reveal",
|
|
1460
|
-
"winter_charm",
|
|
1461
|
-
"flash_ride",
|
|
1462
|
-
"maestro_of_magic",
|
|
1463
|
-
"magic_carpet_ride",
|
|
1464
|
-
"good_luck_spirit",
|
|
1465
|
-
"shooting_star",
|
|
1466
|
-
"sparkler_wand",
|
|
1467
|
-
"sovereign_scepter",
|
|
1468
|
-
"dirt_rush",
|
|
1469
|
-
"return_of_the_king",
|
|
1470
|
-
"dance_with_dragon",
|
|
1471
|
-
"minimalist_light",
|
|
1472
|
-
"martial_meow",
|
|
1473
|
-
"sassy_shake",
|
|
1474
|
-
"knock_at_a_door_revenge",
|
|
1475
|
-
"palm_sized_figure_pro",
|
|
1476
|
-
"prank_box",
|
|
1477
|
-
"perler_beads",
|
|
1478
|
-
"spring_bloom",
|
|
1479
|
-
"toss_run",
|
|
1480
|
-
"switch_to_silk",
|
|
1481
|
-
"get_rich_quick",
|
|
1482
|
-
"make_it_rain",
|
|
1483
|
-
"twist_shake",
|
|
1484
|
-
"the_hip_sway",
|
|
1485
|
-
"send_my_love",
|
|
1486
|
-
"funky_martian",
|
|
1487
|
-
"wealth_drive",
|
|
1488
|
-
"the_high_kick",
|
|
1489
|
-
"the_exercise",
|
|
1490
|
-
"lucky_veggie",
|
|
1491
|
-
"studio_look",
|
|
1492
|
-
"flash_drive",
|
|
1493
|
-
"shush_my_dreams",
|
|
1494
|
-
"french_elegance",
|
|
1495
|
-
"finger_swipe",
|
|
1496
|
-
"advent_of_flora",
|
|
1497
|
-
"smooth_transition",
|
|
1498
|
-
"kiss_pro",
|
|
1499
|
-
"raid_check",
|
|
1500
|
-
"snow_night_kiss",
|
|
1501
|
-
"eternal_kiss",
|
|
1502
|
-
"fortune_in_motion",
|
|
1503
|
-
"chinese_trend",
|
|
1504
|
-
"sedan_chair_dance",
|
|
1505
|
-
"skyfall",
|
|
1506
|
-
"good_luck_dance",
|
|
1507
|
-
"laicai_dance",
|
|
1508
|
-
"yangge_dance",
|
|
1509
|
-
"color_mixing",
|
|
1510
|
-
"palm_sized_figure",
|
|
1511
|
-
"lantern_festival_cuju",
|
|
1512
|
-
"unique_firework",
|
|
1513
|
-
"unique_spring_couplets",
|
|
1514
|
-
"horse_mask",
|
|
1515
|
-
"fortune_knocks_cartoon",
|
|
1516
|
-
"tangyuan_to_animal",
|
|
1517
|
-
"hot_feet_dance",
|
|
1518
|
-
"swag_dance",
|
|
1519
|
-
"pigeon_dance",
|
|
1520
|
-
"bloodline_dance",
|
|
1521
|
-
"chanel_dance",
|
|
1522
|
-
"cute_dance",
|
|
1523
|
-
"love_theme_song",
|
|
1524
|
-
"pumpitup_dance",
|
|
1525
|
-
"city_to_village",
|
|
1526
|
-
"fortune_god_transform",
|
|
1527
|
-
"new_year_feast",
|
|
1528
|
-
"ring_in_new",
|
|
1529
|
-
"horse_year_firework",
|
|
1530
|
-
"pet_vlogger",
|
|
1531
|
-
"crystal_horse",
|
|
1532
|
-
"lateral_shift_transition",
|
|
1533
|
-
"drunk_dance",
|
|
1534
|
-
"drunk_dance_pet",
|
|
1535
|
-
"daoma_dance",
|
|
1536
|
-
"bouncy_dance",
|
|
1537
|
-
"smooth_sailing_dance",
|
|
1538
|
-
"new_year_greeting",
|
|
1539
|
-
"lion_dance",
|
|
1540
|
-
"prosperity",
|
|
1541
|
-
"great_success",
|
|
1542
|
-
"golden_horse_fortune",
|
|
1543
|
-
"red_packet_box",
|
|
1544
|
-
"lucky_horse_year",
|
|
1545
|
-
"lucky_red_packet",
|
|
1546
|
-
"lucky_money_come",
|
|
1547
|
-
"lion_dance_pet",
|
|
1548
|
-
"dumpling_making_pet",
|
|
1549
|
-
"fish_making_pet",
|
|
1550
|
-
"pet_red_packet",
|
|
1551
|
-
"lantern_glow",
|
|
1552
|
-
"expression_challenge",
|
|
1553
|
-
"overdrive",
|
|
1554
|
-
"heart_gesture_dance",
|
|
1555
|
-
"poping",
|
|
1556
|
-
"martial_arts",
|
|
1557
|
-
"running",
|
|
1558
|
-
"nezha",
|
|
1559
|
-
"motorcycle_dance",
|
|
1560
|
-
"subject_3_dance",
|
|
1561
|
-
"ghost_step_dance",
|
|
1562
|
-
"phantom_jewel",
|
|
1563
|
-
"zoom_out",
|
|
1564
|
-
"cheers_2026",
|
|
1565
|
-
"fight_pro",
|
|
1566
|
-
"hug_pro",
|
|
1567
|
-
"heart_gesture_pro",
|
|
1568
|
-
"dollar_rain_pro",
|
|
1569
|
-
"pet_bee_pro",
|
|
1570
|
-
"countdown_teleport",
|
|
1571
|
-
"santa_random_surprise",
|
|
1572
|
-
"magic_match_tree",
|
|
1573
|
-
"bullet_time_360",
|
|
1574
|
-
"happy_birthday",
|
|
1575
|
-
"birthday_star",
|
|
1576
|
-
"thumbs_up_pro",
|
|
1577
|
-
"tiger_hug_pro",
|
|
1578
|
-
"pet_lion_pro",
|
|
1579
|
-
"surprise_bouquet",
|
|
1580
|
-
"bouquet_drop",
|
|
1581
|
-
"3d_cartoon_1_pro",
|
|
1582
|
-
"firework_2026",
|
|
1583
|
-
"glamour_photo_shoot",
|
|
1584
|
-
"box_of_joy",
|
|
1585
|
-
"first_toast_of_the_year",
|
|
1586
|
-
"my_santa_pic",
|
|
1587
|
-
"santa_gift",
|
|
1588
|
-
"steampunk_christmas",
|
|
1589
|
-
"snowglobe",
|
|
1590
|
-
"christmas_photo_shoot",
|
|
1591
|
-
"ornament_crash",
|
|
1592
|
-
"santa_express",
|
|
1593
|
-
"instant_christmas",
|
|
1594
|
-
"particle_santa_surround",
|
|
1595
|
-
"coronation_of_frost",
|
|
1596
|
-
"building_sweater",
|
|
1597
|
-
"spark_in_the_snow",
|
|
1598
|
-
"scarlet_and_snow",
|
|
1599
|
-
"cozy_toon_wrap",
|
|
1600
|
-
"bullet_time_lite",
|
|
1601
|
-
"magic_cloak",
|
|
1602
|
-
"balloon_parade",
|
|
1603
|
-
"jumping_ginger_joy",
|
|
1604
|
-
"bullet_time",
|
|
1605
|
-
"c4d_cartoon_pro",
|
|
1606
|
-
"pure_white_wings",
|
|
1607
|
-
"black_wings",
|
|
1608
|
-
"golden_wing",
|
|
1609
|
-
"pink_pink_wings",
|
|
1610
|
-
"venomous_spider",
|
|
1611
|
-
"throne_of_king",
|
|
1612
|
-
"luminous_elf",
|
|
1613
|
-
"woodland_elf",
|
|
1614
|
-
"japanese_anime_1",
|
|
1615
|
-
"american_comics",
|
|
1616
|
-
"guardian_spirit",
|
|
1617
|
-
"swish_swish",
|
|
1618
|
-
"snowboarding",
|
|
1619
|
-
"witch_transform",
|
|
1620
|
-
"vampire_transform",
|
|
1621
|
-
"pumpkin_head_transform",
|
|
1622
|
-
"demon_transform",
|
|
1623
|
-
"mummy_transform",
|
|
1624
|
-
"zombie_transform",
|
|
1625
|
-
"cute_pumpkin_transform",
|
|
1626
|
-
"cute_ghost_transform",
|
|
1627
|
-
"knock_knock_halloween",
|
|
1628
|
-
"halloween_escape",
|
|
1629
|
-
"baseball",
|
|
1630
|
-
"inner_voice",
|
|
1631
|
-
"a_list_look",
|
|
1632
|
-
"memory_alive",
|
|
1633
|
-
"trampoline",
|
|
1634
|
-
"trampoline_night",
|
|
1635
|
-
"pucker_up",
|
|
1636
|
-
"guess_what",
|
|
1637
|
-
"feed_mooncake",
|
|
1638
|
-
"rampage_ape",
|
|
1639
|
-
"flyer",
|
|
1640
|
-
"dishwasher",
|
|
1641
|
-
"pet_chinese_opera",
|
|
1642
|
-
"magic_fireball",
|
|
1643
|
-
"gallery_ring",
|
|
1644
|
-
"pet_moto_rider",
|
|
1645
|
-
"muscle_pet",
|
|
1646
|
-
"squeeze_scream",
|
|
1647
|
-
"pet_delivery",
|
|
1648
|
-
"running_man",
|
|
1649
|
-
"disappear",
|
|
1650
|
-
"mythic_style",
|
|
1651
|
-
"steampunk",
|
|
1652
|
-
"3d_cartoon_2",
|
|
1653
|
-
"eagle_snatch",
|
|
1654
|
-
"hug_from_past",
|
|
1655
|
-
"firework",
|
|
1656
|
-
"media_interview",
|
|
1657
|
-
"pet_chef",
|
|
1658
|
-
"santa_gifts",
|
|
1659
|
-
"santa_hug",
|
|
1660
|
-
"heart_gesture_1",
|
|
1661
|
-
"pet_wizard",
|
|
1662
|
-
"smoke_smoke",
|
|
1663
|
-
"instant_kid",
|
|
1664
|
-
"dollar_rain",
|
|
1665
|
-
"cry_cry",
|
|
1666
|
-
"building_collapse",
|
|
1667
|
-
"gun_shot",
|
|
1668
|
-
"mushroom",
|
|
1669
|
-
"double_gun",
|
|
1670
|
-
"pet_warrior",
|
|
1671
|
-
"lightning_power",
|
|
1672
|
-
"jesus_hug",
|
|
1673
|
-
"shark_alert",
|
|
1674
|
-
"long_hair",
|
|
1675
|
-
"lie_flat",
|
|
1676
|
-
"polar_bear_hug",
|
|
1677
|
-
"brown_bear_hug",
|
|
1678
|
-
"jazz_jazz",
|
|
1679
|
-
"office_escape_plow",
|
|
1680
|
-
"fly_fly",
|
|
1681
|
-
"watermelon_bomb",
|
|
1682
|
-
"pet_dance",
|
|
1683
|
-
"boss_coming",
|
|
1684
|
-
"wool_curly",
|
|
1685
|
-
"pet_bee",
|
|
1686
|
-
"marry_me",
|
|
1687
|
-
"swing_swing",
|
|
1688
|
-
"day_to_night",
|
|
1689
|
-
"piggy_morph",
|
|
1690
|
-
"wig_out",
|
|
1691
|
-
"car_explosion",
|
|
1692
|
-
"ski_ski",
|
|
1693
|
-
"siblings",
|
|
1694
|
-
"construction_worker",
|
|
1695
|
-
"let's_ride",
|
|
1696
|
-
"snatched",
|
|
1697
|
-
"magic_broom",
|
|
1698
|
-
"felt_felt",
|
|
1699
|
-
"jumpdrop",
|
|
1700
|
-
"surfsurf",
|
|
1701
|
-
"fairy_wing",
|
|
1702
|
-
"angel_wing",
|
|
1703
|
-
"dark_wing",
|
|
1704
|
-
"skateskate",
|
|
1705
|
-
"plushcut",
|
|
1706
|
-
"jelly_press",
|
|
1707
|
-
"jelly_slice",
|
|
1708
|
-
"jelly_squish",
|
|
1709
|
-
"jelly_jiggle",
|
|
1710
|
-
"pixelpixel",
|
|
1711
|
-
"yearbook",
|
|
1712
|
-
"instant_film",
|
|
1713
|
-
"anime_figure",
|
|
1714
|
-
"rocketrocket",
|
|
1715
|
-
"bloombloom",
|
|
1716
|
-
"dizzydizzy",
|
|
1717
|
-
"fuzzyfuzzy",
|
|
1718
|
-
"squish",
|
|
1719
|
-
"expansion",
|
|
1720
|
-
"emoji",
|
|
1721
|
-
"tennis_trend",
|
|
1722
|
-
"whirling_beverage",
|
|
1723
|
-
"f1_live",
|
|
1724
|
-
"football_live",
|
|
1725
|
-
"spielberg_transition"
|
|
1726
|
-
];
|
|
1727
|
-
var effectSceneStyles = KLING_EFFECT_SCENES.map((id) => ({
|
|
1728
|
-
id,
|
|
1729
|
-
label: id.split("_").map((w) => w[0].toUpperCase() + w.slice(1)).join(" ")
|
|
1730
|
-
}));
|
|
1731
1469
|
var KLING_DUAL_IMAGE_EFFECTS = /* @__PURE__ */ new Set([
|
|
1732
1470
|
"pet_skateboard",
|
|
1733
1471
|
"daily_ootd",
|
|
@@ -2218,10 +1956,14 @@ var { MODELS } = defineModels("kling", [
|
|
|
2218
1956
|
mode: "video",
|
|
2219
1957
|
inputType: "i2v",
|
|
2220
1958
|
badge: ["new"],
|
|
2221
|
-
description: "Apply
|
|
1959
|
+
description: "Apply 270+ visual effects to photos \u2014 single or dual-image scenes.",
|
|
2222
1960
|
features: [feat("Image Input", "input"), feat("Video Effects", "characteristic")],
|
|
2223
1961
|
paramConfig: {
|
|
2224
|
-
...params.
|
|
1962
|
+
...params.catalog("templateId", {
|
|
1963
|
+
label: "Effect",
|
|
1964
|
+
source: { workflow: "kling/v1/catalog/templates" },
|
|
1965
|
+
default: "korean_baseball"
|
|
1966
|
+
}),
|
|
2225
1967
|
...params.imageInput(2, "Effect Images", true)
|
|
2226
1968
|
}
|
|
2227
1969
|
},
|
|
@@ -2414,7 +2156,9 @@ var buildKlingElementsPayload = (input) => {
|
|
|
2414
2156
|
var buildKlingVideoEffectsPayload = (input) => {
|
|
2415
2157
|
const isDualEffect = input.imageUrls && input.imageUrls.length >= 2;
|
|
2416
2158
|
return {
|
|
2417
|
-
|
|
2159
|
+
// `style` carried the effect id before the catalog-bound `templateId` param
|
|
2160
|
+
// (4.1); persisted history still sends it. Alias removed in the next major.
|
|
2161
|
+
effect_scene: input.templateId ?? input.style,
|
|
2418
2162
|
...isDualEffect ? { images: input.imageUrls.slice(0, 2) } : input.imageUrls?.[0] ? { image: input.imageUrls[0] } : {}
|
|
2419
2163
|
};
|
|
2420
2164
|
};
|
|
@@ -4777,13 +4521,18 @@ function toAvatarOption(item, provider) {
|
|
|
4777
4521
|
};
|
|
4778
4522
|
}
|
|
4779
4523
|
var registry = /* @__PURE__ */ new Map();
|
|
4780
|
-
var keyOf = (s) => `${s.workflow}
|
|
4781
|
-
|
|
4524
|
+
var keyOf = (s) => `${s.workflow} ${s.modelId ?? ""}`;
|
|
4525
|
+
var OPTION_ADAPTERS = {
|
|
4526
|
+
voiceId: toVoiceOption,
|
|
4527
|
+
videoId: toAvatarOption
|
|
4528
|
+
};
|
|
4529
|
+
function installHydratedCatalog(source, paramKey, items, provider, version) {
|
|
4530
|
+
const adapt = OPTION_ADAPTERS[paramKey];
|
|
4782
4531
|
registry.set(keyOf(source), {
|
|
4783
|
-
|
|
4532
|
+
paramKey,
|
|
4784
4533
|
items,
|
|
4785
4534
|
options: items.map((i) => ({ id: i.id, label: i.name })),
|
|
4786
|
-
catalogOptions:
|
|
4535
|
+
catalogOptions: adapt ? items.map((i) => adapt(i, provider)) : items,
|
|
4787
4536
|
version
|
|
4788
4537
|
});
|
|
4789
4538
|
}
|
|
@@ -4793,7 +4542,7 @@ function getHydratedCatalog(source) {
|
|
|
4793
4542
|
function getHydratedVoices() {
|
|
4794
4543
|
const out = [];
|
|
4795
4544
|
for (const c of registry.values()) {
|
|
4796
|
-
if (c.
|
|
4545
|
+
if (c.paramKey === "voiceId") out.push(...c.catalogOptions);
|
|
4797
4546
|
}
|
|
4798
4547
|
return out;
|
|
4799
4548
|
}
|
|
@@ -5141,6 +4890,28 @@ var { MODELS: MODELS17 } = defineModels("grok", [
|
|
|
5141
4890
|
...params.imageInput(1, "Source Image")
|
|
5142
4891
|
}
|
|
5143
4892
|
},
|
|
4893
|
+
{
|
|
4894
|
+
id: "grok-imagine-image-2.0",
|
|
4895
|
+
name: "Grok Imagine 2.0",
|
|
4896
|
+
addedAt: "2026-08-19",
|
|
4897
|
+
workflow: "x-ai/v1/images/generations",
|
|
4898
|
+
editWorkflow: "x-ai/v1/images/edits",
|
|
4899
|
+
estimatedTime: 16,
|
|
4900
|
+
mode: "image",
|
|
4901
|
+
inputType: "t2i",
|
|
4902
|
+
description: "Latest Grok Imagine generation \u2014 sharper detail with a low/medium quality tier.",
|
|
4903
|
+
features: [feat("Image Input", "input"), feat("2k", "resolution")],
|
|
4904
|
+
paramConfig: {
|
|
4905
|
+
...params.prompt(),
|
|
4906
|
+
...params.aspectRatio(GROK_IMAGE_AR, "1:1"),
|
|
4907
|
+
...params.resolution(GROK_IMAGE_RESOLUTIONS, "1k"),
|
|
4908
|
+
// Vendor-side default is medium; only supported by grok-imagine-image-2.0
|
|
4909
|
+
// (generations only — the edits command has no quality field).
|
|
4910
|
+
...p.quality(["low", "medium"], "medium"),
|
|
4911
|
+
...params.count([1, 2, 4]),
|
|
4912
|
+
...params.imageInput(1, "Source Image")
|
|
4913
|
+
}
|
|
4914
|
+
},
|
|
5144
4915
|
// ── Audio ─────────────────────────────────────────
|
|
5145
4916
|
{
|
|
5146
4917
|
id: "grok-tts",
|
|
@@ -5162,6 +4933,33 @@ var { MODELS: MODELS17 } = defineModels("grok", [
|
|
|
5162
4933
|
}
|
|
5163
4934
|
]);
|
|
5164
4935
|
|
|
4936
|
+
// src/vendors/catalog/grok.payloads.ts
|
|
4937
|
+
var buildGrokImage2Payload = (input) => ({
|
|
4938
|
+
model: "grok-imagine-image-2.0",
|
|
4939
|
+
prompt: input.prompt,
|
|
4940
|
+
n: input.count ?? 1,
|
|
4941
|
+
...input.aspectRatio ? { aspect_ratio: input.aspectRatio } : {},
|
|
4942
|
+
...input.resolution ? { resolution: input.resolution } : {},
|
|
4943
|
+
...input.quality ? { quality: input.quality } : {}
|
|
4944
|
+
});
|
|
4945
|
+
var buildGrokImage2EditPayload = (input) => {
|
|
4946
|
+
const urls = input.imageUrls ?? [];
|
|
4947
|
+
const imagePart2 = urls.length > 1 ? { images: urls.map((url) => ({ url })) } : urls.length === 1 ? { image: { url: urls[0] } } : {};
|
|
4948
|
+
return {
|
|
4949
|
+
model: "grok-imagine-image-2.0",
|
|
4950
|
+
prompt: input.prompt,
|
|
4951
|
+
n: input.count ?? 1,
|
|
4952
|
+
...input.resolution ? { resolution: input.resolution } : {},
|
|
4953
|
+
...imagePart2
|
|
4954
|
+
};
|
|
4955
|
+
};
|
|
4956
|
+
registerPayloads(MODELS17, {
|
|
4957
|
+
"grok-imagine-image-2.0": buildGrokImage2Payload
|
|
4958
|
+
});
|
|
4959
|
+
registerEditPayloads(MODELS17, {
|
|
4960
|
+
"grok-imagine-image-2.0": buildGrokImage2EditPayload
|
|
4961
|
+
});
|
|
4962
|
+
|
|
5165
4963
|
// src/vendors/catalog/pika.ts
|
|
5166
4964
|
var PIKA_RATIO_MAP = {
|
|
5167
4965
|
"16:9": 1.77,
|
|
@@ -7705,6 +7503,11 @@ var SANA_AR_TO_SIZE = {
|
|
|
7705
7503
|
"2:1": "1408x704",
|
|
7706
7504
|
"1:2": "704x1408"
|
|
7707
7505
|
};
|
|
7506
|
+
var buildFlowEffectsPayload = (ctx) => ({
|
|
7507
|
+
// Wire field stays `template` — the deployed adapter's command contract.
|
|
7508
|
+
template: ctx.templateId ?? "",
|
|
7509
|
+
imageUrls: ctx.imageUrls ?? []
|
|
7510
|
+
});
|
|
7708
7511
|
var buildPcpSanaSprintPayload = (ctx) => {
|
|
7709
7512
|
const size = resolveImageSize(ctx, SANA_AR_TO_SIZE);
|
|
7710
7513
|
const [w, h] = size ? size.split("x").map((n) => parseInt(n)) : [1024, 1024];
|
|
@@ -7861,6 +7664,51 @@ var { MODELS: MODELS31 } = defineModels("picsart", [
|
|
|
7861
7664
|
...params.aspectRatio(Object.keys(SANA_AR_TO_SIZE), "1:1")
|
|
7862
7665
|
}
|
|
7863
7666
|
},
|
|
7667
|
+
{
|
|
7668
|
+
id: "picsart-flow",
|
|
7669
|
+
name: "Picsart Effects",
|
|
7670
|
+
addedAt: "2026-08-14",
|
|
7671
|
+
workflow: "picsart-flow/v1/effects",
|
|
7672
|
+
buildPayload: buildFlowEffectsPayload,
|
|
7673
|
+
estimatedTime: 35,
|
|
7674
|
+
mode: "image",
|
|
7675
|
+
inputType: "i2i",
|
|
7676
|
+
badge: ["new"],
|
|
7677
|
+
description: "Apply curated Picsart effect presets to a photo \u2014 multi-step Magic Flow pipelines, one tap.",
|
|
7678
|
+
features: [feat("Effect Presets", "characteristic"), feat("Image Required", "input")],
|
|
7679
|
+
paramConfig: {
|
|
7680
|
+
...params.catalog("templateId", {
|
|
7681
|
+
label: "Effect Preset",
|
|
7682
|
+
required: true,
|
|
7683
|
+
source: { workflow: "picsart-flow/v1/catalog/templates", modelId: "picsart-flow" },
|
|
7684
|
+
default: ""
|
|
7685
|
+
}),
|
|
7686
|
+
// Slot count per template rides the catalog item's meta.imageSlots.
|
|
7687
|
+
...params.imageInput(3, "Your Photo", true, "asset")
|
|
7688
|
+
}
|
|
7689
|
+
},
|
|
7690
|
+
{
|
|
7691
|
+
id: "picsart-flow-video",
|
|
7692
|
+
name: "Picsart Effects Video",
|
|
7693
|
+
addedAt: "2026-08-14",
|
|
7694
|
+
workflow: "picsart-flow/v1/effects",
|
|
7695
|
+
buildPayload: buildFlowEffectsPayload,
|
|
7696
|
+
estimatedTime: 150,
|
|
7697
|
+
mode: "video",
|
|
7698
|
+
inputType: "i2v",
|
|
7699
|
+
badge: ["new"],
|
|
7700
|
+
description: "Animate a photo with curated Picsart video presets \u2014 multi-step Magic Flow pipelines, one tap.",
|
|
7701
|
+
features: [feat("Effect Presets", "characteristic"), feat("Image Required", "input")],
|
|
7702
|
+
paramConfig: {
|
|
7703
|
+
...params.catalog("templateId", {
|
|
7704
|
+
label: "Effect Preset",
|
|
7705
|
+
required: true,
|
|
7706
|
+
source: { workflow: "picsart-flow/v1/catalog/templates", modelId: "picsart-flow-video" },
|
|
7707
|
+
default: ""
|
|
7708
|
+
}),
|
|
7709
|
+
...params.imageInput(3, "Your Photo", true, "asset")
|
|
7710
|
+
}
|
|
7711
|
+
},
|
|
7864
7712
|
{
|
|
7865
7713
|
id: "picsart-hidream-t2i",
|
|
7866
7714
|
name: "Picsart HiDream T2I",
|
|
@@ -9875,10 +9723,6 @@ function createApis(config) {
|
|
|
9875
9723
|
// src/client/catalogs.ts
|
|
9876
9724
|
var DEFAULT_LIMIT = 100;
|
|
9877
9725
|
var MIN_TTL_SECONDS = 60;
|
|
9878
|
-
var PARAM_KEY = {
|
|
9879
|
-
voices: "voiceId",
|
|
9880
|
-
avatars: "videoId"
|
|
9881
|
-
};
|
|
9882
9726
|
var copyPage = (page) => ({
|
|
9883
9727
|
items: [...page.items],
|
|
9884
9728
|
nextCursor: page.nextCursor
|
|
@@ -9947,7 +9791,7 @@ function createCatalogs(transport, options) {
|
|
|
9947
9791
|
}
|
|
9948
9792
|
return [...byId.values()];
|
|
9949
9793
|
}
|
|
9950
|
-
async function loadPage(def,
|
|
9794
|
+
async function loadPage(def, paramKey, source, options2) {
|
|
9951
9795
|
const store = storeFor(source, options2?.forceRefresh);
|
|
9952
9796
|
const cursorKey = options2?.cursor ?? "";
|
|
9953
9797
|
const cached = store.pages.get(cursorKey);
|
|
@@ -9970,7 +9814,7 @@ function createCatalogs(transport, options) {
|
|
|
9970
9814
|
if (store.expiresAt === 0) {
|
|
9971
9815
|
store.expiresAt = Date.now() + Math.max(MIN_TTL_SECONDS, res.ttlSeconds || 0) * 1e3;
|
|
9972
9816
|
}
|
|
9973
|
-
installHydratedCatalog(source,
|
|
9817
|
+
installHydratedCatalog(source, paramKey, accumulated(store), def.provider, store.version);
|
|
9974
9818
|
}
|
|
9975
9819
|
return page;
|
|
9976
9820
|
}).finally(() => {
|
|
@@ -9979,33 +9823,32 @@ function createCatalogs(transport, options) {
|
|
|
9979
9823
|
inflight.set(inflightKey, run);
|
|
9980
9824
|
return abortable(run.then(copyPage), options2?.signal);
|
|
9981
9825
|
}
|
|
9982
|
-
function requireSource(def,
|
|
9983
|
-
const d = def.paramConfig[
|
|
9826
|
+
function requireSource(def, key) {
|
|
9827
|
+
const d = def.paramConfig[key]?.descriptor;
|
|
9984
9828
|
const source = d?.kind === "catalog" ? d.source : void 0;
|
|
9985
9829
|
if (!source) {
|
|
9986
|
-
throw new Error(`Model "${def.id}" has no runtime ${
|
|
9830
|
+
throw new Error(`Model "${def.id}" has no runtime catalog on param "${key}" \u2014 its options are static.`);
|
|
9987
9831
|
}
|
|
9988
9832
|
return source;
|
|
9989
9833
|
}
|
|
9834
|
+
async function loadParam(model, key, options2) {
|
|
9835
|
+
const def = resolveModel(model);
|
|
9836
|
+
return loadPage(def, key, requireSource(def, key), options2);
|
|
9837
|
+
}
|
|
9990
9838
|
const client = {
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
},
|
|
9995
|
-
async avatars(model, options2) {
|
|
9996
|
-
const def = resolveModel(model);
|
|
9997
|
-
return loadPage(def, "avatars", requireSource(def, "avatars"), options2);
|
|
9998
|
-
}
|
|
9839
|
+
voices: (model, options2) => loadParam(model, "voiceId", options2),
|
|
9840
|
+
avatars: (model, options2) => loadParam(model, "videoId", options2),
|
|
9841
|
+
templates: (model, options2) => loadParam(model, "templateId", options2)
|
|
9999
9842
|
};
|
|
10000
9843
|
if (options?.preload) {
|
|
10001
9844
|
const seen = /* @__PURE__ */ new Set();
|
|
10002
9845
|
for (const def of ALL_MODELS) {
|
|
10003
|
-
for (const
|
|
10004
|
-
const d =
|
|
10005
|
-
const source = d
|
|
9846
|
+
for (const [key, entry] of Object.entries(def.paramConfig)) {
|
|
9847
|
+
const d = entry.descriptor;
|
|
9848
|
+
const source = d.kind === "catalog" ? d.source : void 0;
|
|
10006
9849
|
if (!source || seen.has(keyOf2(source))) continue;
|
|
10007
9850
|
seen.add(keyOf2(source));
|
|
10008
|
-
void loadPage(def,
|
|
9851
|
+
void loadPage(def, key, source).catch(() => {
|
|
10009
9852
|
});
|
|
10010
9853
|
}
|
|
10011
9854
|
}
|
|
@@ -10661,6 +10504,7 @@ var GptImage2 = "gpt-image-2";
|
|
|
10661
10504
|
var GrokEditVideo = "grok-edit-video";
|
|
10662
10505
|
var GrokExtendVideo = "grok-extend-video";
|
|
10663
10506
|
var GrokImagineImage = "grok-imagine-image";
|
|
10507
|
+
var GrokImagineImage20 = "grok-imagine-image-2.0";
|
|
10664
10508
|
var GrokImagineImageQuality = "grok-imagine-image-quality";
|
|
10665
10509
|
var GrokImagineVideo = "grok-imagine-video";
|
|
10666
10510
|
var GrokImagineVideo15 = "grok-imagine-video-1.5";
|
|
@@ -10727,6 +10571,8 @@ var MinimaxMusicV3 = "minimax-music-v3";
|
|
|
10727
10571
|
var Ovi = "ovi";
|
|
10728
10572
|
var PicsartChangeBg = "picsart-change-bg";
|
|
10729
10573
|
var PicsartEnhance = "picsart-enhance";
|
|
10574
|
+
var PicsartFlow = "picsart-flow";
|
|
10575
|
+
var PicsartFlowVideo = "picsart-flow-video";
|
|
10730
10576
|
var PicsartFlux2Klein = "picsart-flux-2-klein";
|
|
10731
10577
|
var PicsartHidreamT2i = "picsart-hidream-t2i";
|
|
10732
10578
|
var PicsartQwenImageEdit = "picsart-qwen-image-edit";
|
|
@@ -10867,6 +10713,7 @@ var Models = {
|
|
|
10867
10713
|
GrokEditVideo,
|
|
10868
10714
|
GrokExtendVideo,
|
|
10869
10715
|
GrokImagineImage,
|
|
10716
|
+
GrokImagineImage20,
|
|
10870
10717
|
GrokImagineImageQuality,
|
|
10871
10718
|
GrokImagineVideo,
|
|
10872
10719
|
GrokImagineVideo15,
|
|
@@ -10933,6 +10780,8 @@ var Models = {
|
|
|
10933
10780
|
Ovi,
|
|
10934
10781
|
PicsartChangeBg,
|
|
10935
10782
|
PicsartEnhance,
|
|
10783
|
+
PicsartFlow,
|
|
10784
|
+
PicsartFlowVideo,
|
|
10936
10785
|
PicsartFlux2Klein,
|
|
10937
10786
|
PicsartHidreamT2i,
|
|
10938
10787
|
PicsartQwenImageEdit,
|