khdjn / replicate-prediction-to-video

Create a video file from a series of Replicate model output images

Home Page:https://replicate.com/api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

output

This is a command-line tool that uses the Replicate API to create videos from the outputs of image generation models.

How it works

  1. Run the CLI with a model name and a text prompt.
  2. The replicate-python client runs a prediction on the given model using the Replicate API.
  3. The individual images output by the model are save to a temporary directory
  4. FFmpeg is used to produce an MP4 and GIF from the output images.

Usage

Install the dependencies

pip install -r requirements.txt

Get an API key from replicate.com/api and store it in a .env file:

echo "REPLICATE_API_KEY=XXXXXX" > .env

Create videos!

$ python prediction-to-video.py --model laion-ai/erlich --prompt "a logo of a white cat curled up into a ball, sleeping on a blue rug"

See replicate.com/collections/text-to-image for a collection of models that generate images from text prompts.

About

Create a video file from a series of Replicate model output images

https://replicate.com/api


Languages

Language:Python 100.0%