Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
•
dd3ca23
1
Parent(s):
1b6a26c
study of potential ComfyUI integration
Browse files- package-lock.json +145 -35
- package.json +6 -5
- src/components/interface/settings/constants.tsx +13 -0
- src/lib/core/getDefaultSettings.ts +13 -0
- src/lib/{utils → core}/getFinalVideo.ts +0 -0
- src/lib/core/index.ts +2 -0
- src/lib/{utils/removeFinalVideo.ts → core/removeFinalVideos.ts} +0 -0
- src/server/comfy/formatStoryboardWorkflow.ts +23 -0
- src/server/comfy/huggingface.ts +15 -0
- src/server/comfy/index.ts +21 -0
- src/server/comfy/replicate.ts +26 -0
- src/types.ts +84 -0
package-lock.json
CHANGED
@@ -1,15 +1,16 @@
|
|
1 |
{
|
2 |
"name": "@jbilcke-hf/clap-viewer",
|
3 |
-
"version": "0.0.
|
4 |
"lockfileVersion": 3,
|
5 |
"requires": true,
|
6 |
"packages": {
|
7 |
"": {
|
8 |
"name": "@jbilcke-hf/clap-viewer",
|
9 |
-
"version": "0.0.
|
10 |
"dependencies": {
|
11 |
-
"@aitube/clap": "0.0.
|
12 |
-
"@aitube/
|
|
|
13 |
"@huggingface/hub": "^0.15.0",
|
14 |
"@radix-ui/react-accordion": "^1.1.2",
|
15 |
"@radix-ui/react-avatar": "^1.0.4",
|
@@ -45,7 +46,7 @@
|
|
45 |
"class-variance-authority": "^0.7.0",
|
46 |
"clsx": "^2.1.0",
|
47 |
"cmdk": "^0.2.1",
|
48 |
-
"eslint": "8.
|
49 |
"eslint-config-next": "14.1.0",
|
50 |
"lucide-react": "^0.334.0",
|
51 |
"next": "^14.2.3",
|
@@ -60,6 +61,7 @@
|
|
60 |
"react-hook-consent": "^3.5.3",
|
61 |
"react-icons": "^5.2.1",
|
62 |
"react-reflex": "^4.2.6",
|
|
|
63 |
"sharp": "^0.33.4",
|
64 |
"sonner": "^1.4.41",
|
65 |
"tailwind-merge": "^2.3.0",
|
@@ -73,30 +75,37 @@
|
|
73 |
"uuid": "^9.0.1",
|
74 |
"yaml": "^2.4.2",
|
75 |
"zustand": "^4.5.2"
|
76 |
-
}
|
77 |
-
"devDependencies": {}
|
78 |
},
|
79 |
"node_modules/@aitube/clap": {
|
80 |
-
"version": "0.0.
|
81 |
-
"resolved": "https://registry.npmjs.org/@aitube/clap/-/clap-0.0.
|
82 |
-
"integrity": "sha512
|
83 |
"dependencies": {
|
84 |
"pure-uuid": "^1.8.1"
|
85 |
},
|
86 |
"peerDependencies": {
|
87 |
-
"yaml": "^2.4.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
}
|
89 |
},
|
90 |
"node_modules/@aitube/timeline": {
|
91 |
-
"version": "0.0.
|
92 |
-
"resolved": "https://registry.npmjs.org/@aitube/timeline/-/timeline-0.0.
|
93 |
-
"integrity": "sha512-
|
94 |
"dependencies": {
|
95 |
"date-fns": "^3.6.0",
|
96 |
"react-virtualized-auto-sizer": "^1.0.24"
|
97 |
},
|
98 |
"peerDependencies": {
|
99 |
-
"@aitube/clap": "0.0.
|
100 |
"@radix-ui/react-slider": "^1.1.2",
|
101 |
"@react-spring/three": "^9.7.3",
|
102 |
"@react-spring/types": "^9.7.3",
|
@@ -631,9 +640,9 @@
|
|
631 |
}
|
632 |
},
|
633 |
"node_modules/@eslint/js": {
|
634 |
-
"version": "8.
|
635 |
-
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.
|
636 |
-
"integrity": "sha512-
|
637 |
"engines": {
|
638 |
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
639 |
}
|
@@ -3092,6 +3101,18 @@
|
|
3092 |
"react": ">= 16.8.0"
|
3093 |
}
|
3094 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3095 |
"node_modules/acorn": {
|
3096 |
"version": "8.11.3",
|
3097 |
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
|
@@ -3325,15 +3346,18 @@
|
|
3325 |
}
|
3326 |
},
|
3327 |
"node_modules/array.prototype.tosorted": {
|
3328 |
-
"version": "1.1.
|
3329 |
-
"resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.
|
3330 |
-
"integrity": "sha512
|
3331 |
"dependencies": {
|
3332 |
-
"call-bind": "^1.0.
|
3333 |
"define-properties": "^1.2.1",
|
3334 |
-
"es-abstract": "^1.
|
3335 |
-
"es-errors": "^1.
|
3336 |
"es-shim-unscopables": "^1.0.2"
|
|
|
|
|
|
|
3337 |
}
|
3338 |
},
|
3339 |
"node_modules/arraybuffer.prototype.slice": {
|
@@ -3627,9 +3651,9 @@
|
|
3627 |
}
|
3628 |
},
|
3629 |
"node_modules/caniuse-lite": {
|
3630 |
-
"version": "1.0.
|
3631 |
-
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.
|
3632 |
-
"integrity": "sha512-
|
3633 |
"funding": [
|
3634 |
{
|
3635 |
"type": "opencollective",
|
@@ -4614,15 +4638,15 @@
|
|
4614 |
}
|
4615 |
},
|
4616 |
"node_modules/eslint": {
|
4617 |
-
"version": "8.
|
4618 |
-
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.
|
4619 |
-
"integrity": "sha512-
|
4620 |
"dependencies": {
|
4621 |
"@eslint-community/eslint-utils": "^4.2.0",
|
4622 |
"@eslint-community/regexpp": "^4.6.1",
|
4623 |
"@eslint/eslintrc": "^2.1.4",
|
4624 |
-
"@eslint/js": "8.
|
4625 |
-
"@humanwhocodes/config-array": "^0.11.
|
4626 |
"@humanwhocodes/module-importer": "^1.0.1",
|
4627 |
"@nodelib/fs.walk": "^1.2.8",
|
4628 |
"@ungap/structured-clone": "^1.2.0",
|
@@ -5049,6 +5073,24 @@
|
|
5049 |
"node": ">=0.10.0"
|
5050 |
}
|
5051 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5052 |
"node_modules/extend": {
|
5053 |
"version": "3.0.2",
|
5054 |
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
@@ -6353,9 +6395,9 @@
|
|
6353 |
}
|
6354 |
},
|
6355 |
"node_modules/meshline": {
|
6356 |
-
"version": "3.
|
6357 |
-
"resolved": "https://registry.npmjs.org/meshline/-/meshline-3.
|
6358 |
-
"integrity": "sha512-/
|
6359 |
"peerDependencies": {
|
6360 |
"three": ">=0.137"
|
6361 |
}
|
@@ -7126,6 +7168,15 @@
|
|
7126 |
"url": "https://github.com/prettier/prettier?sponsor=1"
|
7127 |
}
|
7128 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7129 |
"node_modules/promise-worker-transferable": {
|
7130 |
"version": "1.0.4",
|
7131 |
"resolved": "https://registry.npmjs.org/promise-worker-transferable/-/promise-worker-transferable-1.0.4.tgz",
|
@@ -7464,6 +7515,22 @@
|
|
7464 |
"pify": "^2.3.0"
|
7465 |
}
|
7466 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7467 |
"node_modules/readdirp": {
|
7468 |
"version": "3.6.0",
|
7469 |
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
|
@@ -7517,6 +7584,20 @@
|
|
7517 |
"url": "https://github.com/sponsors/ljharb"
|
7518 |
}
|
7519 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7520 |
"node_modules/require-from-string": {
|
7521 |
"version": "2.0.2",
|
7522 |
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
|
@@ -7665,6 +7746,26 @@
|
|
7665 |
"url": "https://github.com/sponsors/ljharb"
|
7666 |
}
|
7667 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7668 |
"node_modules/safe-regex-test": {
|
7669 |
"version": "1.0.3",
|
7670 |
"resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz",
|
@@ -7914,6 +8015,15 @@
|
|
7914 |
"node": ">=10.0.0"
|
7915 |
}
|
7916 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7917 |
"node_modules/string-width": {
|
7918 |
"version": "5.1.2",
|
7919 |
"resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
|
|
|
1 |
{
|
2 |
"name": "@jbilcke-hf/clap-viewer",
|
3 |
+
"version": "0.0.2",
|
4 |
"lockfileVersion": 3,
|
5 |
"requires": true,
|
6 |
"packages": {
|
7 |
"": {
|
8 |
"name": "@jbilcke-hf/clap-viewer",
|
9 |
+
"version": "0.0.2",
|
10 |
"dependencies": {
|
11 |
+
"@aitube/clap": "0.0.24",
|
12 |
+
"@aitube/engine": "0.0.15",
|
13 |
+
"@aitube/timeline": "0.0.7",
|
14 |
"@huggingface/hub": "^0.15.0",
|
15 |
"@radix-ui/react-accordion": "^1.1.2",
|
16 |
"@radix-ui/react-avatar": "^1.0.4",
|
|
|
46 |
"class-variance-authority": "^0.7.0",
|
47 |
"clsx": "^2.1.0",
|
48 |
"cmdk": "^0.2.1",
|
49 |
+
"eslint": "8.57.0",
|
50 |
"eslint-config-next": "14.1.0",
|
51 |
"lucide-react": "^0.334.0",
|
52 |
"next": "^14.2.3",
|
|
|
61 |
"react-hook-consent": "^3.5.3",
|
62 |
"react-icons": "^5.2.1",
|
63 |
"react-reflex": "^4.2.6",
|
64 |
+
"replicate": "^0.30.1",
|
65 |
"sharp": "^0.33.4",
|
66 |
"sonner": "^1.4.41",
|
67 |
"tailwind-merge": "^2.3.0",
|
|
|
75 |
"uuid": "^9.0.1",
|
76 |
"yaml": "^2.4.2",
|
77 |
"zustand": "^4.5.2"
|
78 |
+
}
|
|
|
79 |
},
|
80 |
"node_modules/@aitube/clap": {
|
81 |
+
"version": "0.0.24",
|
82 |
+
"resolved": "https://registry.npmjs.org/@aitube/clap/-/clap-0.0.24.tgz",
|
83 |
+
"integrity": "sha512-iMmxyPmVh1LWNUlWKK2rRnCSZ/CLmBeb1ADNr5pj0dFI51NNezipYXjZv9dBOb5y3FKBkL+jbEcy7kQFgKHhpw==",
|
84 |
"dependencies": {
|
85 |
"pure-uuid": "^1.8.1"
|
86 |
},
|
87 |
"peerDependencies": {
|
88 |
+
"yaml": "^2.4.3"
|
89 |
+
}
|
90 |
+
},
|
91 |
+
"node_modules/@aitube/engine": {
|
92 |
+
"version": "0.0.15",
|
93 |
+
"resolved": "https://registry.npmjs.org/@aitube/engine/-/engine-0.0.15.tgz",
|
94 |
+
"integrity": "sha512-SxlTGOLHNPh93PY/hCXuNgCUWV7Uky9Q4mBKS4uA7+gReeYBT//x/sAWqIvV8MEj2dkx1Br3iTse1/rcVay49w==",
|
95 |
+
"peerDependencies": {
|
96 |
+
"@aitube/clap": "0.0.24"
|
97 |
}
|
98 |
},
|
99 |
"node_modules/@aitube/timeline": {
|
100 |
+
"version": "0.0.7",
|
101 |
+
"resolved": "https://registry.npmjs.org/@aitube/timeline/-/timeline-0.0.7.tgz",
|
102 |
+
"integrity": "sha512-eQbp2fcrazuW6prKfGAfcEVNvHgO+ZVgh5aHJXSQfCDty8dLw54MlvbsZw9RXntxMjGu3OzqgC6PCSAZldebFQ==",
|
103 |
"dependencies": {
|
104 |
"date-fns": "^3.6.0",
|
105 |
"react-virtualized-auto-sizer": "^1.0.24"
|
106 |
},
|
107 |
"peerDependencies": {
|
108 |
+
"@aitube/clap": "0.0.24",
|
109 |
"@radix-ui/react-slider": "^1.1.2",
|
110 |
"@react-spring/three": "^9.7.3",
|
111 |
"@react-spring/types": "^9.7.3",
|
|
|
640 |
}
|
641 |
},
|
642 |
"node_modules/@eslint/js": {
|
643 |
+
"version": "8.57.0",
|
644 |
+
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz",
|
645 |
+
"integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
|
646 |
"engines": {
|
647 |
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
648 |
}
|
|
|
3101 |
"react": ">= 16.8.0"
|
3102 |
}
|
3103 |
},
|
3104 |
+
"node_modules/abort-controller": {
|
3105 |
+
"version": "3.0.0",
|
3106 |
+
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
3107 |
+
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
|
3108 |
+
"optional": true,
|
3109 |
+
"dependencies": {
|
3110 |
+
"event-target-shim": "^5.0.0"
|
3111 |
+
},
|
3112 |
+
"engines": {
|
3113 |
+
"node": ">=6.5"
|
3114 |
+
}
|
3115 |
+
},
|
3116 |
"node_modules/acorn": {
|
3117 |
"version": "8.11.3",
|
3118 |
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
|
|
|
3346 |
}
|
3347 |
},
|
3348 |
"node_modules/array.prototype.tosorted": {
|
3349 |
+
"version": "1.1.4",
|
3350 |
+
"resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz",
|
3351 |
+
"integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==",
|
3352 |
"dependencies": {
|
3353 |
+
"call-bind": "^1.0.7",
|
3354 |
"define-properties": "^1.2.1",
|
3355 |
+
"es-abstract": "^1.23.3",
|
3356 |
+
"es-errors": "^1.3.0",
|
3357 |
"es-shim-unscopables": "^1.0.2"
|
3358 |
+
},
|
3359 |
+
"engines": {
|
3360 |
+
"node": ">= 0.4"
|
3361 |
}
|
3362 |
},
|
3363 |
"node_modules/arraybuffer.prototype.slice": {
|
|
|
3651 |
}
|
3652 |
},
|
3653 |
"node_modules/caniuse-lite": {
|
3654 |
+
"version": "1.0.30001627",
|
3655 |
+
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001627.tgz",
|
3656 |
+
"integrity": "sha512-4zgNiB8nTyV/tHhwZrFs88ryjls/lHiqFhrxCW4qSTeuRByBVnPYpDInchOIySWknznucaf31Z4KYqjfbrecVw==",
|
3657 |
"funding": [
|
3658 |
{
|
3659 |
"type": "opencollective",
|
|
|
4638 |
}
|
4639 |
},
|
4640 |
"node_modules/eslint": {
|
4641 |
+
"version": "8.57.0",
|
4642 |
+
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
|
4643 |
+
"integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
|
4644 |
"dependencies": {
|
4645 |
"@eslint-community/eslint-utils": "^4.2.0",
|
4646 |
"@eslint-community/regexpp": "^4.6.1",
|
4647 |
"@eslint/eslintrc": "^2.1.4",
|
4648 |
+
"@eslint/js": "8.57.0",
|
4649 |
+
"@humanwhocodes/config-array": "^0.11.14",
|
4650 |
"@humanwhocodes/module-importer": "^1.0.1",
|
4651 |
"@nodelib/fs.walk": "^1.2.8",
|
4652 |
"@ungap/structured-clone": "^1.2.0",
|
|
|
5073 |
"node": ">=0.10.0"
|
5074 |
}
|
5075 |
},
|
5076 |
+
"node_modules/event-target-shim": {
|
5077 |
+
"version": "5.0.1",
|
5078 |
+
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
|
5079 |
+
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
|
5080 |
+
"optional": true,
|
5081 |
+
"engines": {
|
5082 |
+
"node": ">=6"
|
5083 |
+
}
|
5084 |
+
},
|
5085 |
+
"node_modules/events": {
|
5086 |
+
"version": "3.3.0",
|
5087 |
+
"resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
|
5088 |
+
"integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",
|
5089 |
+
"optional": true,
|
5090 |
+
"engines": {
|
5091 |
+
"node": ">=0.8.x"
|
5092 |
+
}
|
5093 |
+
},
|
5094 |
"node_modules/extend": {
|
5095 |
"version": "3.0.2",
|
5096 |
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
|
|
6395 |
}
|
6396 |
},
|
6397 |
"node_modules/meshline": {
|
6398 |
+
"version": "3.3.1",
|
6399 |
+
"resolved": "https://registry.npmjs.org/meshline/-/meshline-3.3.1.tgz",
|
6400 |
+
"integrity": "sha512-/TQj+JdZkeSUOl5Mk2J7eLcYTLiQm2IDzmlSvYm7ov15anEcDJ92GHqqazxTSreeNgfnYu24kiEvvv0WlbCdFQ==",
|
6401 |
"peerDependencies": {
|
6402 |
"three": ">=0.137"
|
6403 |
}
|
|
|
7168 |
"url": "https://github.com/prettier/prettier?sponsor=1"
|
7169 |
}
|
7170 |
},
|
7171 |
+
"node_modules/process": {
|
7172 |
+
"version": "0.11.10",
|
7173 |
+
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
|
7174 |
+
"integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==",
|
7175 |
+
"optional": true,
|
7176 |
+
"engines": {
|
7177 |
+
"node": ">= 0.6.0"
|
7178 |
+
}
|
7179 |
+
},
|
7180 |
"node_modules/promise-worker-transferable": {
|
7181 |
"version": "1.0.4",
|
7182 |
"resolved": "https://registry.npmjs.org/promise-worker-transferable/-/promise-worker-transferable-1.0.4.tgz",
|
|
|
7515 |
"pify": "^2.3.0"
|
7516 |
}
|
7517 |
},
|
7518 |
+
"node_modules/readable-stream": {
|
7519 |
+
"version": "4.5.2",
|
7520 |
+
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz",
|
7521 |
+
"integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==",
|
7522 |
+
"optional": true,
|
7523 |
+
"dependencies": {
|
7524 |
+
"abort-controller": "^3.0.0",
|
7525 |
+
"buffer": "^6.0.3",
|
7526 |
+
"events": "^3.3.0",
|
7527 |
+
"process": "^0.11.10",
|
7528 |
+
"string_decoder": "^1.3.0"
|
7529 |
+
},
|
7530 |
+
"engines": {
|
7531 |
+
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
7532 |
+
}
|
7533 |
+
},
|
7534 |
"node_modules/readdirp": {
|
7535 |
"version": "3.6.0",
|
7536 |
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
|
|
|
7584 |
"url": "https://github.com/sponsors/ljharb"
|
7585 |
}
|
7586 |
},
|
7587 |
+
"node_modules/replicate": {
|
7588 |
+
"version": "0.30.1",
|
7589 |
+
"resolved": "https://registry.npmjs.org/replicate/-/replicate-0.30.1.tgz",
|
7590 |
+
"integrity": "sha512-9JZPia6p7UCNfye2kddb2AHcTf3ngyckzq4y5FZkuhhF06AuuOHKN1q6NRSp9iAch7Htmlhm+kRGc+EQbzY8Kw==",
|
7591 |
+
"engines": {
|
7592 |
+
"git": ">=2.11.0",
|
7593 |
+
"node": ">=18.0.0",
|
7594 |
+
"npm": ">=7.19.0",
|
7595 |
+
"yarn": ">=1.7.0"
|
7596 |
+
},
|
7597 |
+
"optionalDependencies": {
|
7598 |
+
"readable-stream": ">=4.0.0"
|
7599 |
+
}
|
7600 |
+
},
|
7601 |
"node_modules/require-from-string": {
|
7602 |
"version": "2.0.2",
|
7603 |
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
|
|
|
7746 |
"url": "https://github.com/sponsors/ljharb"
|
7747 |
}
|
7748 |
},
|
7749 |
+
"node_modules/safe-buffer": {
|
7750 |
+
"version": "5.2.1",
|
7751 |
+
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
7752 |
+
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
|
7753 |
+
"funding": [
|
7754 |
+
{
|
7755 |
+
"type": "github",
|
7756 |
+
"url": "https://github.com/sponsors/feross"
|
7757 |
+
},
|
7758 |
+
{
|
7759 |
+
"type": "patreon",
|
7760 |
+
"url": "https://www.patreon.com/feross"
|
7761 |
+
},
|
7762 |
+
{
|
7763 |
+
"type": "consulting",
|
7764 |
+
"url": "https://feross.org/support"
|
7765 |
+
}
|
7766 |
+
],
|
7767 |
+
"optional": true
|
7768 |
+
},
|
7769 |
"node_modules/safe-regex-test": {
|
7770 |
"version": "1.0.3",
|
7771 |
"resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz",
|
|
|
8015 |
"node": ">=10.0.0"
|
8016 |
}
|
8017 |
},
|
8018 |
+
"node_modules/string_decoder": {
|
8019 |
+
"version": "1.3.0",
|
8020 |
+
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
8021 |
+
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
8022 |
+
"optional": true,
|
8023 |
+
"dependencies": {
|
8024 |
+
"safe-buffer": "~5.2.0"
|
8025 |
+
}
|
8026 |
+
},
|
8027 |
"node_modules/string-width": {
|
8028 |
"version": "5.1.2",
|
8029 |
"resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
|
package.json
CHANGED
@@ -10,8 +10,9 @@
|
|
10 |
"lint": "next lint"
|
11 |
},
|
12 |
"dependencies": {
|
13 |
-
"@aitube/clap": "0.0.
|
14 |
-
"@aitube/
|
|
|
15 |
"@huggingface/hub": "^0.15.0",
|
16 |
"@radix-ui/react-accordion": "^1.1.2",
|
17 |
"@radix-ui/react-avatar": "^1.0.4",
|
@@ -47,7 +48,7 @@
|
|
47 |
"class-variance-authority": "^0.7.0",
|
48 |
"clsx": "^2.1.0",
|
49 |
"cmdk": "^0.2.1",
|
50 |
-
"eslint": "8.
|
51 |
"eslint-config-next": "14.1.0",
|
52 |
"lucide-react": "^0.334.0",
|
53 |
"next": "^14.2.3",
|
@@ -62,6 +63,7 @@
|
|
62 |
"react-hook-consent": "^3.5.3",
|
63 |
"react-icons": "^5.2.1",
|
64 |
"react-reflex": "^4.2.6",
|
|
|
65 |
"sharp": "^0.33.4",
|
66 |
"sonner": "^1.4.41",
|
67 |
"tailwind-merge": "^2.3.0",
|
@@ -75,6 +77,5 @@
|
|
75 |
"uuid": "^9.0.1",
|
76 |
"yaml": "^2.4.2",
|
77 |
"zustand": "^4.5.2"
|
78 |
-
}
|
79 |
-
"devDependencies": {}
|
80 |
}
|
|
|
10 |
"lint": "next lint"
|
11 |
},
|
12 |
"dependencies": {
|
13 |
+
"@aitube/clap": "0.0.24",
|
14 |
+
"@aitube/engine": "0.0.15",
|
15 |
+
"@aitube/timeline": "0.0.7",
|
16 |
"@huggingface/hub": "^0.15.0",
|
17 |
"@radix-ui/react-accordion": "^1.1.2",
|
18 |
"@radix-ui/react-avatar": "^1.0.4",
|
|
|
48 |
"class-variance-authority": "^0.7.0",
|
49 |
"clsx": "^2.1.0",
|
50 |
"cmdk": "^0.2.1",
|
51 |
+
"eslint": "8.57.0",
|
52 |
"eslint-config-next": "14.1.0",
|
53 |
"lucide-react": "^0.334.0",
|
54 |
"next": "^14.2.3",
|
|
|
63 |
"react-hook-consent": "^3.5.3",
|
64 |
"react-icons": "^5.2.1",
|
65 |
"react-reflex": "^4.2.6",
|
66 |
+
"replicate": "^0.30.1",
|
67 |
"sharp": "^0.33.4",
|
68 |
"sonner": "^1.4.41",
|
69 |
"tailwind-merge": "^2.3.0",
|
|
|
77 |
"uuid": "^9.0.1",
|
78 |
"yaml": "^2.4.2",
|
79 |
"zustand": "^4.5.2"
|
80 |
+
}
|
|
|
81 |
}
|
src/components/interface/settings/constants.tsx
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Settings } from "@/types"
|
2 |
+
|
3 |
+
const version = `CLAP_CONFIG_V0_`
|
4 |
+
|
5 |
+
export const localStorageKeys: Record<keyof Settings, string> = {
|
6 |
+
comfyVendor: `${version}COMFY_VENDOR`,
|
7 |
+
comfyApiKey: `${version}COMFY_API_KEY`,
|
8 |
+
|
9 |
+
storyboardGenerationStrategy: `${version}STORYBOARD_GENERATION_STRATEGY`,
|
10 |
+
videoGenerationStrategy: `${version}VIDEO_GENERATION_STRATEEGY`,
|
11 |
+
|
12 |
+
maxNbAssetsToGenerateInParallel: `${version}MAX_NB_ASSETS_TO_GENERATE_IN_PARQLLEL`,
|
13 |
+
}
|
src/lib/core/getDefaultSettings.ts
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { AssetGenerationStrategy, ComfyVendor, Settings } from "@/types"
|
2 |
+
|
3 |
+
export function getDefaultSettings(): Settings {
|
4 |
+
return {
|
5 |
+
comfyVendor: ComfyVendor.CUSTOM,
|
6 |
+
comfyApiKey: "",
|
7 |
+
|
8 |
+
storyboardGenerationStrategy: AssetGenerationStrategy.ON_DEMAND,
|
9 |
+
videoGenerationStrategy: AssetGenerationStrategy.ON_DEMAND,
|
10 |
+
|
11 |
+
maxNbAssetsToGenerateInParallel: 1,
|
12 |
+
}
|
13 |
+
}
|
src/lib/{utils → core}/getFinalVideo.ts
RENAMED
File without changes
|
src/lib/core/index.ts
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
export { getFinalVideo } from "./getFinalVideo"
|
2 |
+
export { removeFinalVideos } from "./removeFinalVideos"
|
src/lib/{utils/removeFinalVideo.ts → core/removeFinalVideos.ts}
RENAMED
File without changes
|
src/server/comfy/formatStoryboardWorkflow.ts
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { getVideoPrompt } from "@aitube/engine"
|
2 |
+
|
3 |
+
import { ComfyNode, RenderRequest } from "@/types"
|
4 |
+
|
5 |
+
export function formatStoryboardWorkflow(request: RenderRequest) {
|
6 |
+
// parse the node array from the ComfyUI workflow
|
7 |
+
const nodes = Object.values(JSON.parse(request.comfyWorkflow)) as ComfyNode[]
|
8 |
+
|
9 |
+
const storyboardPrompt = getVideoPrompt(
|
10 |
+
request.segments,
|
11 |
+
request.entities
|
12 |
+
)
|
13 |
+
|
14 |
+
for (const node of nodes) {
|
15 |
+
if (typeof node.inputs.text === "string") {
|
16 |
+
if (node._meta.title.includes("Prompt")) {
|
17 |
+
node.inputs.text = storyboardPrompt
|
18 |
+
}
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
return JSON.stringify(nodes)
|
23 |
+
}
|
src/server/comfy/huggingface.ts
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use server"
|
2 |
+
|
3 |
+
|
4 |
+
export async function run({
|
5 |
+
apiKey,
|
6 |
+
workflow
|
7 |
+
}: {
|
8 |
+
apiKey: string
|
9 |
+
workflow: string
|
10 |
+
}): Promise<string> {
|
11 |
+
|
12 |
+
// TODO: call Hugging Face
|
13 |
+
|
14 |
+
throw new Error(`Hugging Face isn't supported yet`)
|
15 |
+
}
|
src/server/comfy/index.ts
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use server"
|
2 |
+
|
3 |
+
import { RenderRequest } from "@/types"
|
4 |
+
|
5 |
+
import { run as runWithReplicate } from "./replicate"
|
6 |
+
import { run as runWithHuggingFace } from "./huggingface"
|
7 |
+
import { formatStoryboardWorkflow } from "./formatStoryboardWorkflow"
|
8 |
+
|
9 |
+
export async function run(request: RenderRequest): Promise<string> {
|
10 |
+
|
11 |
+
const workflow = formatStoryboardWorkflow(request)
|
12 |
+
|
13 |
+
// TODO support Hugging Face as well
|
14 |
+
// const await runWithHuggingFace({
|
15 |
+
const result = await runWithReplicate({
|
16 |
+
apiKey: request.comfyApiKey,
|
17 |
+
workflow,
|
18 |
+
})
|
19 |
+
|
20 |
+
return result
|
21 |
+
}
|
src/server/comfy/replicate.ts
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use server"
|
2 |
+
|
3 |
+
import Replicate from 'replicate'
|
4 |
+
|
5 |
+
export async function run({
|
6 |
+
apiKey,
|
7 |
+
workflow
|
8 |
+
}: {
|
9 |
+
apiKey: string
|
10 |
+
workflow: string
|
11 |
+
}): Promise<string> {
|
12 |
+
|
13 |
+
const replicate = new Replicate({ auth: apiKey })
|
14 |
+
|
15 |
+
const cogId = "fofr/any-comfyui-workflow:74f12621dc9f9b7cdca50d03941b8ddb3a368d7f5a1bb16fb7e1b87f05d96bf5"
|
16 |
+
|
17 |
+
const output = await replicate.run(cogId, {
|
18 |
+
input: {
|
19 |
+
workflow_json: workflow
|
20 |
+
}
|
21 |
+
})
|
22 |
+
|
23 |
+
console.log(`response:`, output)
|
24 |
+
|
25 |
+
return ""
|
26 |
+
}
|
src/types.ts
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
export type TaskStatus =
|
2 |
| "idle"
|
3 |
| "generating"
|
@@ -21,3 +23,85 @@ export type GenerationStage =
|
|
21 |
| "videos"
|
22 |
| "final"
|
23 |
| "idle"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { ClapEntity, ClapSegment } from "@aitube/clap"
|
2 |
+
|
3 |
export type TaskStatus =
|
4 |
| "idle"
|
5 |
| "generating"
|
|
|
23 |
| "videos"
|
24 |
| "final"
|
25 |
| "idle"
|
26 |
+
|
27 |
+
export enum ComfyVendor {
|
28 |
+
CUSTOM = "CUSTOM",
|
29 |
+
HUGGINGFACE = "HUGGINGFACE",
|
30 |
+
REPLICATE = "REPLICATE",
|
31 |
+
}
|
32 |
+
|
33 |
+
export enum AssetGenerationStrategy {
|
34 |
+
|
35 |
+
// generate assets when the user asks for it explicitely
|
36 |
+
ON_DEMAND = "ON_DEMAND_",
|
37 |
+
|
38 |
+
// generate missing assets currently visible on screen, and that's all
|
39 |
+
ON_SCREEN_ONLY = "ON_SCREEN_ONLY",
|
40 |
+
|
41 |
+
// generate missing assets visible on screen first,
|
42 |
+
// then pre-generate surrouding assets (a bit before and after)
|
43 |
+
ON_SCREEN_THEN_SURROUNDING = "ON_SCREEN_THEN_SURROUNDING",
|
44 |
+
|
45 |
+
// generate missing assets visible on screen first,
|
46 |
+
// then pre-generate *ALL* the remaining project's assets
|
47 |
+
//
|
48 |
+
// this is hardcore! only GPU-rich people shoud use this one!
|
49 |
+
ON_SCREEN_THEN_ALL = "ON_SCREEN_THEN_ALL",
|
50 |
+
}
|
51 |
+
|
52 |
+
// TODO: rename the *Model fields to better indicate if this is a LLM or RENDER mdoel
|
53 |
+
export type Settings = {
|
54 |
+
comfyVendor: ComfyVendor
|
55 |
+
comfyApiKey: string
|
56 |
+
|
57 |
+
storyboardGenerationStrategy: AssetGenerationStrategy
|
58 |
+
videoGenerationStrategy: AssetGenerationStrategy
|
59 |
+
|
60 |
+
maxNbAssetsToGenerateInParallel: number
|
61 |
+
}
|
62 |
+
|
63 |
+
export type RenderRequest = {
|
64 |
+
comfyVendor: ComfyVendor
|
65 |
+
|
66 |
+
// secret vendor api key to use (provided by the user)
|
67 |
+
comfyApiKey: string
|
68 |
+
|
69 |
+
// URL to use for the vendor
|
70 |
+
// vendorUrl: string
|
71 |
+
|
72 |
+
// ComfyUI workflow to use
|
73 |
+
comfyWorkflow: string
|
74 |
+
|
75 |
+
// the slice to use for rendering
|
76 |
+
segments: ClapSegment[]
|
77 |
+
|
78 |
+
entities: Record<string, ClapEntity>
|
79 |
+
}
|
80 |
+
|
81 |
+
export type ComfyParameter =
|
82 |
+
| string
|
83 |
+
| number
|
84 |
+
| boolean
|
85 |
+
| Array< string | number | boolean>
|
86 |
+
|
87 |
+
export type ComfyNode = {
|
88 |
+
inputs: Record<string, ComfyParameter>
|
89 |
+
/*
|
90 |
+
inputs: {
|
91 |
+
"seed": number
|
92 |
+
"steps": number
|
93 |
+
"cfg": number
|
94 |
+
"sampler_name":string
|
95 |
+
"scheduler": string
|
96 |
+
"denoise": number
|
97 |
+
"model": any[]
|
98 |
+
"positive": any[]
|
99 |
+
"negative": any[]
|
100 |
+
"latent_image": any[]
|
101 |
+
}
|
102 |
+
*/
|
103 |
+
class_type: string
|
104 |
+
_meta: {
|
105 |
+
title: string
|
106 |
+
}
|
107 |
+
}
|