File size: 10,540 Bytes
685c2fe
 
 
 
 
 
 
 
 
 
 
8f1899c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
---
title: Manimator
emoji: πŸ‘€
colorFrom: gray
colorTo: blue
sdk: docker
pinned: false
license: mit
short_description: Transform research papers and mathematical concepts into stu
---

# manimator

![manimator](https://github.com/HyperCluster-Tech/manimator/blob/main/assets/manimator.png)
[![GitHub Stars](https://img.shields.io/github/stars/HyperCluster-Tech/manimator?style=social)](https://github.com/HyperCluster-Tech/manimator/stargazers)
[![GitHub Forks](https://img.shields.io/github/forks/HyperCluster-Tech/manimator?style=social)](https://github.com/HyperCluster-Tech/manimator/network/members)
[![GitHub Issues](https://img.shields.io/github/issues/HyperCluster-Tech/manimator)](https://github.com/HyperCluster-Tech/manimator/issues)
[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/HyperCluster-Tech/manimator)](https://github.com/HyperCluster-Tech/manimator/pulls)
[![License](https://img.shields.io/github/license/HyperCluster-Tech/manimator)](https://github.com/HyperCluster-Tech/manimator/blob/main/LICENSE)
[![Website](https://img.shields.io/badge/Website-manimator.hypercluster.tech-blue)](https://manimator.hypercluster.tech/)

### What is _manimator_?

manimator is a tool to transform research papers and mathematical concepts into stunning visual explanations, powered by AI and the [manim](https://github.com/ManimCommunity/manim) engine

Building on the incredible work by 3Blue1Brown and the manim community, _manimator_ turns complex research papers and user prompts into clear, animated explainer videos.

### πŸ”— Try it out:

- Gradio Demo: [![On Gradio (Hugging Face)](https://huggingface.co/datasets/huggingface/badges/raw/main/open-in-hf-spaces-md-dark.svg)](https://huggingface.co/spaces/HyperCluster/manimator)
- Or replace `arxiv.org` with `manimator.hypercluster.tech` in any arXiv PDF URL for instant visualizations!

### 🌟 Highlights so far:

- Over **1000+ uses** within 24 hours of launch and over **5000 uses** within a week
- Featured as Hugging Face's **Space of the Week**!
- 16th in Hugging Face's Top Trending Spaces
- Take a look at the paper on arXiv here: https://www.arxiv.org/abs/2507.14306

## πŸŽ₯ Demo Videos:

<table border="0" style="width: 100%; text-align: center; margin: 20px 0;">
    <tr>
        <td width="50%">
            <video src="https://github.com/user-attachments/assets/5aa9ebea-06f1-489d-9a68-c8c62cdc6915" width="100%" controls autoplay loop></video>
            <p align="center">ArXiv usage Walkthrough</p>
        </td>
        <td width="50%">
            <video src="https://github.com/user-attachments/assets/820142c4-7931-4aa8-b9b7-c1d5d46b23b5" width="100%" controls autoplay loop></video>
            <p align="center">Gradio Walkthrough</p>
        </td>
    </tr>
</table>

## Installation

> [!IMPORTANT]
> This project is built using the [poetry](https://python-poetry.org/) tool to manage Python packages and dependencies. Download it from [here](https://python-poetry.org/docs/#installing-with-the-official-installer) to run this project or use the Docker image.
> This project is dependent on the [manim](https://github.com/ManimCommunity/manim) engine and hence has certain dependencies for running the engine properly which can be found [here](https://docs.manim.community/en/stable/installation.html).

```
bash
git clone https://github.com/HyperCluster-Tech/manimator
cd manimator
```

Install Dependencies:
`poetry install`

Activate the environment:
`poetry env activate`

(If you're using a version before Poetry 2.0, you should use `poetry shell`)

## Usage

After successfully installing all the project dependencies and manim dependencies, set the environment variables in a .env file according to the .env.example:

Run the FastAPI server:

```
poetry run app
```

and visit `localhost:8000/docs` to open SwaggerUI

Run the Gradio interface:

```
poetry run gradio-app
```

and open `localhost:7860`

### Notes

To change the models being used, you can set the environment variables for the models according to [LiteLLM syntax](https://docs.litellm.ai/docs/providers) and set the corresponding API keys accordingly.

To prompt engineer to better suit your use case, you can modify the system prompts in `utils/system_prompts.py` and change the few shot examples in `few_shot/few_shot_prompts.py`.

## πŸ›³οΈ Docker

To use manimator with Docker, execute the following commands:

1. Clone the manimator repo to get the Docker image (we will be publishing the image in DockerHub soon)
2. Run the Docker container, exposing port 8000 for the FastAPI server or 7860 for the Gradio interface

Build the Docker image locally. Then, run the Docker container as follows:

`docker build -t manimator .`

If you are running the FastAPI server

`docker run -p 8000:8000 manimator`

Else for the Gradio interface

`docker run -p 7860:7860 manimator`

<details>
<summary><h2>API Endpoints</h2></summary>

- [API Endpoints](#api-endpoints)
  - [Health Check](#health-check)
  - [PDF Processing](#pdf-processing)
    - [Generate PDF Scene](#generate-pdf-scene)
    - [Process ArXiv PDF](#process-arxiv-pdf)
  - [Scene Generation](#scene-generation)
    - [Generate Prompt Scene](#generate-prompt-scene)
  - [Animation Generation](#animation-generation)
    - [Generate Animation](#generate-animation)

### Health Check

#### Check API Health Status

Endpoint: `/health-check`  
Method: GET

Returns the health status of the API.

Response:

```json
{
  "status": "ok"
}
```

Curl command:

```bash
curl http://localhost:8000/health-check
```

### PDF Processing

#### Generate PDF Scene

Endpoint: `/generate-pdf-scene`  
Method: POST

Processes a PDF file and generates a scene description for animation.

Request:

- Content-Type: `multipart/form-data`
- Body: PDF file

Response:

```json
{
  "scene_description": "Generated scene description based on PDF content"
}
```

Curl command:

```bash
curl -X POST -F "file=@/path/to/file.pdf" http://localhost:8000/generate-pdf-scene
```

#### Process ArXiv PDF

Endpoint: `/pdf/{arxiv_id}`  
Method: GET

Downloads and processes an arXiv paper by ID to generate a scene description.

Parameters:

- `arxiv_id`: The arXiv paper identifier

Response:

```json
{
  "scene_description": "Generated scene description based on arXiv paper"
}
```

Curl command:

```bash
curl http://localhost:8000/pdf/2312.12345
```

### Scene Generation

#### Generate Prompt Scene

Endpoint: `/generate-prompt-scene`  
Method: POST

Generates a scene description from a text prompt.

Request:

- Content-Type: `application/json`
- Body:

```json
{
  "prompt": "Your scene description prompt"
}
```

Response:

```json
{
  "scene_description": "Generated scene description based on prompt"
}
```

Curl command:

```bash
curl -X POST \
     -H "Content-Type: application/json" \
     -d '{"prompt": "Explain how neural networks work"}' \
     http://localhost:8000/generate-prompt-scene
```

### Animation Generation

#### Generate Animation

Endpoint: `/generate-animation`  
Method: POST

Generates a Manim animation based on a text prompt.

Request:

- Content-Type: `application/json`
- Body:

```json
{
  "prompt": "Your animation prompt"
}
```

Response:

- Content-Type: `video/mp4`
- Body: Generated MP4 animation file

Curl command:

```bash
curl -X POST \
     -H "Content-Type: application/json" \
     -d '{"prompt": "Create an animation explaining quantum computing"}' \
     --output animation.mp4 \
     http://localhost:8000/generate-animation
```

### Error Handling

All endpoints follow consistent error handling:

- 400: Bad Request - Invalid input or missing required fields
- 500: Internal Server Error - Processing or generation failure

Error responses include a detail message:

```json
{
  "detail": "Error description"
}
```

### Notes

1. The API processes PDFs and generates animations using the Manim library
2. Scene descriptions are generated using Language Models (LLMs)
3. Animations are rendered using Manim with specific quality settings (-pql flag)
4. All generated files are handled in temporary directories and cleaned up automatically
5. PDF processing includes automatic compression for optimal performance

</details>

## Coming Soon

- **Improved Generation Quality**  
  Enhance the clarity and precision of generated animations and videos.

- **Video Transcription**  
  Automatically generate scripts explaining how concepts in the video relate to the research paper.

- **Adding Audio**  
  Support for adding voiceovers and background music to create more engaging visualizations.

- **Chrome Extension**
  Based on the code graciously contributed by [Dr. Seth Dobrin](https://drsethdobrin.com/) under the [Creative Commons License](https://github.com/HyperCluster-Tech/manimator-chrome-extension/blob/main/LICENSE), we will be releasing a Chrome Extension on the Chrome Web Store soon!

## Limitations

- **LLM Limitations**  
  For accurate document parsing and code generation, we require large models like Gemini, DeepSeek V3 and Qwen 2.5 Coder 32B, which cannot be run locally.

- **Video Generation Limitations**  
  The generated video may sometimes exhibit overlap between scenes and rendered elements, leading to visual inconsistencies. Additionally, it sometimes fails to effectively visualize complex papers in a relevant and meaningful manner.

## License

manimator is licensed under the MIT License. See `LICENSE` for more information.
The project uses the [Manim engine](https://github.com/ManimCommunity/manim) under the hood, which is double-licensed under the MIT license, with copyright by 3blue1brown LLC and copyright by Manim Community Developers.

## Acknowledgements

We acknowledge the [Manim Community](https://www.manim.community/) and [3Blue1Brown](https://github.com/3b1b/manim) for developing and maintaining the Manim library, which serves as the foundation for this project. Project developers include: [Samarth P](https://github.com/samarth777), [Vyoman Jain](https://github.com/VyoJ), [Shiva Golugula](https://github.com/Shiva4113), and [M Sai Sathvik](https://github.com/User-LazySloth) for their efforts in developing **manimator**.

Models and Providers being used:

- DeepSeek-V3
- Llama 3.3 70B via Groq
- Gemini 1.5 Flash / 2.0 Flash-experimental

## Contact

For any inquiries, please contact us at [email protected] or refer to our website [hypercluster.tech](https://www.hypercluster.tech/)

<img src="https://api.star-history.com/svg?repos=HyperCluster-Tech/manimator&type=Date" alt="Star History Chart">