Skip to main content

Video generation

Assistive’s video generation systems are machine learning models trained to generate coherent videos from text or prompts.

Videos API

To generate videos in your own applications, you’ll send a request to the Assistive Videos API containing your prompt (a string of text or an image URL) and your API key.

Here’s what this would look like using a Javascript fetch request:

fetch('https://api.assistive.chat/v1/videos/text-to-video', {
method: 'POST',
headers: {
"Authorization": "Bearer " + ASSISTIVE_API_KEY,
"Content-Type": "application/json"
},
body: JSON.stringify({
prompt: "Brown grizzly bear eating salmon in river"
})
}).then((response) => response.json()).then((res) => {
console.log("Generation ID: " + res.generation_id)
})

Due to the standard generation time being 3-4 minutes, you’ll initially receive back a generation ID from the API. You should implement a polling mechanism to check for the video generation’s completion.

Here’s what this could look like using Javascript:

setInterval(() => {
fetch('https://api.assistive.chat/v1/generations/' + generation_id, {
method: 'GET',
headers: {
"Authorization": "Bearer " + ASSISTIVE_API_KEY,
},

})
.then(response => response.json())
.then(data => {
if (data.generation.status == "complete") {
console.log(data.generation.output.video_url);
}
})
.catch((error) => {
console.error('Error:', error);
})
}, 10000)

An example successful generation looks like the following:

{
"success": true,
"generation": {
"org_id": "[ORGANIZATION ID]",
"created_at": "[CREATION DATE]",
"type": "[TYPE]",
"params": {

},
"status": "[STATUS <in_progress|complete>]",
"output": {
"video_url": "[VIDEO URL]"
}
}
}

FAQ

How do I set the duration of the video?

By default, videos generated by Assistive’s systems are four seconds long. The duration parameter allows you to provide an integer from 1 to 4, which controls the length of the generated video.

How should I set the motion_strength parameter?

By default, the motion_strength parameter is set to 2. Higher motion strengths will generate videos with more motion, however they may be more unstable and subject to distortions and artifacts.

Do you store the data that is passed into the API?

Your generations are stored for access. However, we do not use your inputs and outputs to train or improve models.

Are API inputs and outputs moderated?

All generations using Assistive platforms must comply with our Usage Policy. The Videos API does not have the same moderation systems in place as Assistive Video, however violations of the Usage Policy identified by our monitoring systems may result in your API key being disabled.