Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
0d06ec6
1
Parent(s):
198274c
update
Browse files
src/production/renderVideo.mts
CHANGED
@@ -11,7 +11,7 @@ export async function renderVideo(
|
|
11 |
response: RenderedScene
|
12 |
): Promise<RenderedScene> {
|
13 |
|
14 |
-
|
15 |
|
16 |
return response
|
17 |
}
|
|
|
11 |
response: RenderedScene
|
12 |
): Promise<RenderedScene> {
|
13 |
|
14 |
+
await generateVideoWithAnimateDiffLightning(request, response)
|
15 |
|
16 |
return response
|
17 |
}
|
src/providers/video-generation/generateVideoWithAnimateDiffLightning.mts
CHANGED
@@ -14,7 +14,7 @@ export const generateVideoWithAnimateDiffLightning = async (
|
|
14 |
|
15 |
const debug = false
|
16 |
|
17 |
-
const actualFunction = async () => {
|
18 |
|
19 |
const prompt = request.prompt || ""
|
20 |
if (!prompt) {
|
@@ -37,7 +37,7 @@ export const generateVideoWithAnimateDiffLightning = async (
|
|
37 |
const width = getValidNumber(request.width, 256, 1024, 512)
|
38 |
const height = getValidNumber(request.height, 256, 1024, 256)
|
39 |
|
40 |
-
const nbFrames = getValidNumber(request.nbFrames, 10, 60,
|
41 |
const nbFPS = getValidNumber(request.nbFPS, 10, 60, 10)
|
42 |
|
43 |
// by default AnimateDiff generates about 2 seconds of video at 10 fps
|
@@ -104,8 +104,10 @@ export const generateVideoWithAnimateDiffLightning = async (
|
|
104 |
throw new Error(`invalid response (no content)`)
|
105 |
}
|
106 |
|
|
|
|
|
107 |
// this API already emits a data-uri with a content type
|
108 |
-
return
|
109 |
} catch (err) {
|
110 |
if (debug) {
|
111 |
console.error(`failed to call the AnimateDiff Lightning API:`)
|
|
|
14 |
|
15 |
const debug = false
|
16 |
|
17 |
+
const actualFunction = async (): Promise<RenderedScene> => {
|
18 |
|
19 |
const prompt = request.prompt || ""
|
20 |
if (!prompt) {
|
|
|
37 |
const width = getValidNumber(request.width, 256, 1024, 512)
|
38 |
const height = getValidNumber(request.height, 256, 1024, 256)
|
39 |
|
40 |
+
const nbFrames = getValidNumber(request.nbFrames, 10, 60, 10)
|
41 |
const nbFPS = getValidNumber(request.nbFPS, 10, 60, 10)
|
42 |
|
43 |
// by default AnimateDiff generates about 2 seconds of video at 10 fps
|
|
|
104 |
throw new Error(`invalid response (no content)`)
|
105 |
}
|
106 |
|
107 |
+
response.assetUrl = base64Content
|
108 |
+
|
109 |
// this API already emits a data-uri with a content type
|
110 |
+
return response // addBase64HeaderToMp4(base64Content)
|
111 |
} catch (err) {
|
112 |
if (debug) {
|
113 |
console.error(`failed to call the AnimateDiff Lightning API:`)
|