Skip to main content

Scene Maker Endpoint

Overview

The Scene Maker endpoint enables traveling between images through latent spaces based on text images provided and prompt.

Generation Example

Request

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

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

Body Attributes

ParameterDescriptionValues
keyYour unique API key used for authorization.string
scenesArray of scene configurations with image url (img_url) and start frame index (start_frame_index). The start_frame_index should never be greater than num_framesArray
img_urlA valid image url for video transition herestring
start_frame_indexThe index of the first frame in the input sequence to begin generating the video from. The value must be within the valid range of available frames. A value of 0 indicates starting from the very first frame.string
promptText prompt used for image/video generation.string
negative_promptText prompt to avoid during generation.string
heightOutput frame height in pixels.integer, Default: 704
widthOutput frame width in pixels.integer , Default: 1280
num_framesTotal number of frames in the output video.integer, Default: 120
seedSeed for deterministic resultsstring
num_inference_stepsNumber of inference steps for generation.Default: 50
guidance_scaleScale for classifier-free guidanceDefault 5.0
stg_scalespatio temporal guidance scale.Default: 1.0
stg_rescalespatio temporal guidance factor.Default: 0.7
frame_rateFrame rate of the output video.integer Default: 25
tempIndicates whether to use a temporary file for the processed video. The default is false.true / false

Example

Body

Body
{
"key":"",
"prompt": "a women underwater swims out just to transform into old lady",
"negative_prompt": "worst quality, inconsistent motion, blurry, jittery, distorted",
"scenes": [
{
"img_url": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/6P3f4I7fhwmtPfW127x7nqY5SYOkDu-metaMTExMS5qcGc=-.jpg",
"start_frame_index": 0
},
{
"img_url": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/VHVDlpz1mSBcFQgiNrOhe5fG3BWrVn-metaMTExLmpwZw==-.jpg",
"start_frame_index": 119
}
],
"num_frames": 120,
"seed": 123456,
"height": 704,
"width": 1280,
"num_inference_steps": 40,
"guidance_scale": 5,
"stg_scale": 1,
"stg_rescale": 0.7,
"frame_rate": 25,
"base64": false
}

Request

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

var raw = JSON.stringify({
"key":"",
"prompt": "a women underwater swims out just to transform into old lady",
"negative_prompt": "worst quality, inconsistent motion, blurry, jittery, distorted",
"scenes": [
{
"img_url": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/6P3f4I7fhwmtPfW127x7nqY5SYOkDu-metaMTExMS5qcGc=-.jpgg",
"start_frame_index": 0
},
{
"img_url": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/VHVDlpz1mSBcFQgiNrOhe5fG3BWrVn-metaMTExLmpwZw==-.jpg",
"start_frame_index": 119
}
],
"num_frames": 120,
"seed": 123456,
"height": 704,
"width": 1280,
"num_inference_steps": 40,
"guidance_scale": 5,
"stg_scale": 1,
"stg_rescale": 0.7,
"frame_rate": 25,
"base64": false
});

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

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

Response

{
"status": "success",
"generationTime": 10.56,
"id": 148,
"output": [
"https://modelslab-bom.s3.amazonaws.com/generations/fba0ba98-f1a3-4905-95e6-7980b8e3190c.mp4"
],
"proxy_links": [
"https://cdn2.stablediffusionapi.com/generations/fba0ba98-f1a3-4905-95e6-7980b8e3190c.mp4"
],
"meta": {
"prompt": "a women underwater swims out just to transform into old lady",
"seed": 123456,
"num_inference_steps": 40,
"guidance_scale": 5,
"stg_scale": 1,
"stg_rescale": 0.7,
"height": 704,
"width": 1280,
"num_frames": 120,
"frame_rate": 25,
"negative_prompt": "worst quality, inconsistent motion, blurry, jittery, distorted",
"base64": "no",
"temp": "no",
"scenes": [
{
"img_url": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/6P3f4I7fhwmtPfW127x7nqY5SYOkDu-metaMTExMS5qcGc=-.jpggpg",
"start_frame_index": 0
},
{
"img_url": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/VHVDlpz1mSBcFQgiNrOhe5fG3BWrVn-metaMTExLmpwZw==-.jpg",
"start_frame_index": 119
}
],
"watermark": "no",
"scale_down": 6,
"opacity": 0.7,
"padding_right": 10,
"padding_down": 10,
"webhook": null,
"id": 1678,
"track_id": null,
"file_prefix": "fba0ba98-f1a3-4905-95e6-7980b8e3190c",
"outdir": "out"
}
}