Video python snippets

Get up to speed with the video API

Generate 20 captions

import requests
import json

X_RapidAPI_Key = '4116843d07msh704be0dfa337826p108b3fj43524'
X_RapidAPI_Host = 'colorize-video.p.rapidapi.com'

headers = {
    'X-RapidAPI-Key': '4116843d07msh704be0dfa337826p108b3fjsn7ab402961f9f',
    'X-RapidAPI-Host': 'colorize-video.p.rapidapi.com',
}

url = "https://" + X_RapidAPI_Host + "/generate_video_frame_prompt"

files = {
    'image': ('test.jpg', open('./test.jpg', 'rb'), 'image/jpeg')   
}

data = {
  "standard_filter_id": "0", # 1-20, 0 is disabled 
  "artistic_filter_id": "0", # 1-100, 0 is disabled
  "all_standard_filters": "true", # return all 20 prompts
  "all_artistic_filters": "false", # return all 100 prompts
  "raw_captions": "false" # remove pre and post fix to the caption
}

response = requests.post(url, files=files, data=data, headers=headers)
prompts = data = json.loads(response.text)

Create 20 versions of one frame

Extract all the frames from a video

Colorize all the frames with the same prompt

Colorize all the images with the same reference image

Use the previous frame to colorize one after each other

Last updated