Story

APIs for generating story video from your idea or from your story and image. APIs from Story are alpha version. If you have any questions or suggestion, please contact us by sending an email to support@vimmerse.net.

Here is an example code and video URL from this example.

Example Code

import requests
import time

BASE_URL = 'https://api.vimmerse.net'
url = f"{BASE_URL}/story/idea-2-video"

headers = {
    'X-Api-Key': 'YOUR_API_KEY',
}

## Create a story
payload = {
    'idea': 'Make promotion video that cute animals play the musical instruments',
    'title': 'Example Story',
    'aspect_ratio': '9:16'
}

try:
    response = requests.request("POST", url, headers=headers, data=payload, timeout=60)
    print(response.text)

    response_data = response.json()

    story_data = response_data['data']
    story_id = story_data['id']
except:
    print("Failed to create story. Please submit again.")
    exit()

## Wait while story is finished
while story_data['status'] != 'success':
    time.sleep(30) ## Wait for 30 seconds
    
    ## Get story detail
    url = f"{BASE_URL}/story/{story_id}"
    
    try:
        response = requests.request("GET", url, headers=headers)
        print(response.text)

        response_data = response.json()

        story_data = response_data['data']
        
        if story_data['status'] == 'fail':
            print("Failed to generate video. Please submit again.")
            exit()
    except:
        print("Failed to get story. Please submit again.")
        exit()

time.sleep(10) ## wait for videos are composed internally.
video_url = story_data['video_url']

print("Story Video URL: " + video_url)

## You can download video from URL.

response = requests.get(video_url, stream=True)
output_path = './story_video.mp4'
try:
    with open(output_path, 'wb') as file:
        file.write(response.content)
    print(f"File downloaded as {output_path}")
except:
    print("Failed to download video.")

Story Webhook

By providing us a webhook endpoint you get notified when the request is done as opposed to polling it. You can set webhook URL by giving webhook_url params on Create and Update media.

You will get a response with the customer_id and batch_id and status:

{
    "customer_id": "YOUR_CUSTOMER_ID",
    "batch_id": "YOUR_STORY_ID",
    "status": "success"
}

Once you get request from webhook, you can use Get Story Detail API to retrieve story details.

Create Video from Idea

This API simply creates a story from idea. You can use 3 advanced steps to create your story video step by step.

Send a POST request with your idea.

Example Code

import requests

url = "https://api.vimmerse.net/story/idea-2-video"

headers = {
    'X-Api-Key': 'YOUR_API_KEY',
}
payload = {
    'idea': 'Make promotion video that cute animals play the musical instruments.',
    'title': 'Example Story',
    'aspect_ratio': '9:16',
    'scene_count': 3
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
SecurityAPIKeyHeader
Request
Request Body schema: application/x-www-form-urlencoded
idea
string (Idea)
Default: ""
scene_count
integer (Number of Scenes)
Default: 3

Number of scenes to be generated. If you don't put any value, scenes will be generated automatically.

option
string (Image Generation Option)
Default: "FluxKontextPro"

Image generation option to generate image from story. Available values are StableDiffusion3.5, Flux1.1Pro, Flux1.1ProUltra, FluxFinetuned, OpenAI-Image-1, FluxKontextMax and FluxKontextPro(Default).

generate_elements
boolean (Generate Elements)
Default: true

Generate element images for character consistency. It is supported only when option is one of FluxKontextPro, FluxKontextMax or OpenAI-Image-1

aspect_ratio
string (Aspect Ratio)
Default: "16:9"
seed
integer (Seed)

Seed is used to generate image from your story.

is_transition
string (Is Transition)
Default: "No"

If you set to Yes, you will get transition images between given images.

title
string (Title)
Default: ""
description
string (Description)
Default: ""
visibility_status
string (Visibility Status)
Default: "1"

Visibility status of the story. 0: Private, 1: Unlisted, 2: Public.

motion_type
string (Motion Type)
Default: "Auto"

Defines the type of motion. Available values are: Auto, LumaAI, LumaRay2, KlingAI, Kling2, MinimaxHailuo, Seedance, Hunyuan, RunwayML, Wan, Pixverse, Veo, VeoFast, TryOnVideo and Parallax.

duration
integer (Duration of each scene) [ 1 .. 10 ]
Default: 5
loop
integer (The number of repetitions of the same motion. This value is ignored if narrator is set.) [ 1 .. 6 ]
Default: 1
enhance_image
boolean (Enhance Image)
Default: true

Enhance image by applying 1X super-resolution in post-processing

narrator
string (Narrator)
Default: "Rachel"

Voice of the speech. Available voices are "Aria", "Roger", "Sarah", "Laura", "Charlie", "George", "Callum", "River", "Liam", "Charlotte", "Alice", "Matilda", "Will", "Jessica", "Eric", "Chris", "Brian", "Daniel", "Lily" and "Bill". Default is "Rachel".

background_music
boolean (Background Music)
Default: true

Flag to add background music.

sound_effects
string (Sound Effects)
Default: "No"

Defines if the generated video will include sound effects or not. Available values are: Yes and No(default).

webhook_url
string (Webhook URL)

a 'POST' request will be made to your webhook URL after story is generated.

Responses
200

Story Object

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/story/idea-2-video
Request samples
Response samples
application/json
{
  • "data": {
    }
}

[Advanced] Step1: Create Storyboard

This API creates a new Story and storyboard from idea.

Send a POST request with your idea and scene_count if you have in your mind.

Example Code

import requests

url = "https://api.vimmerse.net/story"

headers = {
    'X-Api-Key': 'YOUR_API_KEY',
}
payload = {
    'idea': 'Generate a Shonen style story that Bunny walk through forest and find outs honey is flowing and try to drink, and impressed.'
    'scene_count': 3,
    'title': 'Example Story',
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
SecurityAPIKeyHeader
Request
Request Body schema: application/x-www-form-urlencoded
idea
string (Idea)
Default: ""
scene_count
integer (Number of Scenes)
Default: 3

Number of scenes to be generated. If you don't put any value, scenes will be generated automatically.

Responses
200

New Story Object

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/story
Request samples
Response samples
application/json
{
  • "data": {
    }
}

[Advanced] Step1.5: Create Element Images(Optional)

This API crafts images of your characters, objects and environments and background music from your storyboard.

Send a POST request with/without storyboard to generate element images from your storyboard. If you already have images for your 'characters', 'objects' or 'environments', you can just add URL under same level of name and description field of each scene. if you already have background music, you can just add music_url under music object under storyboard.

Example Code

import requests

url = "https://api.vimmerse.net/story/{STORY_ID}/elements"

payload = {
    'aspect_ratio': '16:9',
    'option': 'FluxKontextPro'
    'seed': 4669,
}
headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
SecurityAPIKeyHeader
Request
Request Body schema: application/x-www-form-urlencoded
option
string (Image Generation Option)
Default: "FluxKontextPro"

Image generation option to generate image from story. Available values are StableDiffusion3.5, Flux1.1Pro, Flux1.1ProUltra, FluxKontextMax, FluxKontextPro(Default) and OpenAI-Image-1.

seed
integer (Seed)

Seed is used to generate image from your story.

aspect_ratio
string (Aspect ratio)
Default: "9:16"

Available values are '16:9', '4:3', '1:1', '3:4' and '9:16'

storyboard
string (Storyboard)

JSON dump string of Storyboard object that contains 'characters', 'environments', 'objects' and 'scenes'.

enhance_image
boolean (Enhance Image)
Default: false

Enhance image by applying 1X super-resolution in post-processing

background_music
boolean (Background Music)
Default: true

Flag to add background music.

Responses
200

Story with generated element images

400

Bad Request

402

Insufficient Credit

404

Not Found

422

Validation Error

post/story/{story_id}/elements
Request samples
Response samples
application/json
{
  • "data": {
    }
}

[Advanced] Step2: Create Scenes

This API crafts missing images and narrations of scenes in storyboard.

Send a POST request to generate images from storyboard.

Example Code

Generate scene images without updating storyboard.

import requests

url = "https://api.vimmerse.net/story/{STORY_ID}/scenes"

payload = {
    'aspect_ratio': '16:9',
    'option': 'FluxKontextPro'
    'seed': '4669',
}
headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Generate scene images with updating storyboard.

import requests

url = "https://api.vimmerse.net/story/{STORY_ID}/scenes"

payload = {
    'aspect_ratio': '16:9',
    'seed': '4669',
    'option': 'FluxKontextPro'
    'storyboard': json.dumps({...storyboard})
}
headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
SecurityAPIKeyHeader
Request
Request Body schema: application/x-www-form-urlencoded
option
string (Image Generation Option)
Default: "FluxKontextPro"

Image generation option to generate image from story. Available values are StableDiffusion3.5, Flux1.1Pro, Flux1.1ProUltra, FluxFinetuned, OpenAI-Image-1, FluxKontextPro and FluxKontextMax.

seed
integer (Seed)

Seed is used to generate image from your story.

aspect_ratio
string (Aspect ratio)
Default: "16:9"

Available values are '16:9', '4:3', '1:1', '3:4' and '9:16'

storyboard
string (Storyboard)

JSON dump string of Storyboard object that contains 'characters', 'environments', 'objects' and 'scenes'.

enhance_image
boolean (Enhance Image)
Default: true

Enhance image by applying 1X super-resolution in post-processing

generate_elements
boolean (Generate Elements)
Default: true

Generate element images for character consistency. It is supported only when option is one of FluxKontextPro, FluxKontextMax or OpenAI-Image-1

narrator
string (Narrator)
Default: "Rachel"

Voice of the speech. Available voices are "Aria", "Roger", "Sarah", "Laura", "Charlie", "George", "Callum", "River", "Liam", "Charlotte", "Alice", "Matilda", "Will", "Jessica", "Eric", "Chris", "Brian", "Daniel", "Lily" and "Bill". Default is "Rachel".

background_music
boolean (Background Music)
Default: true

Flag to add background music.

Responses
200

Story with generated scene images and narration

400

Bad Request

402

Insufficient Credit

404

Not Found

422

Validation Error

post/story/{story_id}/scenes
Request samples
Response samples
application/json
{}

[Advanced] Step3: Create Videos

This API requests to create video from storyboard and scenes

You can see medias generated from response and once all medias are finished, your story video will be available at URL of video_url.

Example Code

Create story video without updating scenes.

import requests

url = "https://api.vimmerse.net/story/{STORY_ID}/videos"

payload = {
    "title": "Example story from vimmerse",
    "motion_type": "KlingAI",
}

headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Create story video with updating storyboard and scenes.

import requests

url = "https://api.vimmerse.net/story/{STORY_ID}/videos"

payload = {
    "title": "Example story video from vimmerse",
    "storyboard": {...storyboard},
    "scenes": {...scenes}
}

headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
SecurityAPIKeyHeader
Request
Request Body schema: application/x-www-form-urlencoded
title
string (Title)
Default: ""
storyboard
string (Storyboard)

JSON dump string of Storyboard object that contains 'characters', 'environments', 'objects' and 'scenes'.

is_transition
string (Transition flag)
Default: "No"

If you set to Yes, you will get transition images between given images.

motion_type
string (Motion Type)
Default: "Auto"

Defines the type of motion. Available values are: Auto, LumaAI, LumaRay2, KlingAI, Kling2, MinimaxHailuo, Seedance, Hunyuan, RunwayML, Wan, Pixverse, Veo, VeoFast, TryOnVideo and Parallax.

duration
integer (Duration of video) [ 1 .. 10 ]
Default: 5
loop
integer (The number of repetitions of the same motion.) [ 1 .. 6 ]
Default: 1
sound_effects
string (Sound Effects)
Default: "No"

Defines if the generated video will include sound effects or not. Available values are: Yes and No(default).

webhook_url
string (Webhook URL)

a 'POST' request will be made to your webhook URL after story is generated.

Responses
200

Story Object

400

Bad Request

402

Insufficient Credit

422

Validation Error

post/story/{story_id}/videos
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Get Story Detail

This API retrieves a Story object.

status field shows current progressing status of this Story.

if Story is finished, you can get composed video from video_url. Send a GET request to get your story video.

Example Code

Get a new Story example

import requests

url = "http://api.vimmerse.net/story/{STORY_ID}"

headers = {
    'X-Api-Key': 'YOUR_API_KEY'
}

response = requests.request("GET", url, headers=headers)

print(response.text)
SecurityAPIKeyHeader
Responses
200

Story Object

400

Bad Request

404

Not Found

422

Validation Error

get/story/{story_id}
Request samples
Response samples
application/json
{
  • "data": {
    }
}

Concat Story

This API requests to compose all videos from Story. You can get composed video from video_url after videos are composed.

Send a POST request with empty body.

Example Code

Compose all video from media. Simple submit without data.

import requests

url = "http://api.vimmerse.net/story/{STORY_ID}/concat"

headers = {
    'X-Api-Key': 'YOUR_API_KEY',
}

response = requests.request("POST", url, headers=headers)

print(response.text)
SecurityAPIKeyHeader
Request
Request Body schema: application/x-www-form-urlencoded
concat_video_urls
Array of strings (Composing video URLs)

URLs of composing video.

audio_urls
Array of strings (Background Audio URLs)

URLs of background audio for composed video.

Responses
200

Story Object

400

Bad Request

402

Insufficient Credit

404

Not Found

422

Validation Error

post/story/{story_id}/concat
Request samples
Response samples
application/json
{ }