Scene Creator Endpoint
Overview
The Scene Creator endpoint enables traveling between images through latent spaces based on text prompts.
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
Parameter | Description | Values |
---|---|---|
key | Your API key used for request authorization. | key |
scene | This 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 |
height | The height of the video. | The default is 640 pixels. The maximum is 640 pixels. |
width | The width of the video. | The default is 640 pixels. The maximum is 640 pixels. |
temp | Indicates whether to use a temporary file for the processed video. | The default is true. (TRUE or FALSE) |
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
- JS
- PHP
- NODE
- PYTHON
- JAVA
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));
<?php
$payload = [
"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
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://modelslab.com/api/v6/video/scene_creator',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://modelslab.com/api/v6/video/scene_creator',
'headers': {
'Content-Type': 'application/json'
},
body: 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
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
import json
url = "https://modelslab.com/api/v6/video/scene_creator"
payload = json.dumps({
"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
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"key\":\"WoAq8FLf5NeyacgJhNDUi3V3tIzpzNytCP7VcyeONG1LJmgWwk7ggoYgi2PE\",\n \"scene\": [\n {\n \"prompt\": \"Man walking on the garden\",\n \"negative_prompt\": \"low quality, bad image, cropped, out of frame\",\n \"duration\": 3\n },\n {\n \"prompt\": \"Man walking on the moon\",\n \"negative_prompt\": \"low quality, bad image, cropped, out of frame\",\n \"duration\": 3\n },\n {\n \"prompt\": \"Man walking on the mars\",\n \"negative_prompt\": \"low quality, bad image, cropped, out of frame\",\n \"duration\": 3\n },\n {\n \"prompt\": \"Man walking on the moon\",\n \"negative_prompt\": \"low quality, bad image, cropped, out of frame\",\n \"duration\": 3\n },\n {\n \"prompt\": \"Man walking on the fire\",\n \"negative_prompt\": \"low quality, bad image, cropped, out of frame\",\n \"duration\": 3\n }\n ],\n \"height\": 640,\n \"width\": 640,\n \"temp\": false\n}");
Request request = new Request.Builder()
.url("https://modelslab.com/api/v6/video/scene_creator")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "{{token}}")
.build();
Response response = client.newCall(request).execute();
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
},
}