Open-source AI video generation library without API keys
Project description
OpenVideo
Open-source AI video generation library without API keys. Generate videos from text prompts or images using open-source models.
Features
- Text-to-Video: Generate videos from text descriptions
- Image-to-Video: Animate static images into videos
- Multiple Models: Support for various open-source models (Zeroscope, ModelScope, AnimateDiff)
- No API Keys Required: Fully local generation using open-source models
- CLI Interface: Easy command-line usage
- Python API: Programmatic access for developers
Installation
pip install openvideo
For development installation:
pip install openvideo[dev]
Requirements
- Python 3.9+
- CUDA-capable GPU (recommended for performance)
- 8GB+ VRAM for video generation
Quick Start
CLI Usage
# Text to Video
openvideo text2video -p "a cat walking in the snow" -o output.mp4
# Image to Video
openvideo image2video -i input.png -o output.mp4 -p "camera panning"
Python API
from openvideo import VideoGenerator
# Initialize generator
generator = VideoGenerator(model_name="zeroscope")
# Generate from text
frames = generator.generate(
prompt="a beautiful sunset over the ocean",
num_frames=24,
width=512,
height=512,
)
# Save video
generator.save_video(frames, "output.mp4", fps=24)
# Generate from image
from PIL import Image
img = Image.open("input.png")
frames = generator.generate_from_image(
image=img,
prompt="gentle camera pan",
num_frames=24,
)
generator.save_video(frames, "output.mp4")
Supported Models
| Model | Description | VRAM |
|---|---|---|
| zeroscope | High-quality text-to-video | 8GB |
| modelscope | Fast text-to-video | 6GB |
| animatediff | Animation from SD models | 6GB |
Configuration
GPU Settings
# Use specific device
generator = VideoGenerator(device="cuda")
# Use float16 for less VRAM
generator = VideoGenerator(dtype="float16")
Generation Parameters
| Parameter | Default | Description |
|---|---|---|
| num_frames | 24 | Number of frames |
| width | 512 | Frame width |
| height | 512 | Frame height |
| num_inference_steps | 25 | Denoising steps |
| guidance_scale | 7.5 | CFG scale |
| seed | None | Random seed |
Advanced Usage
Custom Model Loading
from openvideo.models.text2video import TextToVideoModel
model = TextToVideoModel(model_name="zeroscope")
model.load()
frames = model.generate(prompt="your prompt")
Batch Generation
prompts = [
"a dog running in park",
"a bird flying in sky",
"rain falling on window",
]
for i, prompt in enumerate(prompts):
frames = generator.generate(prompt=prompt)
generator.save_video(frames, f"video_{i}.mp4")
Troubleshooting
Out of Memory
- Reduce resolution (width/height)
- Use float16 dtype
- Reduce num_frames
- Enable attention slicing
Slow Generation
- Use GPU instead of CPU
- Reduce num_inference_steps
- Use smaller models
License
MIT License
Credits
- Uses Hugging Face Diffusers
- Model weights from various open-source projects
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
openvideo_ai-0.1.0.tar.gz
(4.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openvideo_ai-0.1.0.tar.gz.
File metadata
- Download URL: openvideo_ai-0.1.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a13d09714bcfd983b8f3a713a579071b5f455ef6c0ba028d73a56f3db76be6d3
|
|
| MD5 |
035cd556858bf43bdfbbf38499d3b8a4
|
|
| BLAKE2b-256 |
7382ae9a5d3ee8d3c1873c130f874ff66c4616c6fbc25ae9ed92955ee2f252eb
|
File details
Details for the file openvideo_ai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openvideo_ai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77f65eacb6bcefd5045fbd96ff84f55fd66a9fd8c59777da65f99368eb18285c
|
|
| MD5 |
d6e5d9b908a41199a7bbcc0c55fe934d
|
|
| BLAKE2b-256 |
57f0ef6815800c678a0ee57a8eff1a7eee21f6cd1cdff636bd5b67e7571b5d1a
|