Spaces:
Paused
Paused
Julian Bilcke
commited on
Commit
·
29598d1
1
Parent(s):
dd77f63
up
Browse files- src/index.mts +9 -4
src/index.mts
CHANGED
|
@@ -8,6 +8,8 @@ import { generateVideo } from './services/generateVideo.mts'
|
|
| 8 |
import { downloadVideo } from './services/downloadVideo.mts'
|
| 9 |
import { upscaleVideo } from './services/upscaleVideo.mts'
|
| 10 |
import { generateSeed } from './services/generateSeed.mts'
|
|
|
|
|
|
|
| 11 |
import { MakeShot } from './types.mts'
|
| 12 |
|
| 13 |
const app = express()
|
|
@@ -42,13 +44,14 @@ app.post('/shot', async (req, res) => {
|
|
| 42 |
const audioPrompt = `${query.audioPrompt || ''}`
|
| 43 |
|
| 44 |
// optional seed
|
| 45 |
-
const
|
|
|
|
| 46 |
const maybeSeed = Number(seedStr)
|
| 47 |
-
const seed = isNaN(maybeSeed) || ! isFinite(maybeSeed) ?
|
| 48 |
|
| 49 |
|
| 50 |
// should we upscale or not?
|
| 51 |
-
const upscale = `${query.upscale || '
|
| 52 |
|
| 53 |
// duration of the prompt, in seconds
|
| 54 |
const defaultDuration = 3
|
|
@@ -104,8 +107,10 @@ app.post('/shot', async (req, res) => {
|
|
| 104 |
|
| 105 |
// TODO call AudioLDM
|
| 106 |
if (audioPrompt) {
|
| 107 |
-
// const
|
| 108 |
console.log('calling audio prompt')
|
|
|
|
|
|
|
| 109 |
}
|
| 110 |
|
| 111 |
console.log('returning result to user..')
|
|
|
|
| 8 |
import { downloadVideo } from './services/downloadVideo.mts'
|
| 9 |
import { upscaleVideo } from './services/upscaleVideo.mts'
|
| 10 |
import { generateSeed } from './services/generateSeed.mts'
|
| 11 |
+
import { addAudioToVideo } from './services/addAudioToVideo.mts'
|
| 12 |
+
|
| 13 |
import { MakeShot } from './types.mts'
|
| 14 |
|
| 15 |
const app = express()
|
|
|
|
| 44 |
const audioPrompt = `${query.audioPrompt || ''}`
|
| 45 |
|
| 46 |
// optional seed
|
| 47 |
+
const defaultSeed = generateSeed()
|
| 48 |
+
const seedStr = Number(`${query.seed || defaultSeed}`)
|
| 49 |
const maybeSeed = Number(seedStr)
|
| 50 |
+
const seed = isNaN(maybeSeed) || ! isFinite(maybeSeed) ? defaultSeed : maybeSeed
|
| 51 |
|
| 52 |
|
| 53 |
// should we upscale or not?
|
| 54 |
+
const upscale = `${query.upscale || 'true'}` === 'true'
|
| 55 |
|
| 56 |
// duration of the prompt, in seconds
|
| 57 |
const defaultDuration = 3
|
|
|
|
| 107 |
|
| 108 |
// TODO call AudioLDM
|
| 109 |
if (audioPrompt) {
|
| 110 |
+
// const audioFileName = await callAudioLDM(audioPrompt)
|
| 111 |
console.log('calling audio prompt')
|
| 112 |
+
|
| 113 |
+
// await addAudioToVideo(videoFileName, audioFileName)
|
| 114 |
}
|
| 115 |
|
| 116 |
console.log('returning result to user..')
|