Spaces:
Sleeping
Sleeping
Commit
•
6d66622
1
Parent(s):
c1ce586
bump
Browse files- package-lock.json +14 -14
- package.json +3 -3
- src/app/api/utils/dataUriToBlob.ts +3 -0
- src/app/api/v1/edit/entities/generateEntityPrompts.ts +9 -2
- src/app/api/v1/edit/storyboards/route.ts +2 -0
- src/app/api/v1/export/route.ts +2 -0
- src/app/state/useCurrentUser.ts +6 -4
- src/components/interface/latent-engine/core/useLatentEngine.ts +2 -0
package-lock.json
CHANGED
@@ -8,9 +8,9 @@
|
|
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.6.7",
|
16 |
"@jcoreio/async-throttle": "^1.6.0",
|
@@ -118,9 +118,9 @@
|
|
118 |
}
|
119 |
},
|
120 |
"node_modules/@aitube/clap": {
|
121 |
-
"version": "0.0.
|
122 |
-
"resolved": "https://registry.npmjs.org/@aitube/clap/-/clap-0.0.
|
123 |
-
"integrity": "sha512-
|
124 |
"dependencies": {
|
125 |
"pure-uuid": "^1.8.1",
|
126 |
"yaml": "^2.4.1"
|
@@ -130,22 +130,22 @@
|
|
130 |
}
|
131 |
},
|
132 |
"node_modules/@aitube/client": {
|
133 |
-
"version": "0.0.
|
134 |
-
"resolved": "https://registry.npmjs.org/@aitube/client/-/client-0.0.
|
135 |
-
"integrity": "sha512-
|
136 |
"dependencies": {
|
137 |
"query-string": "^9.0.0"
|
138 |
},
|
139 |
"peerDependencies": {
|
140 |
-
"@aitube/clap": "0.0.
|
141 |
}
|
142 |
},
|
143 |
"node_modules/@aitube/engine": {
|
144 |
-
"version": "0.0.
|
145 |
-
"resolved": "https://registry.npmjs.org/@aitube/engine/-/engine-0.0.
|
146 |
-
"integrity": "sha512-
|
147 |
"peerDependencies": {
|
148 |
-
"@aitube/clap": "0.0.
|
149 |
}
|
150 |
},
|
151 |
"node_modules/@alloc/quick-lru": {
|
|
|
8 |
"name": "@aitube/website",
|
9 |
"version": "0.0.0",
|
10 |
"dependencies": {
|
11 |
+
"@aitube/clap": "0.0.16",
|
12 |
+
"@aitube/client": "0.0.21",
|
13 |
+
"@aitube/engine": "0.0.6",
|
14 |
"@huggingface/hub": "0.12.3-oauth",
|
15 |
"@huggingface/inference": "^2.6.7",
|
16 |
"@jcoreio/async-throttle": "^1.6.0",
|
|
|
118 |
}
|
119 |
},
|
120 |
"node_modules/@aitube/clap": {
|
121 |
+
"version": "0.0.16",
|
122 |
+
"resolved": "https://registry.npmjs.org/@aitube/clap/-/clap-0.0.16.tgz",
|
123 |
+
"integrity": "sha512-EcBu4gbc8Kx58rkMmLjh0uyCWVR4cSgWqALlQ50C1GbHRg/r81gDET6faWeos14ZGrtg4B0CJv8WUTIDE54pjg==",
|
124 |
"dependencies": {
|
125 |
"pure-uuid": "^1.8.1",
|
126 |
"yaml": "^2.4.1"
|
|
|
130 |
}
|
131 |
},
|
132 |
"node_modules/@aitube/client": {
|
133 |
+
"version": "0.0.21",
|
134 |
+
"resolved": "https://registry.npmjs.org/@aitube/client/-/client-0.0.21.tgz",
|
135 |
+
"integrity": "sha512-Nw/K4j024ffYiw1WipLDU7M29L+4cM4cQwrjvSxWW8zF4/1NLrPSKTlF6Gak5Qd/ZFWq/D8GbMiGQ5W3lQb8mA==",
|
136 |
"dependencies": {
|
137 |
"query-string": "^9.0.0"
|
138 |
},
|
139 |
"peerDependencies": {
|
140 |
+
"@aitube/clap": "0.0.16"
|
141 |
}
|
142 |
},
|
143 |
"node_modules/@aitube/engine": {
|
144 |
+
"version": "0.0.6",
|
145 |
+
"resolved": "https://registry.npmjs.org/@aitube/engine/-/engine-0.0.6.tgz",
|
146 |
+
"integrity": "sha512-Li+yE6MCIvD32Kyn43I7GHyQkmxtc/1/lrt3xPKMuFrWuc2FP9JR1ZYRlKqodmWqrSmhWCRBOt3Z6f62QpEvIQ==",
|
147 |
"peerDependencies": {
|
148 |
+
"@aitube/clap": "0.0.16"
|
149 |
}
|
150 |
},
|
151 |
"node_modules/@alloc/quick-lru": {
|
package.json
CHANGED
@@ -10,9 +10,9 @@
|
|
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.6.7",
|
18 |
"@jcoreio/async-throttle": "^1.6.0",
|
|
|
10 |
"lint": "next lint"
|
11 |
},
|
12 |
"dependencies": {
|
13 |
+
"@aitube/clap": "0.0.16",
|
14 |
+
"@aitube/client": "0.0.21",
|
15 |
+
"@aitube/engine": "0.0.6",
|
16 |
"@huggingface/hub": "0.12.3-oauth",
|
17 |
"@huggingface/inference": "^2.6.7",
|
18 |
"@jcoreio/async-throttle": "^1.6.0",
|
src/app/api/utils/dataUriToBlob.ts
CHANGED
@@ -10,11 +10,14 @@ export function dataUriToBlob(dataURI = "", defaultContentType = ""): Blob {
|
|
10 |
for (let i = 0; i < base64.length; i++) {
|
11 |
typedArray[i] = base64.charCodeAt(i);
|
12 |
}
|
|
|
|
|
13 |
console.log("dataUriToBlob DEBUG:", {
|
14 |
type,
|
15 |
base64: base64.slice(0, 80),
|
16 |
arrayBuffer
|
17 |
})
|
|
|
18 |
|
19 |
return new Blob([arrayBuffer], { type });
|
20 |
}
|
|
|
10 |
for (let i = 0; i < base64.length; i++) {
|
11 |
typedArray[i] = base64.charCodeAt(i);
|
12 |
}
|
13 |
+
|
14 |
+
/*
|
15 |
console.log("dataUriToBlob DEBUG:", {
|
16 |
type,
|
17 |
base64: base64.slice(0, 80),
|
18 |
arrayBuffer
|
19 |
})
|
20 |
+
*/
|
21 |
|
22 |
return new Blob([arrayBuffer], { type });
|
23 |
}
|
src/app/api/v1/edit/entities/generateEntityPrompts.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
"use server"
|
2 |
|
3 |
import YAML from "yaml"
|
4 |
-
import { generateSeed } from "@aitube/clap"
|
5 |
import { ClapEntityPrompt } from "@aitube/client"
|
6 |
|
7 |
import { sleep } from "@/lib/utils/sleep"
|
@@ -100,7 +100,14 @@ Now please generate the output entities:`
|
|
100 |
}
|
101 |
|
102 |
if (maybeEntities.length) {
|
103 |
-
results = await Promise.all(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
name,
|
105 |
category,
|
106 |
image,
|
|
|
1 |
"use server"
|
2 |
|
3 |
import YAML from "yaml"
|
4 |
+
import { ClapSegmentCategory, generateSeed } from "@aitube/clap"
|
5 |
import { ClapEntityPrompt } from "@aitube/client"
|
6 |
|
7 |
import { sleep } from "@/lib/utils/sleep"
|
|
|
100 |
}
|
101 |
|
102 |
if (maybeEntities.length) {
|
103 |
+
results = await Promise.all(
|
104 |
+
maybeEntities
|
105 |
+
|
106 |
+
// the LLM generates unrelated catrgories unfortunately,
|
107 |
+
// that we still turn into image.. so we fix that by filtering
|
108 |
+
.filter(({ category }) => category !== ClapSegmentCategory.CHARACTER)
|
109 |
+
|
110 |
+
.map(async ({
|
111 |
name,
|
112 |
category,
|
113 |
image,
|
src/app/api/v1/edit/storyboards/route.ts
CHANGED
@@ -55,6 +55,8 @@ export async function POST(req: NextRequest) {
|
|
55 |
})
|
56 |
))
|
57 |
|
|
|
|
|
58 |
// console.log(`[api/v1/edit/storyboards] returning the clap augmented with storyboards`)
|
59 |
|
60 |
return new NextResponse(await serializeClap(newerClap), {
|
|
|
55 |
})
|
56 |
))
|
57 |
|
58 |
+
// console.log("DEBUG:", newerClap.segments)
|
59 |
+
|
60 |
// console.log(`[api/v1/edit/storyboards] returning the clap augmented with storyboards`)
|
61 |
|
62 |
return new NextResponse(await serializeClap(newerClap), {
|
src/app/api/v1/export/route.ts
CHANGED
@@ -20,6 +20,8 @@ export async function POST(req: NextRequest, res: NextResponse) {
|
|
20 |
// or rather, the non-turbo mode could be the one where we upscale
|
21 |
|
22 |
// let's call our micro-service, which is currently open bar.
|
|
|
|
|
23 |
const result = await fetch(
|
24 |
`https://jbilcke-hf-ai-tube-clap-exporter.hf.space?f=${format}`,
|
25 |
{ method: "POST", body: await req.blob() }
|
|
|
20 |
// or rather, the non-turbo mode could be the one where we upscale
|
21 |
|
22 |
// let's call our micro-service, which is currently open bar.
|
23 |
+
console.log("[api/v1/export] sending blob to ai-tube-clap-exporter.hf.space")
|
24 |
+
|
25 |
const result = await fetch(
|
26 |
`https://jbilcke-hf-ai-tube-clap-exporter.hf.space?f=${format}`,
|
27 |
{ method: "POST", body: await req.blob() }
|
src/app/state/useCurrentUser.ts
CHANGED
@@ -148,22 +148,24 @@ export function useCurrentUser({
|
|
148 |
console.log("no pending oauth flow to finish")
|
149 |
}
|
150 |
|
151 |
-
console.log("useCurrentUser()")
|
152 |
const searchParams = new URLSearchParams(window.location.search);
|
153 |
|
|
|
154 |
console.log("debug:", {
|
155 |
"window.location.search:": window.location.search,
|
156 |
searchParams,
|
157 |
})
|
|
|
158 |
|
159 |
const fn = async () => {
|
160 |
try {
|
161 |
const res = await oauthHandleRedirectIfPresent()
|
162 |
-
console.log("result of oauthHandleRedirectIfPresent:", res)
|
163 |
if (res) {
|
164 |
-
console.log("oauthHandleRedirectIfPresent returned something!", res)
|
165 |
setOauthResult(res)
|
166 |
-
console.log("debug:", { accessToken: res.accessToken })
|
167 |
setHuggingfaceTemporaryApiKey(res.accessToken)
|
168 |
startTransition(async () => {
|
169 |
console.log("TODO julian do something, eg. reload the page, remove the things in the URL etc")
|
|
|
148 |
console.log("no pending oauth flow to finish")
|
149 |
}
|
150 |
|
151 |
+
// console.log("useCurrentUser()")
|
152 |
const searchParams = new URLSearchParams(window.location.search);
|
153 |
|
154 |
+
/*
|
155 |
console.log("debug:", {
|
156 |
"window.location.search:": window.location.search,
|
157 |
searchParams,
|
158 |
})
|
159 |
+
*/
|
160 |
|
161 |
const fn = async () => {
|
162 |
try {
|
163 |
const res = await oauthHandleRedirectIfPresent()
|
164 |
+
// console.log("result of oauthHandleRedirectIfPresent:", res)
|
165 |
if (res) {
|
166 |
+
// console.log("oauthHandleRedirectIfPresent returned something!", res)
|
167 |
setOauthResult(res)
|
168 |
+
// console.log("debug:", { accessToken: res.accessToken })
|
169 |
setHuggingfaceTemporaryApiKey(res.accessToken)
|
170 |
startTransition(async () => {
|
171 |
console.log("TODO julian do something, eg. reload the page, remove the things in the URL etc")
|
src/components/interface/latent-engine/core/useLatentEngine.ts
CHANGED
@@ -381,6 +381,8 @@ export const useLatentEngine = create<LatentEngineStore>((set, get) => ({
|
|
381 |
// TODO julian: this is an approximation
|
382 |
// to grab the max number of segments
|
383 |
const maxBufferDurationInMs = positionInMs + (videoDurationInMs * 4)
|
|
|
|
|
384 |
console.log(`DEBUG: `, {
|
385 |
positionInMs,
|
386 |
videoModelDurationInSec,
|
|
|
381 |
// TODO julian: this is an approximation
|
382 |
// to grab the max number of segments
|
383 |
const maxBufferDurationInMs = positionInMs + (videoDurationInMs * 4)
|
384 |
+
|
385 |
+
|
386 |
console.log(`DEBUG: `, {
|
387 |
positionInMs,
|
388 |
videoModelDurationInSec,
|