Organizations: HKUST (Guangzhou), Guangzhou, China · Alibaba Group, Hangzhou, China · HKUST, Hong Kong, China · University of Electronic Science, Chengdu, China · Zhejiang Lab, Hangzhou, China
While Vision Language Models (VLMs) have shown promise in Design-to-Code generation, they suffer from a "holistic bottleneck-failing to reconcile high-level structural hierarchy with fine-grained visual details, often resulting in layout distortions or generic placeholders. To bridge this gap, we propose DOne, an end-to-end framework that decouples structure understanding from element rendering. DOne introduces (1) a learned layout segmentation module to decompose complex designs, avoiding the limitations of heuristic cropping; (2) a specialized hybrid element retriever to handle the extreme aspect ratios and densities of UI components; and (3) a schema-guided generation paradigm that bridges layout and code. To rigorously assess performance, we introduce HiFi2Code, a benchmark featuring significantly higher layout complexity than existing datasets. Extensive evaluations on the HiFi2Code demonstrate that DOne outperforms exiting methods in both high-level visual similarity (e.g., over 10% in GPT Score) and fine-grained element alignment. Human evaluations confirm a 3 times productivity gain with higher visual fidelity.
Figures & tables
Figure 1: Reconstruction comparison (a-b) and illustrative examples of baseline failures (c-d).
Figure 2: The DOne Framework. DOne employs layout segmentation and visual element detection, followed by schema-guided code generation to ensure structural and visual fidelity.
Metric
Min
Max
Avg
Boxes/page
2
7
3.53
Elements/page
1
64
4.66
Elements/box
0
16
1.11
Tokens/box
0
1518
69.97
Box-to-page Ratio
0%
99%
25%
Table 1: Statistics of WebSeg.
Metric
Design2Code
Web2Code
HiFi2Code
Avg. boxes/page
3.88
2.84
5.32
Avg. elements/page
2.59
1.43
14.39
Avg. elements/box
0.53
0.51
2.80
Element coverage
81.4%
66.9%
100%
Large elements
20.7%
17.7%
44.2%
Table 2: Comparison of evaluation datasets.
Figure 3: Example of layout segmentation.
Figure 4: Example of visual element detection.
Table 7
Configuration
CLIP
GPT
Direct Generation
0.6475
-
+ Layout Segmentation
0.7226
0.701
+ Element Detection
0.6975
0.656
+ Schema Guidance
0.6615
0.554
+ All Techniques ( DOne )
0.7435
0.723
Table 5: Ablation study on DOne components.
Method
Vote Percentage
S2C
15.5%
CoT2C
23.3%
DCGen
2.60%
DOne
58.6%
Table 6: User preference distribution.
Figure 5: Pairwise win/tie/loss rates vs. S2C.
Metric
Control
DOne (Exp)
Time (min)
9.81
3.18
CLIP Score
0.499
0.665
Table 7: Average efficiency and fidelity metrics.
Figure 6: Task completion time distribution.
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
Metric
Value
mAP 50:95
0.5316
mAP 50
0.8203
Precision
0.7763
Recall
0.7293
Appendix
Table 8: Performance metrics
Model
Large Objects
Small Objects
Overall
CO-DETR
0.6823
0.7545
0.7356
YOLOv10
0.6139
0.7914
0.7212
CO-DETR+YOLOv10
0.6751
0.7812
0.7512
Appendix
Table 9: Comparison of mAP 75 across different model combinations.
Figure 8: Prompt of schema generation.
Figure 9: Prompt of code generation with schema.
Figure 10: Qualitative comparison of generated webpage results.
Design-to-code translates high-fidelity UI designs into executable front-end implementations, but progress remains hard to compare due to inconsistent datasets, toolchains, and evaluation protocols. We introduce 1D-Bench, a benchmark grounded in real e-commerce workflows, where each instance provides a reference rendering and an exported intermediate representation that may contain extraction errors. 1D is short for one day, representing the efficient completion of design-to-code tasks in less than one day. Models take both as input, using the intermediate representation as structural cues while being evaluated against the reference rendering, which tests robustness to intermediate representation defects rather than literal adherence. 1D-Bench requires generating an executable React codebase under a fixed toolchain with an explicit component hierarchy, and defines a multi-round setting in which models iteratively apply component-level edits using execution feedback. Experiments on commercial and open-weight multimodal models show that iterative editing generally improves final performance by increasing rendering success and often improving visual similarity. We further conduct a pilot study on post-training with synthetic repair trajectories and reinforcement learning based editing, and observe limited and unstable gains that may stem from sparse terminal rewards and high-variance file-level updates. The data and scripts used in this study are available in an anonymized repository at https://anonymous.4open.science/r/d2c-benchmark-A9C4/.
Existing screenshot-to-code systems face a trade-off between flexibility and controllability. Direct multimodal generation can hallucinate visible details, whereas structured pipelines reduce such errors through component-wise decomposition, predefined templates, and customized intermediate representations. These structures, however, introduce additional generative orchestration and restrict outputs to designs covered by the representation. We investigate whether selective tool grounding can improve the fidelity--efficiency trade-off of direct widget-to-code generation. We introduce WidgetGen, a lightweight tool-grounded framework that extracts observable text and color evidence, performs high-level layout and optional chart reasoning, and directly generates executable JavaScript XML (JSX). This design reduces reliance on component-wise generation while avoiding a fixed UI schema. Across six multimodal models and 1,000 held-out widgets, WidgetGen outperforms direct prompting and the structured Widget2Code pipeline on most visual reconstruction metrics, with consistent gains in area, legibility, and style. Finally, reconstruction-derived image-code pairs improve six Qwen-family open-weight models across every reported metric through supervised fine-tuning. These results establish WidgetGen as a strong lightweight baseline and show that selective evidence grounding offers an effective alternative to extensive representation constraints.
Houston H. Zhang, Tao Zhang, Li Gu +5
McMaster University · University of Toronto · Concordia University
A key challenge for multimodal large language models (MLLMs) is moving beyond visual recognition to constraint-aware cross-modal reasoning. This involves combining visual cues with information from other modalities to understand elements' relationships under domain-specific rules. This challenge is acutely evident in industrial design-to-code (D2C), which converts user interface (UI) designs into code and requires MLLMs to connect design images with disorganized layer metadata, infer component and layout implementation requirements, and realize them in code under target-library constraints. However, these capabilities remain insufficiently evaluated in realistic industrial settings. To fill this gap, we present TaoD2C-Bench, a benchmark for evaluating MLLMs' ability to generate UI code that satisfies implementation requirements in industrial applications. The TaoD2C dataset consists of 2,861 production designs from 17 commercial platforms with 97,652 expert annotations across four categories: Component, Group, Alignment, and Position. These annotations distinguish required constraints from permitted implementation choices. TaoD2C-Bench defines three tasks: end-to-end UI code generation, requirement inference, and requirement realization. Evaluating eight MLLMs reveals substantial gaps in generating UI code that satisfies implementation requirements, alongside distinct performance profiles in inference and realization. We further show that MLLMs' visual reconstruction ability does not necessarily imply an ability to generate code that meets these requirements. We release TaoD2C to support research on industrial UI code generation.
Chengwei Shi, Yunnong Chen, Tingting Zhou +5
Zhejiang University · Taobao & Tmall Group of Alibaba