AI写代码搭3D场景再拍视频
现在的视频生成模型能拍出好看的画面,却摆不准东西的位置、也管不住运动怎么走。这篇让模型先写一段代码,在代码里搭出一个真的 3D 场景、摆好物体和镜头,再把这个场景渲染成一段「草稿视频」,交给下游的视频模型去细化——结构和运动由代码定,画质由生成模型补。训练上它先模仿、再用强化学习调,奖励一半看代码有没有跑通、一半看成片好不好,并且随着训练推进逐渐撤掉「跑通」这半边,逼模型对齐最终画面。效果是给 Minimax-H3 在物理常识基准上加了约 7 分、在 VBench-2.0 上加了 24 分。它不是你明天能用上的东西,但「用代码当视频的骨架」这条路被开源出来了。
📄 原文摘要(英文)
Recent years have witnessed remarkable progress in video generation in terms of visual quality and temporal consistency. However, generating videos with precise spatial structure, coherent motion dynamics, and controllable scene composition remains challenging. In this paper, we introduce Video-Coder, the first attempt to train a code-driven video generation agent, which autonomously writes and executes code to construct a dynamic 3D scene (Draft Video) that provides structure and motion signals to downstream video generators. To support this paradigm, we design a dedicated data pipeline and curate two high-quality datasets, Video-Coder-SFT-6k and Video-Coder-RL-2k, which contain diverse prompts and ground-truth reference videos. We further develop the Video- Coder Harness, a unified interactive environment integrating code execution, 3D scene rendering, and execution feedback for agent training and inference. We then train Video-Coder with SFT fol- lowed by harness-native agentic reinforcement learning with dual reward feedback, which combines execution-based and video-based rewards. Additionally, we design an annealing training strategy that gradually reduces the execution reward over time, allowing the model to rely more on the video reward in the later training stages. Experiments show that Video-Coder achieves significant gains, improving Minimax-H3 by approximately 7 points on PhyGenBench and 24 points on VBench-2.0. We hope this work can serve as an open foundation for coding agents in video generation, and we fully open-source our data, models, and code