A first step toward code-driven video creation with small open models
English · 简体中文
▶ Watch the 90-second launch film · 🤗 Hugging Face
The launch film was made by SenseNova 6.8 Code2Video, and so was every video that appears in it. The full films are in media/showcase/.
We present SenseNova 6.8 Code2Video, a lightweight open model for code-driven video creation. The model builds and renders videos by generating executable code, and currently focuses on short videos implemented entirely in code. Preliminary results show good visual composition and motion choreography in motion design, suggesting the potential of lightweight models for programmatic video creation.
We chose code as the entry point to video creation partly for its ability to connect different models and creative tools. Beyond building and rendering visual content directly, code can call image generation, video generation, 3D modelling and video editing models and tools, chaining generation, editing and compositing into a complete creative workflow.
We believe code can become a common language between ideas and finished work. Our long-term goal is a model that coordinates different generative models and creative tools through code to create digital content across media. SenseNova 6.8 Code2Video is a first step in this direction. Next, we will scale the model further and extend these abilities to editing, compositing, animation and 3D content creation.
We release the following as a reference for researchers:
| Resource | Description | Location |
|---|---|---|
| 🤗 Model weights | SenseNova 6.8 Code2Video, fine-tuned from Qwen3.8-27B, 512K context | Hugging Face · Weights |
| 📘 Deployment | Serving commands and recommended harness settings | Deployment |
| 🧩 Skill | code-video: workflow, eight craft guides and rendering/checking tools |
skills/code-video · Skill |
| ✍️ Prompt enhancement | Template that expands a short request into a production brief | prompts/ · Prompt enhancement |
| 🎞️ Trajectories | Full production trajectories (messages, tool calls, rendered review images) | Hugging Face |
Generative models now produce convincing lighting, materials and motion, but they generate the whole clip in one black-box sampling process:
- No grounding. The model learns how the world looks from images, not how it works from equations, so motion can look plausible and still be physically wrong.
- Hard to edit. Size, timing and trajectory stay implicit. Changing one detail means re-prompting and resampling the whole clip, and the rest of the clip changes with it.
- Inexact content. On-screen text, formulas, charts and data values must be exactly right, yet are easily garbled.
- Easy to modify. Every element is a named object in the code. Resizing, retiming, rerouting or restyling one element takes a few lines, and everything else stays exactly as it was; see Keep refining below.
- Precise, controllable content. Text is typeset verbatim, formulas and data come from the source, and coordinates, durations, beats and camera paths are explicit numbers that can be checked against the brief. Each frame is a pure function of
t, so the same code always renders the same film. - Precise physical modelling. Motion, collisions and light are computed from equations rather than guessed from appearance, so the physics on screen holds up. On top of this, textures, characters and backgrounds from generative models can be brought in and placed and timed by code, for richer and more polished pictures.
- Lower cost, faster polished films. A frame is drawn by a program on ordinary hardware, and an edit re-renders only what it touches, so rendering is far cheaper than sampling a video model. A production run still takes hours of agent time today; we aim to train the model to reach a polished film in fewer turns.
- Beyond this release. A code render can serve as a fast previs that fixes layout, motion and camera for a video model to render on top of, and because every quantity is known, the same programs can produce exactly labelled data (depth, camera poses, multi-view renders) for world models and 3D/4D reconstruction.
Can a Forest Hide a Landslide? · Fourier Light Painting · Signal / Noise / Shape
Paper & Ink · Clock Clock · Golden Spiral and Sunflower
Paper Sea · A to Z · Robot and the Night Lamp
Click a title for the full film with sound.
This is where code differs most from generative models. With a generative model, one change means re-prompting and resampling, and the parts you liked may change too. Here every note becomes a code edit, so the change is precise and everything else is untouched.
The first cut isn't the end. Once a film is delivered, SenseNova 6.8 Code2Video takes your notes (a new look, extra elements, different pacing), edits the code in the same project and renders again, so every round makes the film fuller and richer.
We asked it for a retro airport split-flap board, then turned it into a more designed piece with two rounds of notes:
![]() First cut A dark board under a spotlight |
![]() Round 2 Restyled as a bright pastel hotel lobby |
![]() Round 3 A plane overhead and travellers with luggage |
Each round takes one short note; the copy, timing and flip mechanics we didn't ask to change stay exactly as they were.
SenseNova 6.8 Code2Video is built on Qwen3.8-27B. It supports a 512K context, handles context compaction well and can sustain sessions of over a thousand turns. Download the weights from Hugging Face:
huggingface-cli download sensenova/SenseNova-6.8-Code2Video --local-dir /path/to/SenseNova-6.8-Code2Videodocker run --rm --gpus all --ipc=host -p 8000:8000 \
-v /path/to/SenseNova-6.8-Code2Video:/model \
ghcr.io/modeltc/lightllm:main \
python -m lightllm.server.api_server \
--model_dir /model \
--tp 4 \
--max_req_total_len 524288 \
--host 0.0.0.0 --port 8000docker run --rm --gpus all --ipc=host -p 8000:8000 \
-e VLLM_ALLOW_LONG_MAX_MODEL_LEN=1 \
-v /path/to/SenseNova-6.8-Code2Video:/model \
vllm/vllm-openai:latest \
--model /model \
--tensor-parallel-size 4 \
--max-model-len 524288 \
--reasoning-parser qwen3 \
--enable-auto-tool-choice \
--tool-call-parser qwen3_coder \
--host 0.0.0.0 --port 8000docker run --rm --gpus all --ipc=host -p 8000:8000 \
-e SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1 \
-v /path/to/SenseNova-6.8-Code2Video:/model \
lmsysorg/sglang:latest \
python -m sglang.launch_server \
--model-path /model \
--tp-size 4 \
--context-length 524288 \
--reasoning-parser qwen3 \
--tool-call-parser qwen3_coder \
--host 0.0.0.0 --port 8000A complete film is a long-horizon task: the model writes and renders code, reviews the frames and revises, turn after turn. SenseNova 6.8 Code2Video sustains runs of more than 10 hours and more than 2,000 turns. Configure Claude Code for runs of that length:
| Setting | Value | Configuration |
|---|---|---|
| Context window | 512K | CLAUDE_CODE_MAX_CONTEXT_TOKENS=524288 |
| Auto-compaction | 0.8 | CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=80 |
| Max output | 64K | CLAUDE_CODE_MAX_OUTPUT_TOKENS=65536 |
| Turns per run | 2,000+ | --max-turns 2000 or more |
| Time per run | 10 h+ | timeout 10h or more |
Set the context window explicitly, since Claude Code otherwise treats an unknown model as a 200K model. With compaction at 0.8 and 64K of output, every request stays within the 512K server limit.
Put the endpoint and these variables in a private settings file, and supply the credential through ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY:
{
"env": {
"ANTHROPIC_BASE_URL": "https://your-endpoint.example.com",
"ANTHROPIC_MODEL": "your-deployed-model-name",
"CLAUDE_CODE_MAX_CONTEXT_TOKENS": "524288",
"CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "80",
"CLAUDE_CODE_MAX_OUTPUT_TOKENS": "65536"
},
"model": "your-deployed-model-name"
}Avoid slow shell initialization: every Bash call starts a new shell.
The code-video skill turns production into an explicit, checkable workflow: write a spec, render every frame as a function of time, review contact sheets as images, and verify the delivered file. The skill covers eight craft guides: explainers, stylized looks, simulations, characters, 3D scenes, motion graphics, sound and narration, and music sync. The skill is fixed: the same version is used for every task.
Install the skill. The code-video skill is in this repository under skills/code-video. Copy it into .claude/skills/code-video inside your task folder (project-level installation). Set TASK to the absolute path of your task folder:
TASK=/absolute/path/to/a-new-video-task
git clone https://github.com/OpenSenseNova/SenseNova-6.8-Code2Video.git
mkdir -p "$TASK/.claude/skills"
cp -r SenseNova-6.8-Code2Video/skills/code-video "$TASK/.claude/skills/"You can also give the address to your agent and let it install the skill, for example:
Please install https://github.com/OpenSenseNova/SenseNova-6.8-Code2Video/tree/main/skills/code-video into
.claude/skills/code-videoin the current task folder.
After installation, you may need to manually restart the agent service for the new skill to be loaded.
Prepare the environment. You need Claude Code, Node.js 18+, Python 3, ffmpeg/ffprobe and fonts for the video's language. Installing the environment on the first run can take a long time, so install the dependencies before starting production:
python3 -m pip install -r "$TASK/.claude/skills/code-video/requirements.txt"
cd "$TASK" && npm install playwright && npx playwright install chromiumStart Claude Code. Launch Claude Code in the task folder with your private settings file; see Recommended harness for the endpoint and parameter settings:
cd "$TASK"
claude --settings /absolute/path/to/private-settings.json --model your-deployed-model-nameBuild request.md from the Enhance prompt template as the prompts guide shows, send it to Claude Opus 5.5 or another strong model, and save the result as dense_prompt.md in the task root.
Start production. Once the settings and prompt are ready, run the following command, replacing the settings file path and model name with your actual values.
cd "$TASK"
claude --settings /absolute/path/to/private-settings.json --model your-deployed-sensenova-code2video-model \
'Use the project code-video skill. Read .claude/skills/code-video/SKILL.md and dense_prompt.md, then the relevant craft guides. This directory is the project root. Produce the complete video, run the rendering tools and complete at least two visual review passes. Deliver out/final.mp4, SPEC.md, VERIFY.md, a contact sheet, source code and reproduction commands. Continue until the actual video passes verification; report any blockers honestly.'Watch and revise. Say what to change in the same session (time point, what is wrong, what you want instead), or come back later with --continue; the model edits the same project and renders again.
- Scope. The model makes videos that can be written as code: motion graphics, explainers, stylized 2D and 3D scenes, procedural audio. It does not generate photorealistic footage.
- Cost. A production run takes hours and a long context. Results depend on the harness configuration (context size, compaction, output limit; see Deployment).
- Evaluation. We report qualitative examples only. We have not yet built a systematic benchmark for code-driven video, and we consider one an important open problem.
- Gap to frontier models. The model is clearly behind the strongest proprietary models on visual polish and long-horizon reliability. Narrowing that gap with small open models is the purpose of this release.
- Prompt enhancement. The model can enhance prompts on its own, but only at a basic level. Enhancing the prompt with a strong model such as Claude further improves the aesthetic quality of the film.
![]() Tiankuo Yao |
![]() syssysyssy |
![]() Mr.Tony |
![]() Penghao Wu |
![]() Dder |
![]() Ming |
![]() shiyigueris-cmyk |
![]() Lewei Lu |












