Spaces:
Running
Running
File size: 1,163 Bytes
3d4392e 0d218b1 3d4392e 0d218b1 3d4392e 0d218b1 3d4392e 6215321 3d4392e 0d218b1 3d4392e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
"use server"
import { LatentScenes } from "./types"
import { addLatentScenesToClap } from "./addLatentScenesToClap"
import { getLatentScenes } from "./getLatentScenes"
import { ClapProject, getEmptyClap, newClap, serializeClap } from "@aitube/clap"
/**
* Generate a Clap file from scratch using a prompt
*/
export async function generateClap({
prompt = "",
debug = false
}: {
prompt?: string
debug?: boolean
} = {
prompt: "",
debug: false,
}): Promise<Blob> {
const empty: Blob = await getEmptyClap()
if (!prompt?.length) {
return empty
}
let clap: ClapProject = newClap({
meta: {
title: "Latent content", // TODO "
description: "",
licence: "non commercial",
orientation: "landscape",
width: 1024,
height: 576,
defaultVideoModel: "SDXL",
extraPositivePrompt: [],
screenplay: "",
isLoop: true,
isInteractive: true,
}
})
const scenes: LatentScenes = await getLatentScenes({
prompt,
debug,
})
clap = await addLatentScenesToClap({
clap,
scenes,
debug,
})
const archive: Blob = await serializeClap(clap)
return archive
} |