Generate beautiful Manim animations using AI. Describe what you want to animate, and the system generates the code and renders it.
pip install -r requirements.txtcp .env.example .env
# Edit .env and add your TogetherAI API keypython main.pyYour request: a blue circle growing and rotating
Done! Your animation renders automatically.
Make sure you have:
- Python 3.10+
- Manim installed and working
- FFmpeg (for video rendering)
cd ManimAiGenpip install -r requirements.txt-
Get a TogetherAI API key from together.ai
-
Create a
.envfile in the project root:
cp .env.example .env- Edit
.envand add your API key:
TOGETHER_API_KEY=your_actual_api_key_here
python main.pyThen enter your animation description when prompted:
Your request: a blue circle that grows larger and rotates 360 degrees while changing to red
Generated scenes are saved in the generated_scenes/ directory with the scene class name as the filename.
Request: Create a green square that morphs into a purple circle with a smooth animation
Request: Visualize a sine wave with animated points moving along the curve
Request: Show three bouncing balls of different colors interacting with each other
- Be Specific: Describe exact movements, colors, and timing
- Use Examples: The system learns from examples when generating code
- Start Simple: Test with basic animations first
- Review Code: Check generated code in
generated_scenes/directory - Iterate: Refine your requests based on results
After testing with low quality, you can render in high quality:
- Find your generated scene in
generated_scenes/ - Render with higher quality:
manim -qh generated_scenes/your_scene.py YourSceneClassNameError: TOGETHER_API_KEY environment variable not set
Solution: Make sure your .env file exists and contains the API key
Error: Manim rendering failed
Solution: Install Manim and verify it works: manim --version
Solution: The scene may be too complex. Simplify or render at a lower quality
Solution: Reduce quality level or break complex animations into multiple scenes
- Explore the
examples/directory for animation patterns - Modify generated code to fine-tune results
- Create complex animations by combining multiple scenes
- Build animations in the
examples/directory for training context
MIT
For issues with:
- Manim: Manim Documentation
- TogetherAI: Together AI Support
- This Project: Check the README or create an issue

