Enterprise: 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/v1/enterprise/video/scene_creator' \
Make a POST
request to https://modelslab.com/api/v1/enterprise/video/scene_creator endpoint and pass the required parameters in the request body.
Body Attributes
Parameter | Description | Values |
---|---|---|
key | Your unique API key used for authorization. | string |
prompt | The input text, separated by commas. | string |
prompt_durations | The duration for each prompt. The number of durations should match the number of prompts. | Up to 3-4 seconds per prompt |
animations | The animation between each image. The number of animations should match the number of prompts. Options include: 'right', 'left', 'up', 'down', 'spin_clockwise', 'spin_counterclockwise', 'zoomin', 'zoomout', 'rotate_right', 'rotate_left', 'rotate_up', 'rotate_down', 'around_right', 'around_left', 'zoomin_sinus_x', 'zoomout_sinus_y', 'right_sinus_y', 'left_sinus_y', 'flipping_phi', 'live'. | 'right', 'left', 'up', 'down', 'spin_clockwise', 'spin_counterclockwise', 'zoomin', 'zoomout', 'rotate_right', 'rotate_left', 'rotate_up', 'rotate_down', 'around_right', 'around_left', 'zoomin_sinus_x', 'zoomout_sinus_y', 'right_sinus_y', 'left_sinus_y', 'flipping_phi', 'live' |
negative_prompt | Text specifying what should be excluded from the video. | string |
height | The height of the video. The default is 640 pixels. Maximum is 640 pixels. | integer |
width | The width of the video. The default is 640 pixels. Maximum is 640 pixels. | integer |
output_type | The output formart of the video. | The default is gif. the options are "mp4" and "gif". |
temp | Indicates whether to use a temporary file for the processed video. The default is true. | "true" / "false" |
Example
Body
Body
{
"key":"",
"prompt":"a painting of a tiger with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud | a painting of a jaguar with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud | a painting of a deadly bear with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud",
"prompt_durations":"1 | 1| 1",
"animations":"around_right | live | around_left",
"negative_prompt":"low quality, bad image, cropped, out of frame",
"height":640,
"width":640,
"output_type":"mp4",
"temp":true
}
Request
- JS
- PHP
- NODE
- PYTHON
- JAVA
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"key":"",
"prompt":"a painting of a tiger with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud | a painting of a jaguar with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud | a painting of a deadly bear with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud",
"prompt_durations":"1 | 1| 1",
"animations":"around_right | live | around_left",
"negative_prompt":"low quality, bad image, cropped, out of frame",
"height":640,
"width":640,
"output_type":"mp4",
"temp":true
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://modelslab.com/api/v1/enterprise/video/scene_creator", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
<?php
$payload = [
"key" => "",
"prompt" => "a painting of a tiger with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud | a painting of a jaguar with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud | a painting of a deadly bear with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud",
"prompt_durations" => "1 | 1 | 1",
"animations" => "around_right | live | around_left",
"negative_prompt" => "low quality, bad image, cropped, out of frame",
"height" => 640,
"width" => 640,
"output_type" => "mp4",
"temp" => true
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://modelslab.com/api/v1/enterprise/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/v1/enterprise/video/scene_creator',
'headers': {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"key":"",
"prompt":"a painting of a tiger with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud | a painting of a jaguar with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud | a painting of a deadly bear with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud",
"prompt_durations":"1 | 1| 1",
"animations":"around_right | live | around_left",
"negative_prompt":"low quality, bad image, cropped, out of frame",
"height":640,
"width":640,
"output_type":"mp4",
"temp":true
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
import json
url = "https://modelslab.com/api/v1/enterprise/video/scene_creator"
payload = json.dumps({
"key":"",
"prompt":"a painting of a tiger with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud | a painting of a jaguar with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud | a painting of a deadly bear with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud",
"prompt_durations":"1 | 1| 1",
"animations":"around_right | live | around_left",
"negative_prompt":"low quality, bad image, cropped, out of frame",
"height":640,
"width":640,
"output_type":"mp4",
"temp":true
})
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\":\"\",\n \"prompt\":\"a painting of a tiger with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud | a painting of a jaguar with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud | a painting of a deadly bear with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud\",\n \"prompt_durations\":\"1 | 1 | 1\",\n \"animations\":\"around_right | live | around_left\",\n \"negative_prompt\":\"low quality, bad image, cropped, out of frame\",\n \"height\":640,\n \"width\":640,\n \"output_type\":'mp4',\n \"temp\":\"true\"\n}");
Request request = new Request.Builder()
.url("https://modelslab.com/api/v1/enterprise/video/scene_creator")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.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": {
"file_prefix": "3d8b1b30-4e8c-41a1-935d-cac4be054ce6",
"height": 640,
"negative_prompt": "low quality, bad image, cropped, out of frame",
"prompt": "a painting of a tiger with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud | a painting of a jaguar with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud | a painting of a deadly bear with clouds in the background, a detailed painting, by Dan Mumford, unsplash, psychedelic art, a painting of a cat, iridescent smoke, casey weldon, fractal cloud",
"prompt_durations": "1 | 1 | 1",
"temp": "yes",
"width": 640
}
}