vidai

package module
v0.0.0-...-090a321 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 11 Imported by: 0

README

vidai 📹🤖

vidai generates videos using AI.

This is a CLI tool for RunwayML Gen-2 that adds some extra features on top of it.

🚀 Features

  • Generate videos directly from the command line using a text or image prompt.
  • Create or extend videos longer than 4 seconds by reusing the last frame of the video as the input for the next generation.
  • Other handy tools to edit videos, like generating loops or resizing videos.

📦 Installation

You can use the Golang binary to install vidai:

go install github.com/igolaizola/vidai/cmd/vidai@latest

Or you can download the binary from the releases

📋 Requirements

You need to have a RunwayML account and extract the token from the request authorization header using your browser's developer tools.

To create extended videos, you need to have ffmpeg installed.

🕹️ Usage

Some examples

Generate a video from an image prompt:

vidai generate --token RUNWAYML_TOKEN --image car.jpg --output car.mp4

Generate a video from a text prompt:

vidai generate --token RUNWAYML_TOKEN --text "a car in the middle of the road" --output car.mp4

Extend a video by reusing the last frame twice:

vidai extend --input car.mp4 --output car-extended.mp4 --n 2

Convert a video to a loop:

vidai loop --input car.mp4 --output car-loop.mp4
Help

Launch vidai with the --help flag to see all available commands and options:

vidai --help

You can use the --help flag with any command to view available options:

vidai generate --help
How to launch commands

Launch commands using a configuration file:

vidai generate --config vidai.conf
# vidai.conf
token RUNWAYML_TOKEN
image car.jpg
output car.mp4
extend 2

Using environment variables (VIDAI prefix, uppercase and underscores):

export VIDAI_TOKEN=RUNWAYML_TOKEN
export VIDAI_IMAGE="car.jpg"
export VIDAI_OUTPUT="car.mp4"
export VIDAI_EXTEND=2
vidai generate

Using command line arguments:

vidai generate --token RUNWAYML_TOKEN --image car.jpg --video car.mp4 --extend 2

⚠️ Disclaimer

The automation of RunwayML accounts is a violation of their Terms of Service and will result in your account(s) being terminated.

Read about RunwayML Terms of Service and Community Guidelines.

vidai was written as a proof of concept and the code has been released for educational purposes only. The authors are released of any liabilities which your usage may entail.

💖 Support

If you have found my code helpful, please give the repository a star ⭐

Additionally, if you would like to support my late-night coding efforts and the coffee that keeps me going, I would greatly appreciate a donation.

You can invite me for a coffee at ko-fi (0% fees):

ko-fi

Or at buymeacoffee:

buymeacoffee

Donate to my PayPal:

paypal.me/igolaizola

Sponsor me on GitHub:

github.com/sponsors/igolaizola

Or donate to any of my crypto addresses:

  • BTC bc1qvuyrqwhml65adlu0j6l59mpfeez8ahdmm6t3ge
  • ETH 0x960a7a9cdba245c106F729170693C0BaE8b2fdeD
  • USDT (TRC20) TD35PTZhsvWmR5gB12cVLtJwZtTv1nroDU
  • USDC (BEP20) / BUSD (BEP20) 0x960a7a9cdba245c106F729170693C0BaE8b2fdeD
  • Monero 41yc4R9d9iZMePe47VbfameDWASYrVcjoZJhJHFaK7DM3F2F41HmcygCrnLptS4hkiJARCwQcWbkW9k1z1xQtGSCAu3A7V4

Thanks for your support!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loop

func Loop(ctx context.Context, input, output string) error

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(cfg *Config) *Client

func (*Client) Extend

func (c *Client) Extend(ctx context.Context, input, output string, n int,
	interpolate, upscale, watermark bool) ([]string, error)

Extend extends a video using the last frame of the previous video.

func (*Client) Generate

func (c *Client) Generate(ctx context.Context, image, text, output string,
	extend int, interpolate, upscale, watermark bool) ([]string, error)

Generate generates a video from an image and a text prompt.

type Config

type Config struct {
	Token  string
	Wait   time.Duration
	Debug  bool
	Client *http.Client
}

Directories

Path Synopsis
cmd
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL