HoloCode: A Code-Centric Multi-Agent Framework for Image-to-3D Scene Generation

Hanlin Chen, Chung-Ching Lin, Yuyang Zhao, Dongyue Lu, Zhengyuan Yang, Xiaofei Wang, Kevin Lin, Zhendong Wang, Yu Yang, Lijuan WangNeurIPS 2026

TL;DR

Generating a 3D room from a single 2D photo usually ends up looking like a poltergeist visited—chairs float in mid-air and tables clip right through walls. HoloCode solves this by teaching AI agents to act like human 3D artists: first writing executable Python code to map out the room's global spatial layout, then filling in the 3D objects, and finally looking at a render of its own work to debug the scene. Because the entire scene is represented as clean code rather than an opaque neural blob, every object remains human-readable and effortlessly editable.

Figure 1: HoloCode generates 3D scenes from an image by predicting executable, object-centric Blender Python code. Each create command imports a mesh asset and sets its 3D transforms; colored markers and dashed cuboids indicate the correspondence between code and editable objects.

What Problem Does This Paper Address?

Recent breakthroughs in 3D generation are fantastic at creating isolated objects—give a diffusion model a picture of a vintage armchair, and you get a great 3D mesh. Naturally, researchers tried scaling this to entire rooms by chopping a photo into individual objects, generating each in 3D, and pasting them back together (a strategy exemplified by pipelines like SAM 3D).

The catch? Cropping objects destroys the global context. Without seeing the whole room at once, models lose track of relative depth, scale, and gravity. You end up with miniature sofas, floating lamps, and nightstands intersecting with beds. A good 3D scene requires reasoning about object geometry and global spatial physics simultaneously, while ideally giving human creators a way to tweak the results afterward.

Object-wise generation causes floating and penetrating meshes compared to HoloCode's shared layout

Methods

Instead of treating 3D scene generation as an implicit pixel-to-mesh black box, HoloCode uses executable Blender Python code as a shared state across a three-stage multi-agent pipeline. Given a single RGB image and 2D object masks/bounding boxes, here is how the assembly line runs:

  1. The Arranger Agent (Layout First): Before worrying about detailed 3D meshes, a vision-language model (VLM) looks at the image and 2D boxes to write a Python layout script. Every object gets a create(name, loc, rot, scale) command, locking in positions, orientations, and sizes on a shared 3D stage.
  2. The Modeler Agent (Smart Routing): Next, placeholders need actual 3D geometry without breaking the Arranger's layout. Rather than generating everything from scratch (which is slow) or retrieving everything from a fixed catalog (which fails on weird objects), the Modeler acts as a router. It searches the Objaverse 3D asset library using visual embeddings; if the match confidence is high ($s_i \ge \tau$), it retrieves the curated mesh. If confidence is low, it falls back to a Diffuser Agent to synthesize a brand-new 3D mesh from the cropped image.
  3. The Refiner Agent (Render-and-Edit): Even good initial predictions can leave tiny gaps. The Refiner renders the assembled scene from the original camera angle, compares it side-by-side with the input photo using Chain-of-Thought (CoT) reasoning, and tweaks the Python variables (loc, rot, scale) to fix floating or misaligned objects.
Figure 3: Overview of the HoloCode multi-agent inference pipeline. Given an image I and instance masks M, the system derives boxes B for layout reasoning and object crops for modeling. The Arranger infers executable layout code Ca with object identities and 3D transforms; the Modeler binds each object to geometry, using retrieval for high-confidence asset matches and diffusion for low-confidence or out-of-library objects, yielding Cm. The Refiner renders Cm, compares it with the input view, and edits the Blender Python code into Cr to correct residual spatial mismatches.

What's new in training? Standard Supervised Fine-Tuning (SFT) teaches an LLM how to write valid Python syntax, because it optimizes token-by-token, it doesn't inherently understand 3D space—a tiny typo in a coordinate number costs the same token loss as a minor naming quirk, even if it sends a chair through the ceiling. The authors follow SFT with GRPO (Group Relative Policy Optimization)—a reinforcement learning technique—rewarding the code-generating agents directly for script executability and actual 3D bounding-box overlap (3D IoU).

Datasets

To train agents to write spatially accurate code, the authors built two custom Blender Python code datasets derived from existing 3D indoor repositories: SAGE and 3D-FRONT. They normalized disparate coordinate systems into a unified camera-aligned Blender convention (using SAM 3D's predicted scale as a common reference).

  • Arranger Dataset: Pairs input images and ordered 2D boxes with deterministic ground-truth create scripts.
  • Refiner Dataset: Takes imperfect layouts, amplifies their spatial errors, renders the broken scenes, and uses GPT-5 to generate Chain-of-Thought visual debugging traces paired with corrected code.
  • Evaluation: Tested on 4,000 SAGE scenes, 1,000 3D-FRONT scenes, and 500 real-image Out-of-Distribution (OOD) inputs, alongside Objaverse for 3D asset retrieval.

Key Insights and Ideas

  • Spatial errors are "code-local": If a neural field generates a floating chair, fixing it is a mathematical headache. In Python code, pushing a floating chair down to touch the floor is literally changing one z-axis float variable in loc. Keeping the scene as explicit code makes both AI self-correction and human post-editing trivial.
  • Token imitation isn't spatial reasoning: Ablation studies show that jumping from SFT to GRPO spatial rewards boosts 3D layout overlap (mIoU) on SAGE from 0.409 to 0.445 (and up to 0.490 with the Refiner). Rewarding the executed 3D outcome rather than text similarity is key.
  • Merging Critic and Coder: Previous multi-agent systems often used one VLM to critique a render and another to write the fix. Merging both into a single CoT Refiner Agent cuts communication overhead while preserving visual debugging.

Key Results

HoloCode outperforms both frontier VLMs/LLMs on 3D layout estimation and specialized 3D reconstruction pipelines on full scene generation:

  • 3D Layout Estimation: On 3D-FRONT, HoloCode reaches 0.733 mIoU and 84.03% [email protected] (objects overlapping ground truth by at least 50%), vastly outpacing GPT-5 (0.280 mIoU) and the training-free agent baseline VIGA (0.524 mIoU). On SAGE, it hits 0.490 mIoU vs. VIGA's 0.318.
  • Full Scene Generation: On 3D-FRONT, HoloCode achieves the lowest Chamfer Distance (0.071, lower means better geometric accuracy) and highest F-Score (63.67%), beating object-wise SAM 3D (0.088 CD, 0.466 mIoU) and joint-optimization MIDI (0.116 CD, 0.612 mIoU).
  • Real-World Generalization: On real-photo OOD tests, HoloCode maintains its lead with 0.323 mIoU and 33.26% F-Score, demonstrating that layout code generalizes cleanly beyond synthetic training rooms.
Table 2: Quantitative comparison on 3D-FRONT. CD and F-Score are evaluated on the scene geometry, while mIoU measures object bounding-box overlap.

Limitations and Future Work

Not discussed in the paper. (While the authors note in their ablation study that Refiner gains on 3D-FRONT are marginal because the Arranger already achieves high accuracy, explicit system limitations and future work directions are not detailed in the main text.)

Summary updated

Abstract

Image-to-3D scene generation must recover both object geometry and plausible spatial relations. A common diffusion-based pipeline, exemplified by SAM 3D, generates each object separately and assembles the results. This preserves local details, but the lack of strong scene-level constraints often causes floating objects, interpenetrations, missing contacts, or implausible relative scales. Inspired by human designers who plan a layout before placing assets, we introduce \ours{}, a code-centric multi-agent framework. Given a single image and 2D localization cues, a vision-language model (VLM)-based Arranger Agent predicts executable Blender Python layout code with object identities and 3D transforms. A Modeler Agent binds each object to geometry through asset retrieval or image-to-3D object generation, and a Refiner Agent renders the scene and edits the code from visual feedback. The code representation exposes object names, positions, rotations, and scales, making generated scenes editable and interpretable. We train the code-generating agents using Blender Python datasets built from SAGE and 3D-FRONT, then further optimize them with GRPO rewards for executability and spatial alignment. Experiments in in-domain and cross-domain settings show that \ourMethod{} improves scene-level plausibility while preserving object fidelity. Project page is available at \url{https://holocode3d.github.io/}.
BibTeX
@inproceedings{chen2026holocode,
  author = {Hanlin Chen and Chung-Ching Lin and Yuyang Zhao and Dongyue Lu and Zhengyuan Yang and Xiaofei Wang and Kevin Lin and Zhendong Wang and Yu Yang and Lijuan Wang},
  title = {{HoloCode: A Code-Centric Multi-Agent Framework for Image-to-3D Scene Generation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=SHfDjzXoTd},
}
Figure