# Repository Briefing: showlab/Code2Video
> Source: https://repoforai.com/repo/showlab/Code2Video (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/showlab/Code2Video
- **Official Docs / Website**: https://showlab.github.io/Code2Video/
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: B+ (75/100 · Maintenance 31/35 · Adoption 18/25 · Releases 6/20 · License 20/20)
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: API, CLI
- **Momentum**: 2,482 ★ total (+4 24h / +35 7d) · 304 forks
- **Topics**: `coding`, `education`, `multi-agent`, `video-generation`
- **When to Use**: Best for: Educators and research teams prototyping diagram-heavy lessons that need editable scene code, or comparing generation workflows on the MMMC benchmark. Skip if: You need an offline pipeline out of the box, a turnkey production service, or photorealistic footage rather than programmatic visualization.

## Overview
```text
### Architecture & Core Mechanics
Code2Video is a Python orchestration framework that turns a knowledge point into an editable scene program rather than generating video frames directly. Planner expands the topic into a storyboard, Coder synthesizes debuggable Manim code, and Critic uses visual anchors to refine layout. The scene program defines both spatial composition and timing, and Manim Community v0.19.0 renders it.

The source layout centers on `src/agent.py`, with separate shell launchers for single topics and benchmark runs. Prompt templates live under `prompts/`, topic lists and metadata under `json_files/`, and the suggested layout groups generated cases under `CASES/` by `FOLDER_PREFIX`. The observed customization points are prompts, topic inputs, model selection, and generated scene code; neither a formal plugin contract nor an inbound service API is established.

### Key Capabilities & Differentiators
The single-topic runner accepts `--knowledge_point`. The benchmark runner reads `long_video_topics_list.json` and provides controls for model selection (`API`), output grouping (`FOLDER_PREFIX`), topic count (`MAX_CONCEPTS`), and parallel groups (`PARALLEL_GROUP_NUM`). Claude-4-Opus is the named recommendation for Manim code quality, and `gemini-2.5-pro-preview-05-06` for visual review. Those recommendations do not establish a compatibility matrix across providers or model versions.

MMMC contains 117 curated learning topics inspired by 3Blue1Brown. `eval_TQ.py` evaluates knowledge transfer through TeachQuiz, `eval_AES.py` covers aesthetic and structural quality, and generation efficiency is tracked through token usage and execution time. These measures answer different questions: a successful render or a strong layout score does not establish that the lesson teaches the concept correctly.

### Trade-offs & Limitations
Compared with direct video generators such as Veo3 and Wan2.2, Code2Video gives teams a scene program they can inspect, patch, and rerender. That is useful for equations, diagrams, and stepwise explanations; it is less compelling for footage-like imagery. Compared with hand-written Manim, it automates storyboarding and the first implementation pass, but rendering success still leaves mathematical correctness, teaching quality, and layout to be checked.

A saved scene program gives you a more repeatable rendering input, not a guarantee that a fresh model run will generate the same code. Hosted calls introduce provider quotas, variable token cost, and model-version dependencies. For unattended use, isolate generated-code execution from API credentials and shared files. The MIT license covers repository software; verify model-service terms and third-party asset rights separately.

### Hardware & Deployment Guide
From `src/`, install Python dependencies with `pip install -r requirements.txt` and set up Manim Community v0.19.0. Put LLM and Gemini credentials in `api_config.json`, then try `sh run_agent_single.sh --knowledge_point "Linear transformations and matrices"` before scaling to `sh run_agent.sh`. IconFinder is optional via `ICONFINDER_API_KEY`, with collected MMMC icons available as a fallback.

The orchestration and rendering can run on your own machine, but the documented model path uses external APIs. No Docker deployment, offline model path, or fixed GPU/VRAM requirement is established. Size workers using a representative render and measure memory, runtime, and provider usage before raising batch parallelism. There is no tagged release in the supplied metadata; dated project updates record dependency cleanup and the addition of the dataset-hosted icon fallback.
```

## Key Capabilities
```text
- Scene representation: Executable Manim code controls both object placement and animation timing.
- Agent roles: Planner expands the topic, Coder synthesizes debuggable scene code, and Critic refines layout using visual anchors.
- Model configuration: `api_config.json` holds provider credentials; the named quality recommendations are Claude-4-Opus and `gemini-2.5-pro-preview-05-06`.
- Batch control: `MAX_CONCEPTS` limits topic count (`-1` selects all), and `PARALLEL_GROUP_NUM` controls parallel groups.
- Evaluation: MMMC covers 117 curated topics and separates TeachQuiz, AES, and generation efficiency.
- Asset sourcing: IconFinder supplies optional icons; collected assets are available in the MMMC dataset as a fallback.
```

## Quick Start / Clone
```bash
cd src/
pip install -r requirements.txt
```
