Kling and university researchers propose Coda-DaVinci for code-guided video generation

Video models can turn a description into beautiful footage, yet events may not follow instructions and revisited scenes may change. Coda-DaVinci explores how code and video models can share creative tasks to improve control and consistency while preserving natural motion.
Video-generation models can already turn a single description into a visually impressive short clip. But actually using them for creative work brings a harder problem: the footage may look beautiful while the action fails to follow instructions, or a previously established scene may have changed when the camera returns. Enabling generated video to retain its visual expressiveness while accurately carrying out creative intent is an important step toward more complex video-generation tasks.
Researchers from Nanjing University, Kling AI, Peking University, and other institutions recently proposed Coda-DaVinci, exploring how code and video-generation models can work together on creative tasks. The team systematically analyzed the granularity of 3D modeling, physical simulation, and prompt organization, then designed a task-adaptive video-generation framework. It achieved leading results in instruction following and scene consistency while alleviating the stiff motion found in conventional Code2Video workflows.
The central idea is straightforward: let code control key structures and events, leave appearance and subtle motion to the video model, and decide how to divide the work according to the task.
- Paper title: Coda-DaVinci: Reimagining Video Generation with Code2Video
- Research team: Nanjing University, Kling, Peking University, the University of Hong Kong, the Hong Kong University of Science and Technology (Guangzhou), the Hong Kong University of Science and Technology, and Tsinghua University
- Project website: https://coda-davinci.github.io/
- Project repository: https://github.com/FrankYang-17/Coda

Figure 1 | Coda-DaVinci selects a generation route for each task and uses different modeling approaches for environments, objects, and people.
Background: Giving video generation a programmable studio
Code2Video offers a new route to improving video controllability. Projects such as VideoCoCo and CodeVideoModel have a coding agent write code to construct and render a 3D scene. The resulting simplified video is then passed to a video-generation model to synthesize the final footage. This intermediate result is usually called a graybox video or 3D proxy.
It is like a programmable studio: object positions can be saved, motion trajectories specified, and cameras moved along designated routes. The video model gains a visual basis for the scene, giving creative intent a more explicit form of expression.
Yet many key choices remain after the studio has been built. Should every joint of a character be modeled? How should collisions and falling be implemented? How should a character in the proxy correspond to the character in the final footage? Together, these choices determine the guidance the video model ultimately receives.
Coda-DaVinci focuses on precisely these limits of Code2Video and on more effective collaboration between coding agents and video models.
Key insight: More detailed modeling does not necessarily produce more natural footage
The team conducted controlled experiments on scene revisits, complex movements, and physical processes, comparing configurations through blind evaluation. The results show that Code2Video provides relatively consistent benefits for consistency and instruction following. However, for complex human movements, the proxy can also pass stiff poses into the final video.
1. Spend modeling effort where it affects the result
For motion-intensive tasks, coarse proxies often preserve natural movement better than detailed models. Overly specific control over joints and poses can introduce errors and constrain the video model's room to supply details. For environments and structured objects whose spatial relationships must be maintained, models of medium granularity provide a more stable basis for the scene.
This observation leads to a valuable design principle: different objects in the same video can be modeled at different levels of granularity. Environments need their structure preserved, while people can be represented only by their overall positions and directions of movement, leaving the video model to complete subtle body motions.
2. Make physical processes actually occur within the scene
For tasks in which collisions, contact, and similar interactions affect the outcome of an event, the researchers additionally introduced Blender physical simulation. The simulated motion enters the proxy video to provide a dynamic reference for final generation. Among the configurations tested, explicit physical simulation improved average overall performance across the three analysis benchmarks.
3. Prompts also need to understand the proxy
Prompts explain what happens in the proxy and how the final footage should look. Coda-DaVinci has the coding agent that builds the scene inspect the actual rendered result before composing the generation prompt. It also links character descriptions to identity markers in the proxy and to reference images.
This enables geometric references and language descriptions to work together around the same subjects and events. Among the configurations compared in the study, the combination of medium-granularity modeling, physical simulation, and agent-written prompts achieved the highest overall average performance.

Figure 2 | Three controlled experiments examine modeling granularity, physical simulation, and prompting approach, respectively. Each comparison holds the other factors fixed. Scores are averages of four human evaluation measures. Motion-intensive VGIF-Bench particularly highlights the effects of modeling granularity.
Method: Let AI decide what to build and who should handle it, according to the task
Based on these findings, Coda-DaVinci organizes video creation into a task-adaptive framework.
First, determine how much explicit control the task requires. For tasks demanding precise spatial relationships, physical interactions, or scene revisits, the framework takes the 3D-modeling route. For tasks centered on natural body movement, with less need for explicit scene control, it can call the video model directly to make use of its motion-generation capabilities.
Once on the modeling route, decide how much detail each part requires. Environments and structured objects use medium-granularity representations, while people use coarse proxies. Physical processes suitable for simulation are handled in Blender. The generation prompt then links subjects in the proxy with appearance references, adding the detailed movements and visual expression required in the final footage.
After generation, the framework also checks whether the video has completed the task. The main agent can delegate separable modeling work to subagents, with scene code and assets stored in a shared workspace. When checks uncover problems, it can continue modifying the existing scene or adjust the generation prompt and reference inputs. An independent acceptance agent checks candidate videos against the original requirements, providing specific feedback for rework.
This gives each video project a reusable scene and a process that can be revised further, while preserving a basis for subsequent video continuation.

Figure 3 | From task routing and multigranularity modeling to video synthesis and visual feedback, Coda-DaVinci brings coding agents and video models into a single creative workflow.
Experiments: How much improvement can the generation approach deliver?
The main experiments use Seedance 2.5 to synthesize video for all methods, comparing direct generation, conventional agentic video generation, and Code2Video approaches. Evaluation covers physical properties, scene consistency, detailed instruction following, and visual realism.
More accurate instructions, more stable scene revisits
On VTR, Coda-DaVinci's rate of satisfying instruction checklist items reaches 91.42%, compared with 85.15% for direct generation, a gain of 6.27 percentage points, and the highest score among the evaluated methods.
On R2M's four measures of scene identity, local geometry, state retention, and object retention, Coda-DaVinci also ranks first among the evaluated methods. This suggests that explicit scenes and task-adaptive design can help models remember content already established in a video, allowing camera changes and unfolding events to build on a persistent scene state.
Retaining control while improving visual quality
On World Models' Last Exam in Physics, Coda-DaVinci improves the physical score over direct generation from 47.16 to 60.77. On the tested subset of T2AV-Compass, it achieves the highest visual-realism and visual-instruction-following scores among the evaluated Code2Video methods, with realism approaching that of direct generation.
These results demonstrate the value of task-adaptive design: the control afforded by explicit modeling can effectively complement a video model's visual expressiveness.

Table 1 | Main experimental results. Green marks the best value in each column. R2M uses a normalized memory ratio, VTR checks instruction completion, and T2AV-Compass reports visual realism and instruction following. All methods use the same video-generation model.
Two test cases illustrate control and naturalness
Preserving memory outside the frame
In the leaf-clearing example, the task requires the camera to turn away and then return to the original steps, while clearing continues during the time it is off camera.
In the directly generated video, most of the steps remain visible throughout, and many leaves are still present at the end. Both Codex + Blender and Coda-DaVinci complete the camera's departure and return, showing the cleared steps on revisiting them. The camera moves as instructed, and changes occurring off camera carry forward into the subsequent scene. This offers a clear illustration of Code2Video's advantages in instruction following and state consistency.

Figure 4 | Each of the three methods occupies two rows, with 8 frames per row, read from left to right and top to bottom. Each column uses the same timestamp.
An appropriate division of labor lets the video model supply motion details
The dough-kneading task further illustrates the difference between two Code2Video workflows. With Codex + Blender, the hands maintain similar poses for long periods, giving an overall static impression. In Coda-DaVinci, by contrast, the wrists rotate, finger poses change, and pressing continues, while the dough deforms through contact.
These results use the Blender route. The framework retains control over organizing the interaction while leaving the video model room to complete subtle hand movements, producing more natural changes in contact and motion in the finished footage.

Figure 5 | Continuous action from 4.50 to 8.25 seconds, sampled at 4 fps. Each method occupies two rows, totaling 16 frames.
From short clips to continuation: Making scenes reusable creative assets
The scene code and object states saved by Coda-DaVinci can also support long videos. The next segment can reuse the existing scene and carry forward the outcomes of earlier events. The study further tests this capability on LongAV-Compass and WBench. On the former, event completion and long-range structure improve; on the latter, the main gains are in interaction following and consistency.
The team also examined framework components and model combinations. On a 33-question ablation test set, disabling adaptive routing, using medium-granularity modeling uniformly, or removing independent acceptance checks all lowered the four evaluation scores. Experiments swapping the coding agent, video model, and modeling engine further illustrate trade-offs between different capabilities and computational costs.

Figure 6 | Experimental overview. The panels show main experimental performance, framework-component ablations, modeling-engine quality and token cost, and dimension-by-dimension results on two long-video benchmarks.
Outlook: Turning generated video into an ongoing creative process
Coda-DaVinci demonstrates further possibilities for collaboration between coding agents and video-generation models. Code gives scenes a structure that can be saved, modified, and reused, while the video model supplies realistic appearances and natural motion. As their division of labor matures, video creation may move from one-off prompt-based generation toward a complete process that supports continued editing, expansion, and continuation.
The team says Coda-DaVinci is the first work in its Coda (Code-Driven Video Generation Artist) series. Future research will explore directions including Video2Code Caption, Agentic Prompt Enhancement, and Reward Model, gradually building a technical system covering the entire Code2Video pipeline.
This article is from Synced, by Synced.
Related topics
After reading
Join the AINRK community
Read how to join the community and connect with people working in AI.




