Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
•
6ced056
1
Parent(s):
ae65ad2
working on a new API route
Browse files- package-lock.json +178 -170
- package.json +5 -5
- src/app/api/generators/clap/addLatentScenesToClap.ts +1 -1
- src/app/api/generators/clap/constants.ts +1 -0
- src/app/api/parsers/parseNumericTime.ts +18 -0
- src/app/api/v1/create/index.ts +8 -8
- src/app/api/v1/edit/dialogues/processShot.ts +3 -2
- src/app/api/v1/edit/music/generateMusic.ts +2 -1
- src/app/api/v1/edit/music/systemPrompt.ts +1 -1
- src/app/api/v1/edit/sounds/generateSound.ts +2 -1
- src/app/api/v1/edit/sounds/processShot.ts +3 -2
- src/app/api/v1/edit/story/extendClapStory.ts +135 -0
- src/app/api/v1/edit/story/extendLatentStoryWithMoreShots.ts +124 -0
- src/app/api/v1/edit/story/route.ts +64 -0
- src/app/api/v1/edit/story/systemPromptExtendStory.ts +48 -0
- src/app/api/v1/edit/storyboards/processShot.ts +4 -3
- src/app/api/v1/edit/videos/processShot.ts +6 -5
- src/lib/utils/getInitialRenderedScene.ts +3 -1
package-lock.json
CHANGED
@@ -8,13 +8,13 @@
|
|
8 |
"name": "@aitube/website",
|
9 |
"version": "0.0.0",
|
10 |
"dependencies": {
|
11 |
-
"@aitube/clap": "0.0.
|
12 |
-
"@aitube/client": "0.0.
|
13 |
-
"@aitube/engine": "0.0.
|
14 |
"@huggingface/hub": "0.12.3-oauth",
|
15 |
-
"@huggingface/inference": "^2.
|
16 |
"@jcoreio/async-throttle": "^1.6.0",
|
17 |
-
"@mediapipe/tasks-vision": "^0.10.
|
18 |
"@photo-sphere-viewer/core": "^5.7.2",
|
19 |
"@photo-sphere-viewer/equirectangular-video-adapter": "^5.7.2",
|
20 |
"@photo-sphere-viewer/gyroscope-plugin": "^5.7.2",
|
@@ -119,34 +119,34 @@
|
|
119 |
}
|
120 |
},
|
121 |
"node_modules/@aitube/clap": {
|
122 |
-
"version": "0.0.
|
123 |
-
"resolved": "https://registry.npmjs.org/@aitube/clap/-/clap-0.0.
|
124 |
-
"integrity": "sha512-
|
125 |
"dependencies": {
|
126 |
"pure-uuid": "^1.8.1",
|
127 |
-
"yaml": "^2.4.
|
128 |
},
|
129 |
"peerDependencies": {
|
130 |
"typescript": "^5.4.5"
|
131 |
}
|
132 |
},
|
133 |
"node_modules/@aitube/client": {
|
134 |
-
"version": "0.0.
|
135 |
-
"resolved": "https://registry.npmjs.org/@aitube/client/-/client-0.0.
|
136 |
-
"integrity": "sha512-
|
137 |
"dependencies": {
|
138 |
"query-string": "^9.0.0"
|
139 |
},
|
140 |
"peerDependencies": {
|
141 |
-
"@aitube/clap": "0.0.
|
142 |
}
|
143 |
},
|
144 |
"node_modules/@aitube/engine": {
|
145 |
-
"version": "0.0.
|
146 |
-
"resolved": "https://registry.npmjs.org/@aitube/engine/-/engine-0.0.
|
147 |
-
"integrity": "sha512-
|
148 |
"peerDependencies": {
|
149 |
-
"@aitube/clap": "0.0.
|
150 |
}
|
151 |
},
|
152 |
"node_modules/@alloc/quick-lru": {
|
@@ -192,9 +192,9 @@
|
|
192 |
}
|
193 |
},
|
194 |
"node_modules/@emnapi/runtime": {
|
195 |
-
"version": "1.
|
196 |
-
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.
|
197 |
-
"integrity": "sha512-
|
198 |
"optional": true,
|
199 |
"dependencies": {
|
200 |
"tslib": "^2.4.0"
|
@@ -919,9 +919,9 @@
|
|
919 |
}
|
920 |
},
|
921 |
"node_modules/@floating-ui/core": {
|
922 |
-
"version": "1.6.
|
923 |
-
"resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.
|
924 |
-
"integrity": "sha512
|
925 |
"dependencies": {
|
926 |
"@floating-ui/utils": "^0.2.0"
|
927 |
}
|
@@ -936,9 +936,9 @@
|
|
936 |
}
|
937 |
},
|
938 |
"node_modules/@floating-ui/react-dom": {
|
939 |
-
"version": "2.0
|
940 |
-
"resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.
|
941 |
-
"integrity": "sha512-
|
942 |
"dependencies": {
|
943 |
"@floating-ui/dom": "^1.0.0"
|
944 |
},
|
@@ -964,13 +964,21 @@
|
|
964 |
}
|
965 |
},
|
966 |
"node_modules/@huggingface/inference": {
|
967 |
-
"version": "2.
|
968 |
-
"resolved": "https://registry.npmjs.org/@huggingface/inference/-/inference-2.
|
969 |
-
"integrity": "sha512-
|
|
|
|
|
|
|
970 |
"engines": {
|
971 |
"node": ">=18"
|
972 |
}
|
973 |
},
|
|
|
|
|
|
|
|
|
|
|
974 |
"node_modules/@humanwhocodes/config-array": {
|
975 |
"version": "0.11.14",
|
976 |
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
|
@@ -1002,9 +1010,9 @@
|
|
1002 |
"integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA=="
|
1003 |
},
|
1004 |
"node_modules/@img/sharp-darwin-arm64": {
|
1005 |
-
"version": "0.33.
|
1006 |
-
"resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.
|
1007 |
-
"integrity": "sha512-
|
1008 |
"cpu": [
|
1009 |
"arm64"
|
1010 |
],
|
@@ -1027,9 +1035,9 @@
|
|
1027 |
}
|
1028 |
},
|
1029 |
"node_modules/@img/sharp-darwin-x64": {
|
1030 |
-
"version": "0.33.
|
1031 |
-
"resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.
|
1032 |
-
"integrity": "sha512-
|
1033 |
"cpu": [
|
1034 |
"x64"
|
1035 |
],
|
@@ -1220,9 +1228,9 @@
|
|
1220 |
}
|
1221 |
},
|
1222 |
"node_modules/@img/sharp-linux-arm": {
|
1223 |
-
"version": "0.33.
|
1224 |
-
"resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.
|
1225 |
-
"integrity": "sha512-
|
1226 |
"cpu": [
|
1227 |
"arm"
|
1228 |
],
|
@@ -1245,9 +1253,9 @@
|
|
1245 |
}
|
1246 |
},
|
1247 |
"node_modules/@img/sharp-linux-arm64": {
|
1248 |
-
"version": "0.33.
|
1249 |
-
"resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.
|
1250 |
-
"integrity": "sha512-
|
1251 |
"cpu": [
|
1252 |
"arm64"
|
1253 |
],
|
@@ -1270,9 +1278,9 @@
|
|
1270 |
}
|
1271 |
},
|
1272 |
"node_modules/@img/sharp-linux-s390x": {
|
1273 |
-
"version": "0.33.
|
1274 |
-
"resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.
|
1275 |
-
"integrity": "sha512-
|
1276 |
"cpu": [
|
1277 |
"s390x"
|
1278 |
],
|
@@ -1281,7 +1289,7 @@
|
|
1281 |
"linux"
|
1282 |
],
|
1283 |
"engines": {
|
1284 |
-
"glibc": ">=2.
|
1285 |
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
|
1286 |
"npm": ">=9.6.5",
|
1287 |
"pnpm": ">=7.1.0",
|
@@ -1295,9 +1303,9 @@
|
|
1295 |
}
|
1296 |
},
|
1297 |
"node_modules/@img/sharp-linux-x64": {
|
1298 |
-
"version": "0.33.
|
1299 |
-
"resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.
|
1300 |
-
"integrity": "sha512-
|
1301 |
"cpu": [
|
1302 |
"x64"
|
1303 |
],
|
@@ -1320,9 +1328,9 @@
|
|
1320 |
}
|
1321 |
},
|
1322 |
"node_modules/@img/sharp-linuxmusl-arm64": {
|
1323 |
-
"version": "0.33.
|
1324 |
-
"resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.
|
1325 |
-
"integrity": "sha512-
|
1326 |
"cpu": [
|
1327 |
"arm64"
|
1328 |
],
|
@@ -1345,9 +1353,9 @@
|
|
1345 |
}
|
1346 |
},
|
1347 |
"node_modules/@img/sharp-linuxmusl-x64": {
|
1348 |
-
"version": "0.33.
|
1349 |
-
"resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.
|
1350 |
-
"integrity": "sha512-
|
1351 |
"cpu": [
|
1352 |
"x64"
|
1353 |
],
|
@@ -1370,15 +1378,15 @@
|
|
1370 |
}
|
1371 |
},
|
1372 |
"node_modules/@img/sharp-wasm32": {
|
1373 |
-
"version": "0.33.
|
1374 |
-
"resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.
|
1375 |
-
"integrity": "sha512-
|
1376 |
"cpu": [
|
1377 |
"wasm32"
|
1378 |
],
|
1379 |
"optional": true,
|
1380 |
"dependencies": {
|
1381 |
-
"@emnapi/runtime": "^1.1.
|
1382 |
},
|
1383 |
"engines": {
|
1384 |
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
|
@@ -1391,9 +1399,9 @@
|
|
1391 |
}
|
1392 |
},
|
1393 |
"node_modules/@img/sharp-win32-ia32": {
|
1394 |
-
"version": "0.33.
|
1395 |
-
"resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.
|
1396 |
-
"integrity": "sha512-
|
1397 |
"cpu": [
|
1398 |
"ia32"
|
1399 |
],
|
@@ -1412,9 +1420,9 @@
|
|
1412 |
}
|
1413 |
},
|
1414 |
"node_modules/@img/sharp-win32-x64": {
|
1415 |
-
"version": "0.33.
|
1416 |
-
"resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.
|
1417 |
-
"integrity": "sha512-
|
1418 |
"cpu": [
|
1419 |
"x64"
|
1420 |
],
|
@@ -1525,9 +1533,9 @@
|
|
1525 |
}
|
1526 |
},
|
1527 |
"node_modules/@mediapipe/tasks-vision": {
|
1528 |
-
"version": "0.10.
|
1529 |
-
"resolved": "https://registry.npmjs.org/@mediapipe/tasks-vision/-/tasks-vision-0.10.
|
1530 |
-
"integrity": "sha512-
|
1531 |
},
|
1532 |
"node_modules/@next/env": {
|
1533 |
"version": "14.2.3",
|
@@ -1710,9 +1718,9 @@
|
|
1710 |
}
|
1711 |
},
|
1712 |
"node_modules/@photo-sphere-viewer/core": {
|
1713 |
-
"version": "5.7.
|
1714 |
-
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/core/-/core-5.7.
|
1715 |
-
"integrity": "sha512-
|
1716 |
"dependencies": {
|
1717 |
"three": "^0.161.0"
|
1718 |
}
|
@@ -1723,77 +1731,77 @@
|
|
1723 |
"integrity": "sha512-LC28VFtjbOyEu5b93K0bNRLw1rQlMJ85lilKsYj6dgTu+7i17W+JCCEbvrpmNHF1F3NAUqDSWq50UD7w9H2xQw=="
|
1724 |
},
|
1725 |
"node_modules/@photo-sphere-viewer/equirectangular-video-adapter": {
|
1726 |
-
"version": "5.7.
|
1727 |
-
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/equirectangular-video-adapter/-/equirectangular-video-adapter-5.7.
|
1728 |
-
"integrity": "sha512-
|
1729 |
"peerDependencies": {
|
1730 |
-
"@photo-sphere-viewer/core": "5.7.
|
1731 |
}
|
1732 |
},
|
1733 |
"node_modules/@photo-sphere-viewer/gyroscope-plugin": {
|
1734 |
-
"version": "5.7.
|
1735 |
-
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/gyroscope-plugin/-/gyroscope-plugin-5.7.
|
1736 |
-
"integrity": "sha512-
|
1737 |
"peerDependencies": {
|
1738 |
-
"@photo-sphere-viewer/core": "5.7.
|
1739 |
}
|
1740 |
},
|
1741 |
"node_modules/@photo-sphere-viewer/markers-plugin": {
|
1742 |
-
"version": "5.7.
|
1743 |
-
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/markers-plugin/-/markers-plugin-5.7.
|
1744 |
-
"integrity": "sha512-
|
1745 |
"peerDependencies": {
|
1746 |
-
"@photo-sphere-viewer/core": "5.7.
|
1747 |
}
|
1748 |
},
|
1749 |
"node_modules/@photo-sphere-viewer/overlays-plugin": {
|
1750 |
-
"version": "5.7.
|
1751 |
-
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/overlays-plugin/-/overlays-plugin-5.7.
|
1752 |
-
"integrity": "sha512
|
1753 |
"peerDependencies": {
|
1754 |
-
"@photo-sphere-viewer/core": "5.7.
|
1755 |
}
|
1756 |
},
|
1757 |
"node_modules/@photo-sphere-viewer/resolution-plugin": {
|
1758 |
-
"version": "5.7.
|
1759 |
-
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/resolution-plugin/-/resolution-plugin-5.7.
|
1760 |
-
"integrity": "sha512-
|
1761 |
"peerDependencies": {
|
1762 |
-
"@photo-sphere-viewer/core": "5.7.
|
1763 |
-
"@photo-sphere-viewer/settings-plugin": "5.7.
|
1764 |
}
|
1765 |
},
|
1766 |
"node_modules/@photo-sphere-viewer/settings-plugin": {
|
1767 |
-
"version": "5.7.
|
1768 |
-
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/settings-plugin/-/settings-plugin-5.7.
|
1769 |
-
"integrity": "sha512-
|
1770 |
"peerDependencies": {
|
1771 |
-
"@photo-sphere-viewer/core": "5.7.
|
1772 |
}
|
1773 |
},
|
1774 |
"node_modules/@photo-sphere-viewer/stereo-plugin": {
|
1775 |
-
"version": "5.7.
|
1776 |
-
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/stereo-plugin/-/stereo-plugin-5.7.
|
1777 |
-
"integrity": "sha512-
|
1778 |
"peerDependencies": {
|
1779 |
-
"@photo-sphere-viewer/core": "5.7.
|
1780 |
-
"@photo-sphere-viewer/gyroscope-plugin": "5.7.
|
1781 |
}
|
1782 |
},
|
1783 |
"node_modules/@photo-sphere-viewer/video-plugin": {
|
1784 |
-
"version": "5.7.
|
1785 |
-
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/video-plugin/-/video-plugin-5.7.
|
1786 |
-
"integrity": "sha512-
|
1787 |
"peerDependencies": {
|
1788 |
-
"@photo-sphere-viewer/core": "5.7.
|
1789 |
}
|
1790 |
},
|
1791 |
"node_modules/@photo-sphere-viewer/visible-range-plugin": {
|
1792 |
-
"version": "5.7.
|
1793 |
-
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/visible-range-plugin/-/visible-range-plugin-5.7.
|
1794 |
-
"integrity": "sha512-
|
1795 |
"peerDependencies": {
|
1796 |
-
"@photo-sphere-viewer/core": "5.7.
|
1797 |
}
|
1798 |
},
|
1799 |
"node_modules/@pkgjs/parseargs": {
|
@@ -2892,9 +2900,9 @@
|
|
2892 |
}
|
2893 |
},
|
2894 |
"node_modules/@rushstack/eslint-patch": {
|
2895 |
-
"version": "1.10.
|
2896 |
-
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.10.
|
2897 |
-
"integrity": "sha512-
|
2898 |
},
|
2899 |
"node_modules/@swc/counter": {
|
2900 |
"version": "0.1.3",
|
@@ -2963,9 +2971,9 @@
|
|
2963 |
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ=="
|
2964 |
},
|
2965 |
"node_modules/@types/lodash": {
|
2966 |
-
"version": "4.17.
|
2967 |
-
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.
|
2968 |
-
"integrity": "sha512-
|
2969 |
},
|
2970 |
"node_modules/@types/lodash.debounce": {
|
2971 |
"version": "4.0.9",
|
@@ -3178,9 +3186,9 @@
|
|
3178 |
}
|
3179 |
},
|
3180 |
"node_modules/@upstash/redis": {
|
3181 |
-
"version": "1.
|
3182 |
-
"resolved": "https://registry.npmjs.org/@upstash/redis/-/redis-1.
|
3183 |
-
"integrity": "sha512-
|
3184 |
"dependencies": {
|
3185 |
"crypto-js": "^4.2.0"
|
3186 |
}
|
@@ -3507,9 +3515,9 @@
|
|
3507 |
"integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ=="
|
3508 |
},
|
3509 |
"node_modules/async": {
|
3510 |
-
"version": "
|
3511 |
-
"resolved": "https://registry.npmjs.org/async/-/async-
|
3512 |
-
"integrity": "sha512-
|
3513 |
},
|
3514 |
"node_modules/asynckit": {
|
3515 |
"version": "0.4.0",
|
@@ -3575,9 +3583,9 @@
|
|
3575 |
}
|
3576 |
},
|
3577 |
"node_modules/axios": {
|
3578 |
-
"version": "1.
|
3579 |
-
"resolved": "https://registry.npmjs.org/axios/-/axios-1.
|
3580 |
-
"integrity": "sha512
|
3581 |
"dependencies": {
|
3582 |
"follow-redirects": "^1.15.6",
|
3583 |
"form-data": "^4.0.0",
|
@@ -3745,9 +3753,9 @@
|
|
3745 |
}
|
3746 |
},
|
3747 |
"node_modules/caniuse-lite": {
|
3748 |
-
"version": "1.0.
|
3749 |
-
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.
|
3750 |
-
"integrity": "sha512-
|
3751 |
"funding": [
|
3752 |
{
|
3753 |
"type": "opencollective",
|
@@ -4324,9 +4332,9 @@
|
|
4324 |
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="
|
4325 |
},
|
4326 |
"node_modules/electron-to-chromium": {
|
4327 |
-
"version": "1.4.
|
4328 |
-
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.
|
4329 |
-
"integrity": "sha512-
|
4330 |
},
|
4331 |
"node_modules/elliptic": {
|
4332 |
"version": "6.5.4",
|
@@ -5154,15 +5162,15 @@
|
|
5154 |
"integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw=="
|
5155 |
},
|
5156 |
"node_modules/fluent-ffmpeg": {
|
5157 |
-
"version": "2.1.
|
5158 |
-
"resolved": "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.
|
5159 |
-
"integrity": "sha512-
|
5160 |
"dependencies": {
|
5161 |
-
"async": "
|
5162 |
"which": "^1.1.1"
|
5163 |
},
|
5164 |
"engines": {
|
5165 |
-
"node": ">=
|
5166 |
}
|
5167 |
},
|
5168 |
"node_modules/fluent-ffmpeg/node_modules/which": {
|
@@ -6697,9 +6705,9 @@
|
|
6697 |
}
|
6698 |
},
|
6699 |
"node_modules/openai": {
|
6700 |
-
"version": "4.
|
6701 |
-
"resolved": "https://registry.npmjs.org/openai/-/openai-4.
|
6702 |
-
"integrity": "sha512-
|
6703 |
"dependencies": {
|
6704 |
"@types/node": "^18.11.18",
|
6705 |
"@types/node-fetch": "^2.6.4",
|
@@ -6812,15 +6820,15 @@
|
|
6812 |
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
|
6813 |
},
|
6814 |
"node_modules/path-scurry": {
|
6815 |
-
"version": "1.11.
|
6816 |
-
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.
|
6817 |
-
"integrity": "sha512-
|
6818 |
"dependencies": {
|
6819 |
"lru-cache": "^10.2.0",
|
6820 |
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
|
6821 |
},
|
6822 |
"engines": {
|
6823 |
-
"node": ">=16 || 14 >=14.
|
6824 |
},
|
6825 |
"funding": {
|
6826 |
"url": "https://github.com/sponsors/isaacs"
|
@@ -6852,9 +6860,9 @@
|
|
6852 |
}
|
6853 |
},
|
6854 |
"node_modules/picocolors": {
|
6855 |
-
"version": "1.0.
|
6856 |
-
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.
|
6857 |
-
"integrity": "sha512-
|
6858 |
},
|
6859 |
"node_modules/picomatch": {
|
6860 |
"version": "2.3.1",
|
@@ -7608,9 +7616,9 @@
|
|
7608 |
"integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ=="
|
7609 |
},
|
7610 |
"node_modules/sharp": {
|
7611 |
-
"version": "0.33.
|
7612 |
-
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.
|
7613 |
-
"integrity": "sha512-
|
7614 |
"hasInstallScript": true,
|
7615 |
"dependencies": {
|
7616 |
"color": "^4.2.3",
|
@@ -7625,8 +7633,8 @@
|
|
7625 |
"url": "https://opencollective.com/libvips"
|
7626 |
},
|
7627 |
"optionalDependencies": {
|
7628 |
-
"@img/sharp-darwin-arm64": "0.33.
|
7629 |
-
"@img/sharp-darwin-x64": "0.33.
|
7630 |
"@img/sharp-libvips-darwin-arm64": "1.0.2",
|
7631 |
"@img/sharp-libvips-darwin-x64": "1.0.2",
|
7632 |
"@img/sharp-libvips-linux-arm": "1.0.2",
|
@@ -7635,15 +7643,15 @@
|
|
7635 |
"@img/sharp-libvips-linux-x64": "1.0.2",
|
7636 |
"@img/sharp-libvips-linuxmusl-arm64": "1.0.2",
|
7637 |
"@img/sharp-libvips-linuxmusl-x64": "1.0.2",
|
7638 |
-
"@img/sharp-linux-arm": "0.33.
|
7639 |
-
"@img/sharp-linux-arm64": "0.33.
|
7640 |
-
"@img/sharp-linux-s390x": "0.33.
|
7641 |
-
"@img/sharp-linux-x64": "0.33.
|
7642 |
-
"@img/sharp-linuxmusl-arm64": "0.33.
|
7643 |
-
"@img/sharp-linuxmusl-x64": "0.33.
|
7644 |
-
"@img/sharp-wasm32": "0.33.
|
7645 |
-
"@img/sharp-win32-ia32": "0.33.
|
7646 |
-
"@img/sharp-win32-x64": "0.33.
|
7647 |
}
|
7648 |
},
|
7649 |
"node_modules/shebang-command": {
|
@@ -8011,9 +8019,9 @@
|
|
8011 |
}
|
8012 |
},
|
8013 |
"node_modules/sucrase/node_modules/glob": {
|
8014 |
-
"version": "10.3.
|
8015 |
-
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.
|
8016 |
-
"integrity": "sha512-
|
8017 |
"dependencies": {
|
8018 |
"foreground-child": "^3.1.0",
|
8019 |
"jackspeak": "^2.3.6",
|
@@ -8025,7 +8033,7 @@
|
|
8025 |
"glob": "dist/esm/bin.mjs"
|
8026 |
},
|
8027 |
"engines": {
|
8028 |
-
"node": ">=16 || 14 >=14.
|
8029 |
},
|
8030 |
"funding": {
|
8031 |
"url": "https://github.com/sponsors/isaacs"
|
@@ -8413,9 +8421,9 @@
|
|
8413 |
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
|
8414 |
},
|
8415 |
"node_modules/update-browserslist-db": {
|
8416 |
-
"version": "1.0.
|
8417 |
-
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.
|
8418 |
-
"integrity": "sha512-
|
8419 |
"funding": [
|
8420 |
{
|
8421 |
"type": "opencollective",
|
@@ -8432,7 +8440,7 @@
|
|
8432 |
],
|
8433 |
"dependencies": {
|
8434 |
"escalade": "^3.1.2",
|
8435 |
-
"picocolors": "^1.0.
|
8436 |
},
|
8437 |
"bin": {
|
8438 |
"update-browserslist-db": "cli.js"
|
@@ -8560,13 +8568,13 @@
|
|
8560 |
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
8561 |
},
|
8562 |
"node_modules/websocket": {
|
8563 |
-
"version": "1.0.
|
8564 |
-
"resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.
|
8565 |
-
"integrity": "sha512
|
8566 |
"dependencies": {
|
8567 |
"bufferutil": "^4.0.1",
|
8568 |
"debug": "^2.2.0",
|
8569 |
-
"es5-ext": "^0.10.
|
8570 |
"typedarray-to-buffer": "^3.1.5",
|
8571 |
"utf-8-validate": "^5.0.2",
|
8572 |
"yaeti": "^0.0.6"
|
|
|
8 |
"name": "@aitube/website",
|
9 |
"version": "0.0.0",
|
10 |
"dependencies": {
|
11 |
+
"@aitube/clap": "0.0.19",
|
12 |
+
"@aitube/client": "0.0.28",
|
13 |
+
"@aitube/engine": "0.0.10",
|
14 |
"@huggingface/hub": "0.12.3-oauth",
|
15 |
+
"@huggingface/inference": "^2.7.0",
|
16 |
"@jcoreio/async-throttle": "^1.6.0",
|
17 |
+
"@mediapipe/tasks-vision": "^0.10.14",
|
18 |
"@photo-sphere-viewer/core": "^5.7.2",
|
19 |
"@photo-sphere-viewer/equirectangular-video-adapter": "^5.7.2",
|
20 |
"@photo-sphere-viewer/gyroscope-plugin": "^5.7.2",
|
|
|
119 |
}
|
120 |
},
|
121 |
"node_modules/@aitube/clap": {
|
122 |
+
"version": "0.0.19",
|
123 |
+
"resolved": "https://registry.npmjs.org/@aitube/clap/-/clap-0.0.19.tgz",
|
124 |
+
"integrity": "sha512-2Xe9EDY06a09Pp5/pjbm8IQnFCBD/y48WzQqKo6b/1i7lBxzxJ9g5J8b0TM3Jd3JdEApvJ+62tnT7rFrGGLMRQ==",
|
125 |
"dependencies": {
|
126 |
"pure-uuid": "^1.8.1",
|
127 |
+
"yaml": "^2.4.2"
|
128 |
},
|
129 |
"peerDependencies": {
|
130 |
"typescript": "^5.4.5"
|
131 |
}
|
132 |
},
|
133 |
"node_modules/@aitube/client": {
|
134 |
+
"version": "0.0.28",
|
135 |
+
"resolved": "https://registry.npmjs.org/@aitube/client/-/client-0.0.28.tgz",
|
136 |
+
"integrity": "sha512-yFejJ9j4VcYIhOO/wUhbzJ8qU66KuSOXnPLWio4w4E7c0VwtkD46dae4i6Ic7l4nyVe0avjRIKZlzAlTphFSvA==",
|
137 |
"dependencies": {
|
138 |
"query-string": "^9.0.0"
|
139 |
},
|
140 |
"peerDependencies": {
|
141 |
+
"@aitube/clap": "0.0.19"
|
142 |
}
|
143 |
},
|
144 |
"node_modules/@aitube/engine": {
|
145 |
+
"version": "0.0.10",
|
146 |
+
"resolved": "https://registry.npmjs.org/@aitube/engine/-/engine-0.0.10.tgz",
|
147 |
+
"integrity": "sha512-iDupahKrjuQE7u6aCR85xq6dilb2wPITyxtYhKNk7qCpYckLLHdzCW2CX+ZTD03NYiL10Ns4YdMGax5ygjimhQ==",
|
148 |
"peerDependencies": {
|
149 |
+
"@aitube/clap": "0.0.19"
|
150 |
}
|
151 |
},
|
152 |
"node_modules/@alloc/quick-lru": {
|
|
|
192 |
}
|
193 |
},
|
194 |
"node_modules/@emnapi/runtime": {
|
195 |
+
"version": "1.2.0",
|
196 |
+
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.2.0.tgz",
|
197 |
+
"integrity": "sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==",
|
198 |
"optional": true,
|
199 |
"dependencies": {
|
200 |
"tslib": "^2.4.0"
|
|
|
919 |
}
|
920 |
},
|
921 |
"node_modules/@floating-ui/core": {
|
922 |
+
"version": "1.6.2",
|
923 |
+
"resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.2.tgz",
|
924 |
+
"integrity": "sha512-+2XpQV9LLZeanU4ZevzRnGFg2neDeKHgFLjP6YLW+tly0IvrhqT4u8enLGjLH3qeh85g19xY5rsAusfwTdn5lg==",
|
925 |
"dependencies": {
|
926 |
"@floating-ui/utils": "^0.2.0"
|
927 |
}
|
|
|
936 |
}
|
937 |
},
|
938 |
"node_modules/@floating-ui/react-dom": {
|
939 |
+
"version": "2.1.0",
|
940 |
+
"resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.0.tgz",
|
941 |
+
"integrity": "sha512-lNzj5EQmEKn5FFKc04+zasr09h/uX8RtJRNj5gUXsSQIXHVWTVh+hVAg1vOMCexkX8EgvemMvIFpQfkosnVNyA==",
|
942 |
"dependencies": {
|
943 |
"@floating-ui/dom": "^1.0.0"
|
944 |
},
|
|
|
964 |
}
|
965 |
},
|
966 |
"node_modules/@huggingface/inference": {
|
967 |
+
"version": "2.7.0",
|
968 |
+
"resolved": "https://registry.npmjs.org/@huggingface/inference/-/inference-2.7.0.tgz",
|
969 |
+
"integrity": "sha512-u7Fn637Q3f7nUB1tajM4CgzhvoFQkOQr5W5Fm+2wT9ETgGoLBh25BLlYPTJRjAd2WY01s71v0lqAwNvHHCc3mg==",
|
970 |
+
"dependencies": {
|
971 |
+
"@huggingface/tasks": "^0.10.0"
|
972 |
+
},
|
973 |
"engines": {
|
974 |
"node": ">=18"
|
975 |
}
|
976 |
},
|
977 |
+
"node_modules/@huggingface/tasks": {
|
978 |
+
"version": "0.10.6",
|
979 |
+
"resolved": "https://registry.npmjs.org/@huggingface/tasks/-/tasks-0.10.6.tgz",
|
980 |
+
"integrity": "sha512-aGqvPsZZ8JLkAs7IChsEZil/aNLoMsqDryDFqJV7N5u//EaHzHAU6ORwVxEJIWJ9MIqJauJ9f7LYNtKC5Axh3w=="
|
981 |
+
},
|
982 |
"node_modules/@humanwhocodes/config-array": {
|
983 |
"version": "0.11.14",
|
984 |
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
|
|
|
1010 |
"integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA=="
|
1011 |
},
|
1012 |
"node_modules/@img/sharp-darwin-arm64": {
|
1013 |
+
"version": "0.33.4",
|
1014 |
+
"resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.4.tgz",
|
1015 |
+
"integrity": "sha512-p0suNqXufJs9t3RqLBO6vvrgr5OhgbWp76s5gTRvdmxmuv9E1rcaqGUsl3l4mKVmXPkTkTErXediAui4x+8PSA==",
|
1016 |
"cpu": [
|
1017 |
"arm64"
|
1018 |
],
|
|
|
1035 |
}
|
1036 |
},
|
1037 |
"node_modules/@img/sharp-darwin-x64": {
|
1038 |
+
"version": "0.33.4",
|
1039 |
+
"resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.4.tgz",
|
1040 |
+
"integrity": "sha512-0l7yRObwtTi82Z6ebVI2PnHT8EB2NxBgpK2MiKJZJ7cz32R4lxd001ecMhzzsZig3Yv9oclvqqdV93jo9hy+Dw==",
|
1041 |
"cpu": [
|
1042 |
"x64"
|
1043 |
],
|
|
|
1228 |
}
|
1229 |
},
|
1230 |
"node_modules/@img/sharp-linux-arm": {
|
1231 |
+
"version": "0.33.4",
|
1232 |
+
"resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.4.tgz",
|
1233 |
+
"integrity": "sha512-RUgBD1c0+gCYZGCCe6mMdTiOFS0Zc/XrN0fYd6hISIKcDUbAW5NtSQW9g/powkrXYm6Vzwd6y+fqmExDuCdHNQ==",
|
1234 |
"cpu": [
|
1235 |
"arm"
|
1236 |
],
|
|
|
1253 |
}
|
1254 |
},
|
1255 |
"node_modules/@img/sharp-linux-arm64": {
|
1256 |
+
"version": "0.33.4",
|
1257 |
+
"resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.4.tgz",
|
1258 |
+
"integrity": "sha512-2800clwVg1ZQtxwSoTlHvtm9ObgAax7V6MTAB/hDT945Tfyy3hVkmiHpeLPCKYqYR1Gcmv1uDZ3a4OFwkdBL7Q==",
|
1259 |
"cpu": [
|
1260 |
"arm64"
|
1261 |
],
|
|
|
1278 |
}
|
1279 |
},
|
1280 |
"node_modules/@img/sharp-linux-s390x": {
|
1281 |
+
"version": "0.33.4",
|
1282 |
+
"resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.4.tgz",
|
1283 |
+
"integrity": "sha512-h3RAL3siQoyzSoH36tUeS0PDmb5wINKGYzcLB5C6DIiAn2F3udeFAum+gj8IbA/82+8RGCTn7XW8WTFnqag4tQ==",
|
1284 |
"cpu": [
|
1285 |
"s390x"
|
1286 |
],
|
|
|
1289 |
"linux"
|
1290 |
],
|
1291 |
"engines": {
|
1292 |
+
"glibc": ">=2.31",
|
1293 |
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
|
1294 |
"npm": ">=9.6.5",
|
1295 |
"pnpm": ">=7.1.0",
|
|
|
1303 |
}
|
1304 |
},
|
1305 |
"node_modules/@img/sharp-linux-x64": {
|
1306 |
+
"version": "0.33.4",
|
1307 |
+
"resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.4.tgz",
|
1308 |
+
"integrity": "sha512-GoR++s0XW9DGVi8SUGQ/U4AeIzLdNjHka6jidVwapQ/JebGVQIpi52OdyxCNVRE++n1FCLzjDovJNozif7w/Aw==",
|
1309 |
"cpu": [
|
1310 |
"x64"
|
1311 |
],
|
|
|
1328 |
}
|
1329 |
},
|
1330 |
"node_modules/@img/sharp-linuxmusl-arm64": {
|
1331 |
+
"version": "0.33.4",
|
1332 |
+
"resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.4.tgz",
|
1333 |
+
"integrity": "sha512-nhr1yC3BlVrKDTl6cO12gTpXMl4ITBUZieehFvMntlCXFzH2bvKG76tBL2Y/OqhupZt81pR7R+Q5YhJxW0rGgQ==",
|
1334 |
"cpu": [
|
1335 |
"arm64"
|
1336 |
],
|
|
|
1353 |
}
|
1354 |
},
|
1355 |
"node_modules/@img/sharp-linuxmusl-x64": {
|
1356 |
+
"version": "0.33.4",
|
1357 |
+
"resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.4.tgz",
|
1358 |
+
"integrity": "sha512-uCPTku0zwqDmZEOi4ILyGdmW76tH7dm8kKlOIV1XC5cLyJ71ENAAqarOHQh0RLfpIpbV5KOpXzdU6XkJtS0daw==",
|
1359 |
"cpu": [
|
1360 |
"x64"
|
1361 |
],
|
|
|
1378 |
}
|
1379 |
},
|
1380 |
"node_modules/@img/sharp-wasm32": {
|
1381 |
+
"version": "0.33.4",
|
1382 |
+
"resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.4.tgz",
|
1383 |
+
"integrity": "sha512-Bmmauh4sXUsUqkleQahpdNXKvo+wa1V9KhT2pDA4VJGKwnKMJXiSTGphn0gnJrlooda0QxCtXc6RX1XAU6hMnQ==",
|
1384 |
"cpu": [
|
1385 |
"wasm32"
|
1386 |
],
|
1387 |
"optional": true,
|
1388 |
"dependencies": {
|
1389 |
+
"@emnapi/runtime": "^1.1.1"
|
1390 |
},
|
1391 |
"engines": {
|
1392 |
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
|
|
|
1399 |
}
|
1400 |
},
|
1401 |
"node_modules/@img/sharp-win32-ia32": {
|
1402 |
+
"version": "0.33.4",
|
1403 |
+
"resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.4.tgz",
|
1404 |
+
"integrity": "sha512-99SJ91XzUhYHbx7uhK3+9Lf7+LjwMGQZMDlO/E/YVJ7Nc3lyDFZPGhjwiYdctoH2BOzW9+TnfqcaMKt0jHLdqw==",
|
1405 |
"cpu": [
|
1406 |
"ia32"
|
1407 |
],
|
|
|
1420 |
}
|
1421 |
},
|
1422 |
"node_modules/@img/sharp-win32-x64": {
|
1423 |
+
"version": "0.33.4",
|
1424 |
+
"resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.4.tgz",
|
1425 |
+
"integrity": "sha512-3QLocdTRVIrFNye5YocZl+KKpYKP+fksi1QhmOArgx7GyhIbQp/WrJRu176jm8IxromS7RIkzMiMINVdBtC8Aw==",
|
1426 |
"cpu": [
|
1427 |
"x64"
|
1428 |
],
|
|
|
1533 |
}
|
1534 |
},
|
1535 |
"node_modules/@mediapipe/tasks-vision": {
|
1536 |
+
"version": "0.10.14",
|
1537 |
+
"resolved": "https://registry.npmjs.org/@mediapipe/tasks-vision/-/tasks-vision-0.10.14.tgz",
|
1538 |
+
"integrity": "sha512-vOifgZhkndgybdvoRITzRkIueWWSiCKuEUXXK6Q4FaJsFvRJuwgg++vqFUMlL0Uox62U5aEXFhHxlhV7Ja5e3Q=="
|
1539 |
},
|
1540 |
"node_modules/@next/env": {
|
1541 |
"version": "14.2.3",
|
|
|
1718 |
}
|
1719 |
},
|
1720 |
"node_modules/@photo-sphere-viewer/core": {
|
1721 |
+
"version": "5.7.4",
|
1722 |
+
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/core/-/core-5.7.4.tgz",
|
1723 |
+
"integrity": "sha512-NwhJuxSdRrjb7oCJOgvD5ZBMJpgXLZjKhACmebvGB2FIM2A71l3vU/fzAzYjG+xjJt+93pYI/myBhL5Ds6wyYw==",
|
1724 |
"dependencies": {
|
1725 |
"three": "^0.161.0"
|
1726 |
}
|
|
|
1731 |
"integrity": "sha512-LC28VFtjbOyEu5b93K0bNRLw1rQlMJ85lilKsYj6dgTu+7i17W+JCCEbvrpmNHF1F3NAUqDSWq50UD7w9H2xQw=="
|
1732 |
},
|
1733 |
"node_modules/@photo-sphere-viewer/equirectangular-video-adapter": {
|
1734 |
+
"version": "5.7.4",
|
1735 |
+
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/equirectangular-video-adapter/-/equirectangular-video-adapter-5.7.4.tgz",
|
1736 |
+
"integrity": "sha512-x00TPiJAqACISA2GtEUzl85IDXmxquOCqK3F+DKoTOzpCe8ZZNA1XVBI9QfwQYqIaggz6LGz5W7PcyNzWhofOA==",
|
1737 |
"peerDependencies": {
|
1738 |
+
"@photo-sphere-viewer/core": "5.7.4"
|
1739 |
}
|
1740 |
},
|
1741 |
"node_modules/@photo-sphere-viewer/gyroscope-plugin": {
|
1742 |
+
"version": "5.7.4",
|
1743 |
+
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/gyroscope-plugin/-/gyroscope-plugin-5.7.4.tgz",
|
1744 |
+
"integrity": "sha512-WKwXFyJGpiEPL/wrbTPjCIZUiyT4Ct1uV1mVNhYQkuvZERQweLf6/85AMqSMIYCjGqa00XxXPoOjVwZ2zjSVdA==",
|
1745 |
"peerDependencies": {
|
1746 |
+
"@photo-sphere-viewer/core": "5.7.4"
|
1747 |
}
|
1748 |
},
|
1749 |
"node_modules/@photo-sphere-viewer/markers-plugin": {
|
1750 |
+
"version": "5.7.4",
|
1751 |
+
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/markers-plugin/-/markers-plugin-5.7.4.tgz",
|
1752 |
+
"integrity": "sha512-HAR/qsBxOCHHlX2hU1AmjydPr4/wCgZtX2INXeaslM0T4YGq+o97V4S98FRpbQoSyrEPaD2DUl2ZqlXglIqH6Q==",
|
1753 |
"peerDependencies": {
|
1754 |
+
"@photo-sphere-viewer/core": "5.7.4"
|
1755 |
}
|
1756 |
},
|
1757 |
"node_modules/@photo-sphere-viewer/overlays-plugin": {
|
1758 |
+
"version": "5.7.4",
|
1759 |
+
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/overlays-plugin/-/overlays-plugin-5.7.4.tgz",
|
1760 |
+
"integrity": "sha512-+WJX9IIxxZGRHrhBUn31PiTfxU6mwSBkTchQeS0tR0s/LyRoY1UqEMkik4vBabkfhL0DN9XA+GaOi+L70T1ltw==",
|
1761 |
"peerDependencies": {
|
1762 |
+
"@photo-sphere-viewer/core": "5.7.4"
|
1763 |
}
|
1764 |
},
|
1765 |
"node_modules/@photo-sphere-viewer/resolution-plugin": {
|
1766 |
+
"version": "5.7.4",
|
1767 |
+
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/resolution-plugin/-/resolution-plugin-5.7.4.tgz",
|
1768 |
+
"integrity": "sha512-AxbHXP505WwSFXGArb9zzPBEfBWdX3WMSfLQadb9jmyu0/nLYmLdD2SxqZbb5Rl1jIiBkwXxuNmZfBFzvsRUrg==",
|
1769 |
"peerDependencies": {
|
1770 |
+
"@photo-sphere-viewer/core": "5.7.4",
|
1771 |
+
"@photo-sphere-viewer/settings-plugin": "5.7.4"
|
1772 |
}
|
1773 |
},
|
1774 |
"node_modules/@photo-sphere-viewer/settings-plugin": {
|
1775 |
+
"version": "5.7.4",
|
1776 |
+
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/settings-plugin/-/settings-plugin-5.7.4.tgz",
|
1777 |
+
"integrity": "sha512-AMDH4jfuV4DeFZC+CEhxrPeA1fU6isbwblba2Ng5AnUmxVWVyISbfRDRPe2FwOfqV9EFBFDRkHj6dLuD85hEDw==",
|
1778 |
"peerDependencies": {
|
1779 |
+
"@photo-sphere-viewer/core": "5.7.4"
|
1780 |
}
|
1781 |
},
|
1782 |
"node_modules/@photo-sphere-viewer/stereo-plugin": {
|
1783 |
+
"version": "5.7.4",
|
1784 |
+
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/stereo-plugin/-/stereo-plugin-5.7.4.tgz",
|
1785 |
+
"integrity": "sha512-IwMSwEBEbmohQNav53njq23mL4l6/KiD8mXnN9JOlzLg90HHLjYhObX2zXJDyd4iYd6zOHaymkgQ7hbDPx/DZQ==",
|
1786 |
"peerDependencies": {
|
1787 |
+
"@photo-sphere-viewer/core": "5.7.4",
|
1788 |
+
"@photo-sphere-viewer/gyroscope-plugin": "5.7.4"
|
1789 |
}
|
1790 |
},
|
1791 |
"node_modules/@photo-sphere-viewer/video-plugin": {
|
1792 |
+
"version": "5.7.4",
|
1793 |
+
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/video-plugin/-/video-plugin-5.7.4.tgz",
|
1794 |
+
"integrity": "sha512-Zup7lpkFzRWL38HaKsES9qd1aHWPjtF2HK8nQMHZglWJxKn0MTLdaLAiwK2CkXsz7D6dV768md+wro2gIvAuIg==",
|
1795 |
"peerDependencies": {
|
1796 |
+
"@photo-sphere-viewer/core": "5.7.4"
|
1797 |
}
|
1798 |
},
|
1799 |
"node_modules/@photo-sphere-viewer/visible-range-plugin": {
|
1800 |
+
"version": "5.7.4",
|
1801 |
+
"resolved": "https://registry.npmjs.org/@photo-sphere-viewer/visible-range-plugin/-/visible-range-plugin-5.7.4.tgz",
|
1802 |
+
"integrity": "sha512-R1qG9EumglGU1sj0hNtg1rjx2J9pLS3IzGOW1llzjK01RJV4SQLh4Io3W1ElfHG7CisnxuBgDf/iXsQdm0eFeA==",
|
1803 |
"peerDependencies": {
|
1804 |
+
"@photo-sphere-viewer/core": "5.7.4"
|
1805 |
}
|
1806 |
},
|
1807 |
"node_modules/@pkgjs/parseargs": {
|
|
|
2900 |
}
|
2901 |
},
|
2902 |
"node_modules/@rushstack/eslint-patch": {
|
2903 |
+
"version": "1.10.3",
|
2904 |
+
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.10.3.tgz",
|
2905 |
+
"integrity": "sha512-qC/xYId4NMebE6w/V33Fh9gWxLgURiNYgVNObbJl2LZv0GUUItCcCqC5axQSwRaAgaxl2mELq1rMzlswaQ0Zxg=="
|
2906 |
},
|
2907 |
"node_modules/@swc/counter": {
|
2908 |
"version": "0.1.3",
|
|
|
2971 |
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ=="
|
2972 |
},
|
2973 |
"node_modules/@types/lodash": {
|
2974 |
+
"version": "4.17.4",
|
2975 |
+
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.4.tgz",
|
2976 |
+
"integrity": "sha512-wYCP26ZLxaT3R39kiN2+HcJ4kTd3U1waI/cY7ivWYqFP6pW3ZNpvi6Wd6PHZx7T/t8z0vlkXMg3QYLa7DZ/IJQ=="
|
2977 |
},
|
2978 |
"node_modules/@types/lodash.debounce": {
|
2979 |
"version": "4.0.9",
|
|
|
3186 |
}
|
3187 |
},
|
3188 |
"node_modules/@upstash/redis": {
|
3189 |
+
"version": "1.31.1",
|
3190 |
+
"resolved": "https://registry.npmjs.org/@upstash/redis/-/redis-1.31.1.tgz",
|
3191 |
+
"integrity": "sha512-lAsOo+kYjD5lpP+lH/nxHfzFYeCkWBwwKsyZZmh0AoOumBA9ZpS52Gorm7c2bmNu3UFijpPiLSFdW/nRdjbRpQ==",
|
3192 |
"dependencies": {
|
3193 |
"crypto-js": "^4.2.0"
|
3194 |
}
|
|
|
3515 |
"integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ=="
|
3516 |
},
|
3517 |
"node_modules/async": {
|
3518 |
+
"version": "0.2.10",
|
3519 |
+
"resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz",
|
3520 |
+
"integrity": "sha512-eAkdoKxU6/LkKDBzLpT+t6Ff5EtfSF4wx1WfJiPEEV7WNLnDaRXk0oVysiEPm262roaachGexwUv94WhSgN5TQ=="
|
3521 |
},
|
3522 |
"node_modules/asynckit": {
|
3523 |
"version": "0.4.0",
|
|
|
3583 |
}
|
3584 |
},
|
3585 |
"node_modules/axios": {
|
3586 |
+
"version": "1.7.1",
|
3587 |
+
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.1.tgz",
|
3588 |
+
"integrity": "sha512-+LV37nQcd1EpFalkXksWNBiA17NZ5m5/WspmHGmZmdx1qBOg/VNq/c4eRJiA9VQQHBOs+N0ZhhdU10h2TyNK7Q==",
|
3589 |
"dependencies": {
|
3590 |
"follow-redirects": "^1.15.6",
|
3591 |
"form-data": "^4.0.0",
|
|
|
3753 |
}
|
3754 |
},
|
3755 |
"node_modules/caniuse-lite": {
|
3756 |
+
"version": "1.0.30001620",
|
3757 |
+
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001620.tgz",
|
3758 |
+
"integrity": "sha512-WJvYsOjd1/BYUY6SNGUosK9DUidBPDTnOARHp3fSmFO1ekdxaY6nKRttEVrfMmYi80ctS0kz1wiWmm14fVc3ew==",
|
3759 |
"funding": [
|
3760 |
{
|
3761 |
"type": "opencollective",
|
|
|
4332 |
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="
|
4333 |
},
|
4334 |
"node_modules/electron-to-chromium": {
|
4335 |
+
"version": "1.4.774",
|
4336 |
+
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.774.tgz",
|
4337 |
+
"integrity": "sha512-132O1XCd7zcTkzS3FgkAzKmnBuNJjK8WjcTtNuoylj7MYbqw5eXehjQ5OK91g0zm7OTKIPeaAG4CPoRfD9M1Mg=="
|
4338 |
},
|
4339 |
"node_modules/elliptic": {
|
4340 |
"version": "6.5.4",
|
|
|
5162 |
"integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw=="
|
5163 |
},
|
5164 |
"node_modules/fluent-ffmpeg": {
|
5165 |
+
"version": "2.1.3",
|
5166 |
+
"resolved": "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.3.tgz",
|
5167 |
+
"integrity": "sha512-Be3narBNt2s6bsaqP6Jzq91heDgOEaDCJAXcE3qcma/EJBSy5FB4cvO31XBInuAuKBx8Kptf8dkhjK0IOru39Q==",
|
5168 |
"dependencies": {
|
5169 |
+
"async": "^0.2.9",
|
5170 |
"which": "^1.1.1"
|
5171 |
},
|
5172 |
"engines": {
|
5173 |
+
"node": ">=18"
|
5174 |
}
|
5175 |
},
|
5176 |
"node_modules/fluent-ffmpeg/node_modules/which": {
|
|
|
6705 |
}
|
6706 |
},
|
6707 |
"node_modules/openai": {
|
6708 |
+
"version": "4.47.1",
|
6709 |
+
"resolved": "https://registry.npmjs.org/openai/-/openai-4.47.1.tgz",
|
6710 |
+
"integrity": "sha512-WWSxhC/69ZhYWxH/OBsLEirIjUcfpQ5+ihkXKp06hmeYXgBBIUCa9IptMzYx6NdkiOCsSGYCnTIsxaic3AjRCQ==",
|
6711 |
"dependencies": {
|
6712 |
"@types/node": "^18.11.18",
|
6713 |
"@types/node-fetch": "^2.6.4",
|
|
|
6820 |
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
|
6821 |
},
|
6822 |
"node_modules/path-scurry": {
|
6823 |
+
"version": "1.11.1",
|
6824 |
+
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
|
6825 |
+
"integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
|
6826 |
"dependencies": {
|
6827 |
"lru-cache": "^10.2.0",
|
6828 |
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
|
6829 |
},
|
6830 |
"engines": {
|
6831 |
+
"node": ">=16 || 14 >=14.18"
|
6832 |
},
|
6833 |
"funding": {
|
6834 |
"url": "https://github.com/sponsors/isaacs"
|
|
|
6860 |
}
|
6861 |
},
|
6862 |
"node_modules/picocolors": {
|
6863 |
+
"version": "1.0.1",
|
6864 |
+
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz",
|
6865 |
+
"integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew=="
|
6866 |
},
|
6867 |
"node_modules/picomatch": {
|
6868 |
"version": "2.3.1",
|
|
|
7616 |
"integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ=="
|
7617 |
},
|
7618 |
"node_modules/sharp": {
|
7619 |
+
"version": "0.33.4",
|
7620 |
+
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.4.tgz",
|
7621 |
+
"integrity": "sha512-7i/dt5kGl7qR4gwPRD2biwD2/SvBn3O04J77XKFgL2OnZtQw+AG9wnuS/csmu80nPRHLYE9E41fyEiG8nhH6/Q==",
|
7622 |
"hasInstallScript": true,
|
7623 |
"dependencies": {
|
7624 |
"color": "^4.2.3",
|
|
|
7633 |
"url": "https://opencollective.com/libvips"
|
7634 |
},
|
7635 |
"optionalDependencies": {
|
7636 |
+
"@img/sharp-darwin-arm64": "0.33.4",
|
7637 |
+
"@img/sharp-darwin-x64": "0.33.4",
|
7638 |
"@img/sharp-libvips-darwin-arm64": "1.0.2",
|
7639 |
"@img/sharp-libvips-darwin-x64": "1.0.2",
|
7640 |
"@img/sharp-libvips-linux-arm": "1.0.2",
|
|
|
7643 |
"@img/sharp-libvips-linux-x64": "1.0.2",
|
7644 |
"@img/sharp-libvips-linuxmusl-arm64": "1.0.2",
|
7645 |
"@img/sharp-libvips-linuxmusl-x64": "1.0.2",
|
7646 |
+
"@img/sharp-linux-arm": "0.33.4",
|
7647 |
+
"@img/sharp-linux-arm64": "0.33.4",
|
7648 |
+
"@img/sharp-linux-s390x": "0.33.4",
|
7649 |
+
"@img/sharp-linux-x64": "0.33.4",
|
7650 |
+
"@img/sharp-linuxmusl-arm64": "0.33.4",
|
7651 |
+
"@img/sharp-linuxmusl-x64": "0.33.4",
|
7652 |
+
"@img/sharp-wasm32": "0.33.4",
|
7653 |
+
"@img/sharp-win32-ia32": "0.33.4",
|
7654 |
+
"@img/sharp-win32-x64": "0.33.4"
|
7655 |
}
|
7656 |
},
|
7657 |
"node_modules/shebang-command": {
|
|
|
8019 |
}
|
8020 |
},
|
8021 |
"node_modules/sucrase/node_modules/glob": {
|
8022 |
+
"version": "10.3.15",
|
8023 |
+
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.15.tgz",
|
8024 |
+
"integrity": "sha512-0c6RlJt1TICLyvJYIApxb8GsXoai0KUP7AxKKAtsYXdgJR1mGEUa7DgwShbdk1nly0PYoZj01xd4hzbq3fsjpw==",
|
8025 |
"dependencies": {
|
8026 |
"foreground-child": "^3.1.0",
|
8027 |
"jackspeak": "^2.3.6",
|
|
|
8033 |
"glob": "dist/esm/bin.mjs"
|
8034 |
},
|
8035 |
"engines": {
|
8036 |
+
"node": ">=16 || 14 >=14.18"
|
8037 |
},
|
8038 |
"funding": {
|
8039 |
"url": "https://github.com/sponsors/isaacs"
|
|
|
8421 |
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
|
8422 |
},
|
8423 |
"node_modules/update-browserslist-db": {
|
8424 |
+
"version": "1.0.16",
|
8425 |
+
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz",
|
8426 |
+
"integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==",
|
8427 |
"funding": [
|
8428 |
{
|
8429 |
"type": "opencollective",
|
|
|
8440 |
],
|
8441 |
"dependencies": {
|
8442 |
"escalade": "^3.1.2",
|
8443 |
+
"picocolors": "^1.0.1"
|
8444 |
},
|
8445 |
"bin": {
|
8446 |
"update-browserslist-db": "cli.js"
|
|
|
8568 |
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
8569 |
},
|
8570 |
"node_modules/websocket": {
|
8571 |
+
"version": "1.0.35",
|
8572 |
+
"resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.35.tgz",
|
8573 |
+
"integrity": "sha512-/REy6amwPZl44DDzvRCkaI1q1bIiQB0mEFQLUrhz3z2EK91cp3n72rAjUlrTP0zV22HJIUOVHQGPxhFRjxjt+Q==",
|
8574 |
"dependencies": {
|
8575 |
"bufferutil": "^4.0.1",
|
8576 |
"debug": "^2.2.0",
|
8577 |
+
"es5-ext": "^0.10.63",
|
8578 |
"typedarray-to-buffer": "^3.1.5",
|
8579 |
"utf-8-validate": "^5.0.2",
|
8580 |
"yaeti": "^0.0.6"
|
package.json
CHANGED
@@ -10,13 +10,13 @@
|
|
10 |
"lint": "next lint"
|
11 |
},
|
12 |
"dependencies": {
|
13 |
-
"@aitube/clap": "0.0.
|
14 |
-
"@aitube/client": "0.0.
|
15 |
-
"@aitube/engine": "0.0.
|
16 |
"@huggingface/hub": "0.12.3-oauth",
|
17 |
-
"@huggingface/inference": "^2.
|
18 |
"@jcoreio/async-throttle": "^1.6.0",
|
19 |
-
"@mediapipe/tasks-vision": "^0.10.
|
20 |
"@photo-sphere-viewer/core": "^5.7.2",
|
21 |
"@photo-sphere-viewer/equirectangular-video-adapter": "^5.7.2",
|
22 |
"@photo-sphere-viewer/gyroscope-plugin": "^5.7.2",
|
|
|
10 |
"lint": "next lint"
|
11 |
},
|
12 |
"dependencies": {
|
13 |
+
"@aitube/clap": "0.0.19",
|
14 |
+
"@aitube/client": "0.0.28",
|
15 |
+
"@aitube/engine": "0.0.10",
|
16 |
"@huggingface/hub": "0.12.3-oauth",
|
17 |
+
"@huggingface/inference": "^2.7.0",
|
18 |
"@jcoreio/async-throttle": "^1.6.0",
|
19 |
+
"@mediapipe/tasks-vision": "^0.10.14",
|
20 |
"@photo-sphere-viewer/core": "^5.7.2",
|
21 |
"@photo-sphere-viewer/equirectangular-video-adapter": "^5.7.2",
|
22 |
"@photo-sphere-viewer/gyroscope-plugin": "^5.7.2",
|
src/app/api/generators/clap/addLatentScenesToClap.ts
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
import { ClapProject, newSegment } from "@aitube/clap"
|
4 |
|
5 |
import { LatentScenes } from "./types"
|
|
|
6 |
|
7 |
-
let defaultSegmentDurationInMs = 2000
|
8 |
|
9 |
/**
|
10 |
* This generates a fully valid Clap blob (compressed archive)
|
|
|
3 |
import { ClapProject, newSegment } from "@aitube/clap"
|
4 |
|
5 |
import { LatentScenes } from "./types"
|
6 |
+
import { defaultSegmentDurationInMs } from "./constants"
|
7 |
|
|
|
8 |
|
9 |
/**
|
10 |
* This generates a fully valid Clap blob (compressed archive)
|
src/app/api/generators/clap/constants.ts
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
export const defaultSegmentDurationInMs = 2000
|
src/app/api/parsers/parseNumericTime.ts
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { getValidNumber } from "@aitube/clap"
|
2 |
+
|
3 |
+
export function parseNumericTime(
|
4 |
+
input: any,
|
5 |
+
minValue: number,
|
6 |
+
maxValue: number,
|
7 |
+
defaultValue: number
|
8 |
+
): number {
|
9 |
+
let value = defaultValue
|
10 |
+
|
11 |
+
try {
|
12 |
+
let maybeNumber = decodeURIComponent(`${input || value}`).trim().toLowerCase()
|
13 |
+
|
14 |
+
return getValidNumber(maybeNumber, minValue, maxValue, defaultValue)
|
15 |
+
} catch (err) {}
|
16 |
+
|
17 |
+
return defaultValue
|
18 |
+
}
|
src/app/api/v1/create/index.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
"use server"
|
2 |
|
3 |
-
import { ClapProject, getValidNumber, newClap, newSegment, ClapSegmentCategory, ClapOutputType, ClapMediaOrientation } from "@aitube/clap"
|
4 |
|
5 |
import { sleep } from "@/lib/utils/sleep"
|
6 |
import { predict } from "@/app/api/providers/huggingface/predictWithHuggingFace"
|
@@ -144,7 +144,7 @@ Output: `
|
|
144 |
category: ClapSegmentCategory.VIDEO,
|
145 |
prompt: image,
|
146 |
outputType: ClapOutputType.VIDEO,
|
147 |
-
status:
|
148 |
}))
|
149 |
|
150 |
clap.segments.push(newSegment({
|
@@ -155,7 +155,7 @@ Output: `
|
|
155 |
category: ClapSegmentCategory.STORYBOARD,
|
156 |
prompt: image,
|
157 |
outputType: ClapOutputType.IMAGE,
|
158 |
-
status:
|
159 |
}))
|
160 |
|
161 |
if (hasCaptions) {
|
@@ -169,7 +169,7 @@ Output: `
|
|
169 |
// assetUrl: `data:text/plain;base64,${btoa(comment)}`,
|
170 |
assetUrl: comment,
|
171 |
outputType: ClapOutputType.TEXT,
|
172 |
-
status:
|
173 |
}))
|
174 |
}
|
175 |
|
@@ -181,7 +181,7 @@ Output: `
|
|
181 |
category: ClapSegmentCategory.DIALOGUE,
|
182 |
prompt: voice,
|
183 |
outputType: ClapOutputType.AUDIO,
|
184 |
-
status:
|
185 |
}))
|
186 |
|
187 |
// the presence of a camera is mandatory
|
@@ -193,7 +193,7 @@ Output: `
|
|
193 |
category: ClapSegmentCategory.CAMERA,
|
194 |
prompt: "video",
|
195 |
outputType: ClapOutputType.TEXT,
|
196 |
-
status:
|
197 |
}))
|
198 |
|
199 |
currentElapsedTimeInMs += defaultSegmentDurationInMs
|
@@ -222,7 +222,7 @@ Output: `
|
|
222 |
category: ClapSegmentCategory.SOUND,
|
223 |
prompt: soundPrompt,
|
224 |
outputType: ClapOutputType.AUDIO,
|
225 |
-
status:
|
226 |
}))
|
227 |
} catch (err) {
|
228 |
console.error(`[api/v1/create] failed to generate sound prompts`)
|
@@ -251,7 +251,7 @@ Output: `
|
|
251 |
category: ClapSegmentCategory.MUSIC,
|
252 |
prompt: musicPrompt,
|
253 |
outputType: ClapOutputType.AUDIO,
|
254 |
-
status:
|
255 |
}))
|
256 |
} catch (err) {
|
257 |
console.error(`[api/v1/create] failed to generate music prompts`)
|
|
|
1 |
"use server"
|
2 |
|
3 |
+
import { ClapProject, getValidNumber, newClap, newSegment, ClapSegmentCategory, ClapOutputType, ClapMediaOrientation, ClapSegmentStatus } from "@aitube/clap"
|
4 |
|
5 |
import { sleep } from "@/lib/utils/sleep"
|
6 |
import { predict } from "@/app/api/providers/huggingface/predictWithHuggingFace"
|
|
|
144 |
category: ClapSegmentCategory.VIDEO,
|
145 |
prompt: image,
|
146 |
outputType: ClapOutputType.VIDEO,
|
147 |
+
status: ClapSegmentStatus.TO_GENERATE,
|
148 |
}))
|
149 |
|
150 |
clap.segments.push(newSegment({
|
|
|
155 |
category: ClapSegmentCategory.STORYBOARD,
|
156 |
prompt: image,
|
157 |
outputType: ClapOutputType.IMAGE,
|
158 |
+
status: ClapSegmentStatus.TO_GENERATE,
|
159 |
}))
|
160 |
|
161 |
if (hasCaptions) {
|
|
|
169 |
// assetUrl: `data:text/plain;base64,${btoa(comment)}`,
|
170 |
assetUrl: comment,
|
171 |
outputType: ClapOutputType.TEXT,
|
172 |
+
status: ClapSegmentStatus.TO_GENERATE,
|
173 |
}))
|
174 |
}
|
175 |
|
|
|
181 |
category: ClapSegmentCategory.DIALOGUE,
|
182 |
prompt: voice,
|
183 |
outputType: ClapOutputType.AUDIO,
|
184 |
+
status: ClapSegmentStatus.TO_GENERATE,
|
185 |
}))
|
186 |
|
187 |
// the presence of a camera is mandatory
|
|
|
193 |
category: ClapSegmentCategory.CAMERA,
|
194 |
prompt: "video",
|
195 |
outputType: ClapOutputType.TEXT,
|
196 |
+
status: ClapSegmentStatus.TO_GENERATE,
|
197 |
}))
|
198 |
|
199 |
currentElapsedTimeInMs += defaultSegmentDurationInMs
|
|
|
222 |
category: ClapSegmentCategory.SOUND,
|
223 |
prompt: soundPrompt,
|
224 |
outputType: ClapOutputType.AUDIO,
|
225 |
+
status: ClapSegmentStatus.TO_GENERATE,
|
226 |
}))
|
227 |
} catch (err) {
|
228 |
console.error(`[api/v1/create] failed to generate sound prompts`)
|
|
|
251 |
category: ClapSegmentCategory.MUSIC,
|
252 |
prompt: musicPrompt,
|
253 |
outputType: ClapOutputType.AUDIO,
|
254 |
+
status: ClapSegmentStatus.TO_GENERATE,
|
255 |
}))
|
256 |
} catch (err) {
|
257 |
console.error(`[api/v1/create] failed to generate music prompts`)
|
src/app/api/v1/edit/dialogues/processShot.ts
CHANGED
@@ -5,7 +5,8 @@ import {
|
|
5 |
getClapAssetSourceType,
|
6 |
filterSegments,
|
7 |
ClapSegmentFilteringMode,
|
8 |
-
ClapSegmentCategory
|
|
|
9 |
} from "@aitube/clap"
|
10 |
import { ClapCompletionMode } from "@aitube/client"
|
11 |
import { getSpeechBackgroundAudioPrompt } from "@aitube/engine"
|
@@ -58,7 +59,7 @@ export async function processShot({
|
|
58 |
})
|
59 |
shotDialogueSegment.assetSourceType = getClapAssetSourceType(shotDialogueSegment.assetUrl)
|
60 |
|
61 |
-
shotDialogueSegment.status =
|
62 |
|
63 |
const { durationInMs, hasAudio } = await getMediaInfo(shotDialogueSegment.assetUrl)
|
64 |
|
|
|
5 |
getClapAssetSourceType,
|
6 |
filterSegments,
|
7 |
ClapSegmentFilteringMode,
|
8 |
+
ClapSegmentCategory,
|
9 |
+
ClapSegmentStatus
|
10 |
} from "@aitube/clap"
|
11 |
import { ClapCompletionMode } from "@aitube/client"
|
12 |
import { getSpeechBackgroundAudioPrompt } from "@aitube/engine"
|
|
|
59 |
})
|
60 |
shotDialogueSegment.assetSourceType = getClapAssetSourceType(shotDialogueSegment.assetUrl)
|
61 |
|
62 |
+
shotDialogueSegment.status = ClapSegmentStatus.COMPLETED
|
63 |
|
64 |
const { durationInMs, hasAudio } = await getMediaInfo(shotDialogueSegment.assetUrl)
|
65 |
|
src/app/api/v1/edit/music/generateMusic.ts
CHANGED
@@ -6,6 +6,7 @@ import {
|
|
6 |
filterSegments,
|
7 |
ClapSegmentFilteringMode,
|
8 |
ClapSegmentCategory,
|
|
|
9 |
newSegment
|
10 |
} from "@aitube/clap"
|
11 |
import { ClapCompletionMode } from "@aitube/client"
|
@@ -82,7 +83,7 @@ export async function generateMusic({
|
|
82 |
assetDurationInMs: durationInMs,
|
83 |
assetSourceType: getClapAssetSourceType(assetUrl),
|
84 |
outputGain: 1.0,
|
85 |
-
status:
|
86 |
}
|
87 |
|
88 |
if (!hasAudio) {
|
|
|
6 |
filterSegments,
|
7 |
ClapSegmentFilteringMode,
|
8 |
ClapSegmentCategory,
|
9 |
+
ClapSegmentStatus,
|
10 |
newSegment
|
11 |
} from "@aitube/clap"
|
12 |
import { ClapCompletionMode } from "@aitube/client"
|
|
|
83 |
assetDurationInMs: durationInMs,
|
84 |
assetSourceType: getClapAssetSourceType(assetUrl),
|
85 |
outputGain: 1.0,
|
86 |
+
status: ClapSegmentStatus.COMPLETED,
|
87 |
}
|
88 |
|
89 |
if (!hasAudio) {
|
src/app/api/v1/edit/music/systemPrompt.ts
CHANGED
@@ -29,7 +29,7 @@ Given the following input story, provided as YAML:
|
|
29 |
- shot: 2
|
30 |
comment: "The witch gives her counsel but warns of an unknown cost."
|
31 |
image: "close-up shot of THE WITCH, smiling cunningly, raising a finger while speaking. Background bokeh, dim lightning, menacing, mysterious."
|
32 |
-
voice: "Your Majesty, this will be a bloody battle, but I espy a way to victory for you.
|
33 |
- shot: 3
|
34 |
comment: "The words of the witch are sinking in, but King Arthus tries to appear strong"
|
35 |
image: "close-up shot on KING ARTHUS, looking concerned, somber, false confidence"
|
|
|
29 |
- shot: 2
|
30 |
comment: "The witch gives her counsel but warns of an unknown cost."
|
31 |
image: "close-up shot of THE WITCH, smiling cunningly, raising a finger while speaking. Background bokeh, dim lightning, menacing, mysterious."
|
32 |
+
voice: "Your Majesty, this will be a bloody battle, but I espy a way to victory for you. If my advice you follow, victory I foresee, although at a great cost it will be."
|
33 |
- shot: 3
|
34 |
comment: "The words of the witch are sinking in, but King Arthus tries to appear strong"
|
35 |
image: "close-up shot on KING ARTHUS, looking concerned, somber, false confidence"
|
src/app/api/v1/edit/sounds/generateSound.ts
CHANGED
@@ -6,6 +6,7 @@ import {
|
|
6 |
filterSegments,
|
7 |
ClapSegmentFilteringMode,
|
8 |
ClapSegmentCategory,
|
|
|
9 |
newSegment
|
10 |
} from "@aitube/clap"
|
11 |
import { ClapCompletionMode } from "@aitube/client"
|
@@ -69,7 +70,7 @@ export async function generateSound({
|
|
69 |
assetUrl,
|
70 |
assetDurationInMs: durationInMs,
|
71 |
outputGain: 1.0,
|
72 |
-
status:
|
73 |
}
|
74 |
|
75 |
|
|
|
6 |
filterSegments,
|
7 |
ClapSegmentFilteringMode,
|
8 |
ClapSegmentCategory,
|
9 |
+
ClapSegmentStatus,
|
10 |
newSegment
|
11 |
} from "@aitube/clap"
|
12 |
import { ClapCompletionMode } from "@aitube/client"
|
|
|
70 |
assetUrl,
|
71 |
assetDurationInMs: durationInMs,
|
72 |
outputGain: 1.0,
|
73 |
+
status: ClapSegmentStatus.COMPLETED,
|
74 |
}
|
75 |
|
76 |
|
src/app/api/v1/edit/sounds/processShot.ts
CHANGED
@@ -5,7 +5,8 @@ import {
|
|
5 |
getClapAssetSourceType,
|
6 |
filterSegments,
|
7 |
ClapSegmentFilteringMode,
|
8 |
-
ClapSegmentCategory
|
|
|
9 |
} from "@aitube/clap"
|
10 |
import { ClapCompletionMode } from "@aitube/client"
|
11 |
|
@@ -54,7 +55,7 @@ export async function processShot({
|
|
54 |
})
|
55 |
shotSoundSegment.assetSourceType = getClapAssetSourceType(shotSoundSegment.assetUrl)
|
56 |
|
57 |
-
shotSoundSegment.status =
|
58 |
|
59 |
const { durationInMs, hasAudio } = await getMediaInfo(shotSoundSegment.assetUrl)
|
60 |
|
|
|
5 |
getClapAssetSourceType,
|
6 |
filterSegments,
|
7 |
ClapSegmentFilteringMode,
|
8 |
+
ClapSegmentCategory,
|
9 |
+
ClapSegmentStatus
|
10 |
} from "@aitube/clap"
|
11 |
import { ClapCompletionMode } from "@aitube/client"
|
12 |
|
|
|
55 |
})
|
56 |
shotSoundSegment.assetSourceType = getClapAssetSourceType(shotSoundSegment.assetUrl)
|
57 |
|
58 |
+
shotSoundSegment.status = ClapSegmentStatus.COMPLETED
|
59 |
|
60 |
const { durationInMs, hasAudio } = await getMediaInfo(shotSoundSegment.assetUrl)
|
61 |
|
src/app/api/v1/edit/story/extendClapStory.ts
ADDED
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
import {
|
3 |
+
ClapProject,
|
4 |
+
ClapSegmentCategory,
|
5 |
+
newSegment,
|
6 |
+
ClapOutputType,
|
7 |
+
ClapSegmentStatus
|
8 |
+
} from "@aitube/clap"
|
9 |
+
import { ClapCompletionMode } from "@aitube/client"
|
10 |
+
|
11 |
+
import { clapToLatentStory } from "../entities/clapToLatentStory"
|
12 |
+
import { LatentStory } from "../../types"
|
13 |
+
import { extendLatentStoryWithMoreShots } from "./extendLatentStoryWithMoreShots"
|
14 |
+
|
15 |
+
export async function extendClapStory({
|
16 |
+
prompt: maybePrompt,
|
17 |
+
startTimeInMs,
|
18 |
+
endTimeInMs,
|
19 |
+
existingClap,
|
20 |
+
newerClap,
|
21 |
+
mode,
|
22 |
+
turbo,
|
23 |
+
}: {
|
24 |
+
prompt?: string
|
25 |
+
startTimeInMs?: number
|
26 |
+
endTimeInMs?: number
|
27 |
+
existingClap: ClapProject
|
28 |
+
newerClap: ClapProject
|
29 |
+
mode: ClapCompletionMode
|
30 |
+
turbo: boolean
|
31 |
+
}): Promise<void> {
|
32 |
+
|
33 |
+
const prompt = typeof maybePrompt === "string" && maybePrompt.length > 0
|
34 |
+
? maybePrompt
|
35 |
+
: existingClap.meta.description
|
36 |
+
|
37 |
+
const latentStory: LatentStory[] = await clapToLatentStory(existingClap)
|
38 |
+
|
39 |
+
const shots: LatentStory[] = await extendLatentStoryWithMoreShots({
|
40 |
+
prompt,
|
41 |
+
latentStory,
|
42 |
+
nbShots: 4,
|
43 |
+
turbo,
|
44 |
+
})
|
45 |
+
|
46 |
+
let hasCaptions = false
|
47 |
+
|
48 |
+
let currentElapsedTimeInMs = 0
|
49 |
+
for (const s of existingClap.segments) {
|
50 |
+
if (s.category === ClapSegmentCategory.INTERFACE) { hasCaptions = true }
|
51 |
+
if (s.endTimeInMs > currentElapsedTimeInMs) { currentElapsedTimeInMs = s.endTimeInMs }
|
52 |
+
}
|
53 |
+
|
54 |
+
// this is approximate - TTS generation will determine the final duration of each shot
|
55 |
+
const defaultSegmentDurationInMs = 3000
|
56 |
+
|
57 |
+
for (const { comment, image, voice } of shots) {
|
58 |
+
|
59 |
+
// console.log(`api/v1/edit:story(): - ${comment}`)
|
60 |
+
|
61 |
+
// note: it would be nice if we could have a convention saying that
|
62 |
+
// track 0 is for videos and track 1 storyboards
|
63 |
+
//
|
64 |
+
// however, that's a bit constraining as people will generate .clap
|
65 |
+
// using all kind of tools and development experience,
|
66 |
+
// and they may not wish to learn the Clap protocol format completely
|
67 |
+
//
|
68 |
+
// TL;DR:
|
69 |
+
// we should fix the Clap file editor to make it able to react videos
|
70 |
+
// from any track number
|
71 |
+
|
72 |
+
newerClap.segments.push(newSegment({
|
73 |
+
track: 0,
|
74 |
+
startTimeInMs: currentElapsedTimeInMs,
|
75 |
+
endTimeInMs: currentElapsedTimeInMs + defaultSegmentDurationInMs,
|
76 |
+
assetDurationInMs: defaultSegmentDurationInMs,
|
77 |
+
category: ClapSegmentCategory.VIDEO,
|
78 |
+
prompt: image,
|
79 |
+
outputType: ClapOutputType.VIDEO,
|
80 |
+
status: ClapSegmentStatus.TO_GENERATE,
|
81 |
+
}))
|
82 |
+
|
83 |
+
newerClap.segments.push(newSegment({
|
84 |
+
track: 1,
|
85 |
+
startTimeInMs: currentElapsedTimeInMs,
|
86 |
+
endTimeInMs: currentElapsedTimeInMs + defaultSegmentDurationInMs,
|
87 |
+
assetDurationInMs: defaultSegmentDurationInMs,
|
88 |
+
category: ClapSegmentCategory.STORYBOARD,
|
89 |
+
prompt: image,
|
90 |
+
outputType: ClapOutputType.IMAGE,
|
91 |
+
status: ClapSegmentStatus.TO_GENERATE,
|
92 |
+
}))
|
93 |
+
|
94 |
+
if (hasCaptions) {
|
95 |
+
newerClap.segments.push(newSegment({
|
96 |
+
track: 2,
|
97 |
+
startTimeInMs: currentElapsedTimeInMs,
|
98 |
+
endTimeInMs: currentElapsedTimeInMs + defaultSegmentDurationInMs,
|
99 |
+
assetDurationInMs: defaultSegmentDurationInMs,
|
100 |
+
category: ClapSegmentCategory.INTERFACE,
|
101 |
+
prompt: comment,
|
102 |
+
// assetUrl: `data:text/plain;base64,${btoa(comment)}`,
|
103 |
+
assetUrl: comment,
|
104 |
+
outputType: ClapOutputType.TEXT,
|
105 |
+
status: ClapSegmentStatus.TO_GENERATE,
|
106 |
+
}))
|
107 |
+
}
|
108 |
+
|
109 |
+
newerClap.segments.push(newSegment({
|
110 |
+
track: 3,
|
111 |
+
startTimeInMs: currentElapsedTimeInMs,
|
112 |
+
endTimeInMs: currentElapsedTimeInMs + defaultSegmentDurationInMs,
|
113 |
+
assetDurationInMs: defaultSegmentDurationInMs,
|
114 |
+
category: ClapSegmentCategory.DIALOGUE,
|
115 |
+
prompt: voice,
|
116 |
+
outputType: ClapOutputType.AUDIO,
|
117 |
+
status: ClapSegmentStatus.TO_GENERATE,
|
118 |
+
}))
|
119 |
+
|
120 |
+
// the presence of a camera is mandatory
|
121 |
+
newerClap.segments.push(newSegment({
|
122 |
+
track: 4,
|
123 |
+
startTimeInMs: currentElapsedTimeInMs,
|
124 |
+
endTimeInMs: currentElapsedTimeInMs + defaultSegmentDurationInMs,
|
125 |
+
assetDurationInMs: defaultSegmentDurationInMs,
|
126 |
+
category: ClapSegmentCategory.CAMERA,
|
127 |
+
prompt: "video",
|
128 |
+
outputType: ClapOutputType.TEXT,
|
129 |
+
status: ClapSegmentStatus.TO_GENERATE,
|
130 |
+
}))
|
131 |
+
|
132 |
+
currentElapsedTimeInMs += defaultSegmentDurationInMs
|
133 |
+
}
|
134 |
+
console.log(`extendClapStory(): extended the story by ${shots.length} shots using prompt: ${prompt}`)
|
135 |
+
}
|
src/app/api/v1/edit/story/extendLatentStoryWithMoreShots.ts
ADDED
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import YAML from "yaml"
|
2 |
+
|
3 |
+
import { sleep } from "@/lib/utils/sleep"
|
4 |
+
import { predict } from "@/app/api/providers/huggingface/predictWithHuggingFace"
|
5 |
+
import { parseRawStringToYAML } from "@/app/api/parsers/parseRawStringToYAML"
|
6 |
+
import { LatentStory } from "@/app/api/v1/types"
|
7 |
+
|
8 |
+
import { systemPromptExtendStory } from "./systemPromptExtendStory"
|
9 |
+
|
10 |
+
export async function extendLatentStoryWithMoreShots({
|
11 |
+
prompt = "",
|
12 |
+
latentStory = [],
|
13 |
+
nbShots = 4,
|
14 |
+
turbo = false,
|
15 |
+
}: {
|
16 |
+
prompt?: string
|
17 |
+
latentStory?: LatentStory[]
|
18 |
+
nbShots?: number
|
19 |
+
turbo?: boolean
|
20 |
+
} = {
|
21 |
+
prompt: "",
|
22 |
+
latentStory: [],
|
23 |
+
nbShots: 4,
|
24 |
+
turbo: false
|
25 |
+
}): Promise<LatentStory[]> {
|
26 |
+
|
27 |
+
if (!prompt.length) { throw new Error(`please provide a prompt`) }
|
28 |
+
|
29 |
+
if (!latentStory.length) { throw new Error(`please provide a story`) }
|
30 |
+
|
31 |
+
// console.log("generateEntityPrompts(): latentStory:", latentStory)
|
32 |
+
|
33 |
+
// this is where we are going to have some trouble:
|
34 |
+
// basically we need to slice this to only keep the remaining part
|
35 |
+
// OR use a model with a large token window, like Gemini 🤷
|
36 |
+
|
37 |
+
const nbMaxCharacters = 2700
|
38 |
+
|
39 |
+
let initialStory = YAML.stringify(
|
40 |
+
// we need to help the LLM by marking the shots with a simple numeric ID
|
41 |
+
latentStory.map((shot, i) => ({
|
42 |
+
shot: i,
|
43 |
+
...shot,
|
44 |
+
}))
|
45 |
+
)
|
46 |
+
|
47 |
+
let compressedStory = initialStory
|
48 |
+
|
49 |
+
console.log(`extendLatentStoryWithMoreShots(): generated a story prompt from ${latentStory.length} shots (chars)`)
|
50 |
+
|
51 |
+
|
52 |
+
// we crop the beginning
|
53 |
+
if (compressedStory.length > nbMaxCharacters) {
|
54 |
+
compressedStory = compressedStory.slice(compressedStory.length - nbMaxCharacters, compressedStory.length)
|
55 |
+
}
|
56 |
+
|
57 |
+
if (compressedStory.length !== initialStory.length) {
|
58 |
+
console.log("extendLatentStoryWithMoreShots(): WARNING: we hit the max character limit (${nbMaxCharacters} chars)")
|
59 |
+
}
|
60 |
+
|
61 |
+
const userPrompt = `General description of the whole video: ${prompt}
|
62 |
+
|
63 |
+
number of shots to extend: ${nbShots}
|
64 |
+
|
65 |
+
\`\`\`yaml
|
66 |
+
${compressedStory}
|
67 |
+
\`\`\`
|
68 |
+
|
69 |
+
# YAML-only output
|
70 |
+
`
|
71 |
+
|
72 |
+
const prefix = "```yaml\n"
|
73 |
+
const nbMaxNewTokens = nbShots * 300
|
74 |
+
|
75 |
+
// TODO use streaming for the Hugging Face prediction
|
76 |
+
//
|
77 |
+
// note that a Clap file is actually a YAML stream of documents
|
78 |
+
// so technically we could stream everything from end-to-end
|
79 |
+
// (but I haven't coded the helpers to do this yet)
|
80 |
+
let rawString = await predict({
|
81 |
+
systemPrompt: systemPromptExtendStory,
|
82 |
+
userPrompt,
|
83 |
+
nbMaxNewTokens,
|
84 |
+
prefix,
|
85 |
+
turbo,
|
86 |
+
})
|
87 |
+
|
88 |
+
// console.log("api/v1/create(): rawString: ", rawString)
|
89 |
+
|
90 |
+
let newShots: LatentStory[] = []
|
91 |
+
|
92 |
+
let maybeNewShots = parseRawStringToYAML<LatentStory[]>(rawString, [])
|
93 |
+
|
94 |
+
if (!Array.isArray(maybeNewShots) || maybeNewShots.length === 0) {
|
95 |
+
console.log(`api/v1/create(): failed to generate new shots.. trying again`)
|
96 |
+
|
97 |
+
await sleep(2000)
|
98 |
+
|
99 |
+
rawString = await predict({
|
100 |
+
systemPrompt: systemPromptExtendStory,
|
101 |
+
userPrompt: userPrompt + ".", // we trick the Hugging Face cache
|
102 |
+
nbMaxNewTokens,
|
103 |
+
prefix,
|
104 |
+
turbo,
|
105 |
+
})
|
106 |
+
|
107 |
+
// console.log("api/v1/create(): rawString: ", rawString)
|
108 |
+
|
109 |
+
maybeNewShots = parseRawStringToYAML<LatentStory[]>(rawString, [])
|
110 |
+
if (!Array.isArray(maybeNewShots) || maybeNewShots.length === 0) {
|
111 |
+
console.log(`api/v1/create(): failed to generate new shots for the second time, which indicates an issue with the Hugging Face API`)
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
if (maybeNewShots.length) {
|
116 |
+
newShots = maybeNewShots
|
117 |
+
} else {
|
118 |
+
throw new Error(`Hugging Face Inference API failure (the model failed to generate the shots)`)
|
119 |
+
}
|
120 |
+
|
121 |
+
console.log(`api/v1/create(): generated ${newShots.length} new shots`)
|
122 |
+
|
123 |
+
return newShots
|
124 |
+
}
|
src/app/api/v1/edit/story/route.ts
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { NextResponse, NextRequest } from "next/server"
|
2 |
+
import queryString from "query-string"
|
3 |
+
import { ClapProject, ClapSegment, ClapSegmentCategory, newClap, parseClap, serializeClap } from "@aitube/clap"
|
4 |
+
|
5 |
+
import { parseCompletionMode } from "@/app/api/parsers/parseCompletionMode"
|
6 |
+
import { throwIfInvalidToken } from "@/app/api/v1/auth/throwIfInvalidToken"
|
7 |
+
|
8 |
+
import { ClapCompletionMode } from "@aitube/client"
|
9 |
+
import { parseTurbo } from "@/app/api/parsers/parseTurbo"
|
10 |
+
import { parsePrompt } from "@/app/api/parsers/parsePrompt"
|
11 |
+
import { extendClapStory } from "./extendClapStory"
|
12 |
+
import { parseNumericTime } from "@/app/api/parsers/parseNumericTime"
|
13 |
+
|
14 |
+
// a helper to extend a story
|
15 |
+
//
|
16 |
+
// we can assume it will be used to extend existing projects,
|
17 |
+
// so it is strongly recommended to NOT send the storyboards and videos!
|
18 |
+
export async function POST(req: NextRequest) {
|
19 |
+
await throwIfInvalidToken(req.headers.get("Authorization"))
|
20 |
+
|
21 |
+
const qs = queryString.parseUrl(req.url || "")
|
22 |
+
const query = (qs || {}).query
|
23 |
+
|
24 |
+
const prompt = parsePrompt(query?.p)
|
25 |
+
const mode = parseCompletionMode(query?.c)
|
26 |
+
const turbo = parseTurbo(query?.t)
|
27 |
+
|
28 |
+
const startTimeInMs = parseNumericTime(query?.s, 0, 0, 0)
|
29 |
+
const endTimeInMs = parseNumericTime(query?.e, 0, 0, 0)
|
30 |
+
|
31 |
+
const blob = await req.blob()
|
32 |
+
|
33 |
+
const existingClap: ClapProject = await parseClap(blob)
|
34 |
+
|
35 |
+
if (!existingClap?.segments) { throw new Error(`no segment found in the provided clap!`) }
|
36 |
+
|
37 |
+
const newerClap = mode === ClapCompletionMode.FULL ? existingClap : newClap({
|
38 |
+
meta: existingClap.meta
|
39 |
+
})
|
40 |
+
|
41 |
+
// console.log(`api/v1/edit/storyboards(): detected ${existingClap.segments.length} segments`)
|
42 |
+
|
43 |
+
const allShotsSegments: ClapSegment[] = existingClap.segments.filter(s => s.category === ClapSegmentCategory.CAMERA)
|
44 |
+
console.log(`api/v1/edit/storyboards(): detected ${allShotsSegments.length} shots`)
|
45 |
+
|
46 |
+
await extendClapStory({
|
47 |
+
prompt,
|
48 |
+
startTimeInMs: startTimeInMs > 0 ? startTimeInMs : undefined,
|
49 |
+
endTimeInMs: endTimeInMs > 0 ? endTimeInMs : undefined,
|
50 |
+
existingClap,
|
51 |
+
newerClap,
|
52 |
+
mode,
|
53 |
+
turbo,
|
54 |
+
})
|
55 |
+
|
56 |
+
// console.log("DEBUG:", newerClap.segments)
|
57 |
+
|
58 |
+
// console.log(`[api/v1/edit/storyboards] returning the clap augmented with storyboards`)
|
59 |
+
|
60 |
+
return new NextResponse(await serializeClap(newerClap), {
|
61 |
+
status: 200,
|
62 |
+
headers: new Headers({ "content-type": "application/x-gzip" }),
|
63 |
+
})
|
64 |
+
}
|
src/app/api/v1/edit/story/systemPromptExtendStory.ts
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export const systemPromptExtendStory: string = `
|
2 |
+
You are a backend API engine, designed to extend an existing video timeline in a creative yet consistent manner.
|
3 |
+
The videos can be anything, from music videos, advertisements, commercial, static webcams, influencer videos, documentaries, meme compilations, to movie trailers and full-featured movies etc.
|
4 |
+
|
5 |
+
# Prompting guide
|
6 |
+
|
7 |
+
Each shot is composed of:
|
8 |
+
|
9 |
+
- one comment (which will be displayed as an overlay over the video, so keep it short eg. max 10/12 words),
|
10 |
+
- one image (you must describe it using a Stable Diffusion prompt - about ~300 chars - using simple descriptive words and adjectives. Describe facts about characters, location, lights, texture, camera orientation, colors, clothes, movements etc. But don't give your opinion, don't talk about the emotions it evokes etc.)
|
11 |
+
- one voice over (should be short too, about 10 to 15 words)
|
12 |
+
|
13 |
+
# Important final guidelines
|
14 |
+
|
15 |
+
- You MUST reply by writing/completing a YAML list of objects.
|
16 |
+
- Never use Markdown, and don't write anything after then end of the YAML.
|
17 |
+
- In the image description, never give your interpretation on the meaning
|
18 |
+
- Copy the structure of the examples, but not their content: come up with your own original ideal, you should be creativeç
|
19 |
+
- don't add generic comment like "intense action scene" etc. In this context, the comments MUST be funny and from the point of view of a young person (eg. a millenial, tired of adult life)
|
20 |
+
- In the image text, don't say things like "giving a sense of.."
|
21 |
+
|
22 |
+
# Example Input
|
23 |
+
|
24 |
+
General description of the whole video:
|
25 |
+
"A king goes to see a witch to ask if or how he can win an upcoming and challenging battle"
|
26 |
+
|
27 |
+
number of shots to extend: 3
|
28 |
+
|
29 |
+
\`\`\`yaml
|
30 |
+
- comment: "A messenger comes to the royal court, with an urgent message."
|
31 |
+
image: "Establishing shot of ROYAL MESSENGER dressed in medieval horse rider and light scout attire, entering the royal court, kneeling in from of KING ARTHUS, a majestic king, dressed in golden armor and a purple cape."
|
32 |
+
voice: "Sire, enemy troups will be here by sunrise. What thou you order?"
|
33 |
+
\`\`\
|
34 |
+
|
35 |
+
## YAML-only output
|
36 |
+
|
37 |
+
\`\`\`yaml
|
38 |
+
- comment: "King Arthus seeks the witch's guidance to win his imminent battle."
|
39 |
+
image: "Establishing shot of KING ARTHUS, nervous, wet brown hair. dressed in golden armor and a purple cape. His face reveals a mix of concern and determination. He's standing in the bright sunshine, inside a castle's courtyard, under cloudy skies. Behind him, a group of soldiers can be seen marching towards the castle gates."
|
40 |
+
voice: "Dark sorceress of the shadows, I come to seek your counsel. It is time for you to serve your Lord. Tell me the augur, tell me what you foreknow. Tell me how I will cleave my ennemies to the bone, and ravage them in battle to come up victorious."
|
41 |
+
- comment: "The witch gives her counsel but warns of an unknown cost."
|
42 |
+
image: "close-up shot of THE WITCH, smiling cunningly, raising a finger while speaking. Background bokeh, dim lightning, menacing, mysterious."
|
43 |
+
voice: "Your Majesty, this will be a bloody battle, but I espy a way to victory for you. If my advice you follow, victory I foresee, although at a great cost it will be."
|
44 |
+
- comment: "The words of the witch are sinking in, but King Arthus tries to appear strong"
|
45 |
+
image: "close-up shot on KING ARTHUS, looking concerned, somber, false confidence"
|
46 |
+
voice: "Witch with the wicked tongue, what must be done will be done. I will do everything for my people's sake. Speak now, make know the path to glory."
|
47 |
+
\`\`\
|
48 |
+
`
|
src/app/api/v1/edit/storyboards/processShot.ts
CHANGED
@@ -6,7 +6,8 @@ import {
|
|
6 |
filterSegments,
|
7 |
ClapSegmentFilteringMode,
|
8 |
ClapSegmentCategory,
|
9 |
-
ClapOutputType
|
|
|
10 |
} from "@aitube/clap"
|
11 |
import { ClapCompletionMode } from "@aitube/client"
|
12 |
import { getVideoPrompt } from "@aitube/engine"
|
@@ -97,10 +98,10 @@ export async function processShot({
|
|
97 |
turbo: !!identityImage,
|
98 |
})
|
99 |
shotStoryboardSegment.assetSourceType = getClapAssetSourceType(shotStoryboardSegment.assetUrl)
|
100 |
-
shotStoryboardSegment.status =
|
101 |
} catch (err) {
|
102 |
console.log(`[api/v1/edit/storyboards] processShot: failed to generate an image: ${err}`)
|
103 |
-
shotStoryboardSegment.status =
|
104 |
throw err
|
105 |
}
|
106 |
|
|
|
6 |
filterSegments,
|
7 |
ClapSegmentFilteringMode,
|
8 |
ClapSegmentCategory,
|
9 |
+
ClapOutputType,
|
10 |
+
ClapSegmentStatus
|
11 |
} from "@aitube/clap"
|
12 |
import { ClapCompletionMode } from "@aitube/client"
|
13 |
import { getVideoPrompt } from "@aitube/engine"
|
|
|
98 |
turbo: !!identityImage,
|
99 |
})
|
100 |
shotStoryboardSegment.assetSourceType = getClapAssetSourceType(shotStoryboardSegment.assetUrl)
|
101 |
+
shotStoryboardSegment.status = ClapSegmentStatus.COMPLETED
|
102 |
} catch (err) {
|
103 |
console.log(`[api/v1/edit/storyboards] processShot: failed to generate an image: ${err}`)
|
104 |
+
shotStoryboardSegment.status = ClapSegmentStatus.TO_GENERATE
|
105 |
throw err
|
106 |
}
|
107 |
|
src/app/api/v1/edit/videos/processShot.ts
CHANGED
@@ -8,6 +8,7 @@ import {
|
|
8 |
ClapSegmentFilteringMode,
|
9 |
ClapOutputType,
|
10 |
ClapSegmentCategory,
|
|
|
11 |
parseMediaOrientation
|
12 |
} from "@aitube/clap"
|
13 |
import { ClapCompletionMode } from "@aitube/client"
|
@@ -137,10 +138,10 @@ export async function processShot({
|
|
137 |
debug,
|
138 |
})
|
139 |
shotVideoSegment.assetSourceType = getClapAssetSourceType(shotVideoSegment.assetUrl)
|
140 |
-
shotVideoSegment.status =
|
141 |
} catch (err) {
|
142 |
console.log(`[api/edit/videos] processShot: failed to generate a video file: ${err}`)
|
143 |
-
shotVideoSegment.status =
|
144 |
throw err
|
145 |
}
|
146 |
|
@@ -171,7 +172,7 @@ export async function processShot({
|
|
171 |
category: ClapSegmentCategory.STORYBOARD,
|
172 |
prompt: shotVideoSegment.prompt,
|
173 |
outputType: ClapOutputType.IMAGE,
|
174 |
-
status:
|
175 |
})
|
176 |
|
177 |
if (shotStoryboardSegment) {
|
@@ -195,10 +196,10 @@ export async function processShot({
|
|
195 |
if (!shotStoryboardSegment.assetUrl) { throw new Error(`failed to extract the first frame`) }
|
196 |
console.warn(`[api/edit/videos] processShot: successfully fixed the missing storyboard`)
|
197 |
|
198 |
-
shotStoryboardSegment.status =
|
199 |
} catch (err) {
|
200 |
console.warn(`[api/edit/videos] processShot: couldn't generate the missing storyboard (probably an error with the ffmpeg not being found)`)
|
201 |
-
shotStoryboardSegment.status =
|
202 |
}
|
203 |
|
204 |
|
|
|
8 |
ClapSegmentFilteringMode,
|
9 |
ClapOutputType,
|
10 |
ClapSegmentCategory,
|
11 |
+
ClapSegmentStatus,
|
12 |
parseMediaOrientation
|
13 |
} from "@aitube/clap"
|
14 |
import { ClapCompletionMode } from "@aitube/client"
|
|
|
138 |
debug,
|
139 |
})
|
140 |
shotVideoSegment.assetSourceType = getClapAssetSourceType(shotVideoSegment.assetUrl)
|
141 |
+
shotVideoSegment.status = ClapSegmentStatus.COMPLETED
|
142 |
} catch (err) {
|
143 |
console.log(`[api/edit/videos] processShot: failed to generate a video file: ${err}`)
|
144 |
+
shotVideoSegment.status = ClapSegmentStatus.TO_GENERATE
|
145 |
throw err
|
146 |
}
|
147 |
|
|
|
172 |
category: ClapSegmentCategory.STORYBOARD,
|
173 |
prompt: shotVideoSegment.prompt,
|
174 |
outputType: ClapOutputType.IMAGE,
|
175 |
+
status: ClapSegmentStatus.TO_GENERATE,
|
176 |
})
|
177 |
|
178 |
if (shotStoryboardSegment) {
|
|
|
196 |
if (!shotStoryboardSegment.assetUrl) { throw new Error(`failed to extract the first frame`) }
|
197 |
console.warn(`[api/edit/videos] processShot: successfully fixed the missing storyboard`)
|
198 |
|
199 |
+
shotStoryboardSegment.status = ClapSegmentStatus.COMPLETED
|
200 |
} catch (err) {
|
201 |
console.warn(`[api/edit/videos] processShot: couldn't generate the missing storyboard (probably an error with the ffmpeg not being found)`)
|
202 |
+
shotStoryboardSegment.status = ClapSegmentStatus.TO_GENERATE
|
203 |
}
|
204 |
|
205 |
|
src/lib/utils/getInitialRenderedScene.ts
CHANGED
@@ -1,8 +1,10 @@
|
|
|
|
|
|
1 |
import { RenderedScene } from "@/types/general"
|
2 |
|
3 |
export const getInitialRenderedScene = (): RenderedScene => ({
|
4 |
renderId: "",
|
5 |
-
status:
|
6 |
assetUrl: "",
|
7 |
alt: "",
|
8 |
error: "",
|
|
|
1 |
+
import { ClapSegmentStatus } from "@aitube/clap"
|
2 |
+
|
3 |
import { RenderedScene } from "@/types/general"
|
4 |
|
5 |
export const getInitialRenderedScene = (): RenderedScene => ({
|
6 |
renderId: "",
|
7 |
+
status: ClapSegmentStatus.TO_GENERATE,
|
8 |
assetUrl: "",
|
9 |
alt: "",
|
10 |
error: "",
|