Skip to main content

Scene Creator Endpoint

Overview​

The Scene Creator endpoint enables traveling between images through latent spaces based on text prompts.

Open in Playground 🚀

Request​

--request POST 'https://modelslab.com/api/v6/video/scene_creator' \

Make a POST request to https://modelslab.com/api/v6/video/scene_creator endpoint and pass the required parameters in the request body.

Body Attributes​

ParameterDescriptionValues
keyYour API key used for request authorization.Key
sceneThis accept an array of objects. Each object contains a prompt, negative_prompt and duration. The duration is the time in seconds that the prompt will be displayed for.array
heightThe height of the video.The default is 640 pixels. The maximum is 640 pixels.
widthThe width of the video.The default is 640 pixels. The maximum is 640 pixels.
tempIndicates whether to use a temporary file for the processed video.The default is true. (TRUE or FALSE)
Open in Playground 🚀

Example​

Body​

Body
{
"key":"",
"scene": [
{
"prompt": "Man walking on the garden",
"negative_prompt": "low quality, bad image, cropped, out of frame",
"duration": 3
},
{
"prompt": "Man walking on the moon",
"negative_prompt": "low quality, bad image, cropped, out of frame",
"duration": 3
},
{
"prompt": "Man walking on the mars",
"negative_prompt": "low quality, bad image, cropped, out of frame",
"duration": 3
},
{
"prompt": "Man walking on the moon",
"negative_prompt": "low quality, bad image, cropped, out of frame",
"duration": 3
},
{
"prompt": "Man walking on the fire",
"negative_prompt": "low quality, bad image, cropped, out of frame",
"duration": 3
}
],
"height": 640,
"width": 640,
"temp": false
}

Request​

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
"key":"",
"scene": [
{
"prompt": "Man walking on the garden",
"negative_prompt": "low quality, bad image, cropped, out of frame",
"duration": 3
},
{
"prompt": "Man walking on the moon",
"negative_prompt": "low quality, bad image, cropped, out of frame",
"duration": 3
},
{
"prompt": "Man walking on the mars",
"negative_prompt": "low quality, bad image, cropped, out of frame",
"duration": 3
},
{
"prompt": "Man walking on the moon",
"negative_prompt": "low quality, bad image, cropped, out of frame",
"duration": 3
},
{
"prompt": "Man walking on the fire",
"negative_prompt": "low quality, bad image, cropped, out of frame",
"duration": 3
}
],
"height": 640,
"width": 640,
"temp": false
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://modelslab.com/api/v6/video/scene_creator", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Response​

Example Response

{
"status": "success",
"generationTime": 10.56,
"id": 148,
"output": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/3d8b1b30-4e8c-41a1-935d-cac4be054ce6.mp4"
],
"proxy_links": [
"https://cdn2.stablediffusionapi.com/generations/3d8b1b30-4e8c-41a1-935d-cac4be054ce6.mp4"
],
"meta": {
"base64": "no",
"file_prefix": "4a75717a-93e8-41ff-a5d1-a47662fc43cd",
"fps": 8,
"guidance_scale": 6,
"height": 640,
"num_frames": 24,
"num_inference_steps": 20,
"output_type": "mp4",
"scenes": [
{
"duration": 3,
"negative_prompt": "low quality, bad image, cropped, out of frame",
"prompt": "Man walking on the garden"
},
{
"duration": 3,
"negative_prompt": "low quality, bad image, cropped, out of frame",
"prompt": "Man walking on the moon"
},
{
"duration": 3,
"negative_prompt": "low quality, bad image, cropped, out of frame",
"prompt": "Man walking on the mars"
},
{
"duration": 3,
"negative_prompt": "low quality, bad image, cropped, out of frame",
"prompt": "Man walking on the moon"
},
{
"duration": 3,
"negative_prompt": "low quality, bad image, cropped, out of frame",
"prompt": "Man walking on the fire"
}
],
"seed": 1622270155,
"temp": "no",
"watermark": "no",
"width": 640
},
}