This repository contains a Python wrapper for the Open-Sora API, which allows you to generate videos using AI. The Open-Sora API provides a powerful interface for creating AI-generated videos with customizable parameters.
Project Status: This project is in active development, functional but continuously improving. Contributions and feedback are welcome!
- 🎨 Easy-to-use Python interface for the Open-Sora API
- 🎥 Customizable video generation parameters
- 🛡️ Error handling and logging
- 🔄 Rate limiting and retries
- Clone the repository:
git clone https://github.com/Kuonirad/open-sora-api.git cd open-sora-api
- Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate
- Install the required dependencies:
pip install -r requirements.txt
- Set up your API key by creating a .env file in the project root:
MODELSLAB_API_KEY=your_api_key_here
Visit the GitHub repository for the latest version and to contribute.
- Use the OpenSoraAPI class in your Python code:
from open_sora import OpenSoraAPI
api = OpenSoraAPI() result = api.generate_video("A beautiful sunset over the ocean") print(result)
- Handle errors and log information as needed to ensure smooth operation.
- OpenSoraAPI(api_key=None): Initializes the API wrapper. If api_key is not provided, it will be loaded from the MODELSLAB_API_KEY environment variable.
- generate_video(prompt, negative_prompt="", width=512, height=512, num_inference_steps=50, guidance_scale=7.5): Generates a video based on the provided parameters.
For more detailed API documentation, please refer to the Open-Sora API Documentation.
We welcome contributions! Please see the CONTRIBUTING.md file for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions, please open an issue on GitHub Issues or contact the maintainers.
Made with ❤️ by the Open-Sora Team