This is a command-line tool that uses the Replicate API to create videos from the outputs of image generation models.
- Run the CLI with a model name and a text prompt.
- The replicate-python client runs a prediction on the given model using the Replicate API.
- The individual images output by the model are save to a temporary directory
- FFmpeg is used to produce an MP4 and GIF from the output images.
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.