Generate videos from textual descriptions for applications like content creation, entertainment, and education
Basic usage
Send a text prompt to generate a video output (usually in mp4):
Copy
import Bytez from "bytez.js";const sdk = new Bytez("BYTEZ_KEY");const model = sdk.model("ali-vilab/text-to-video-ms-1.7b");const { error, output } = await model.run("A cat playing with a rose");console.log({ error, output });
Stream
Instead receiving an video file in JSON format, you opt to stream back the data URL:
Copy
import Bytez from "bytez.js";const sdk = new Bytez("BYTEZ_KEY");const model = sdk.model("ali-vilab/text-to-video-ms-1.7b");const text = "A cat playing with a rose"const stream = trueconst readStream = await model.run(text, stream);// the stream returns the base64 data urlfor await (const chunk of readStream) { console.log(chunk)}