ComUICoder: Component-based Reusable UI Code Generation for Complex Websites via Semantic Segmentation and Element-wise Feedback

📅 2026-02-22
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Existing UI code generation methods struggle with semantic fragmentation, component redundancy, and cross-page inconsistency in complex, long-page scenarios. This work proposes a component-based generation framework that innovatively integrates semantic-aware chunking, vision-driven graph-structured component merging, and a priority-aware element-level feedback mechanism, all fine-tuned on a multimodal large language model. Additionally, the authors introduce ComUIBench, the first multi-page, complex web UI benchmark annotated with component-level labels. Experimental results demonstrate that the proposed approach significantly improves the quality and reusability of generated code while effectively mitigating redundancy and inconsistency issues.

Technology Category

Application Category

📝 Abstract
Multimodal Large Language Models (MLLMs) have demonstrated strong performance on the UI-to-code task, which aims to generate UI code from design mock-ups. However, when applied to long and complex websites, they often struggle with fragmented segmentation, redundant code generation for repetitive components, and frequent UI inconsistencies. To systematically investigate and address these challenges, we introduce ComUIBench, a new multi-page complex webpage benchmark with component annotations, designed to evaluate MLLMs' ability to generate reusable UI code in realistic website scenarios. Building upon this benchmark, we propose ComUICoder, a component-based UI code generation framework that emphasizes semantic-aware segmentation, code reuse, and fine-grained refinement. Specifically, ComUICoder incorporates (1) Hybrid Semantic-aware Block Segmentation for accurate UI semantic coherent block detection, (2) Visual-aware Graph-based Block Merge to consolidate structurally similar components within and across webpages for reusable implementation, and (3) Priority-based Element-wise Feedback to refine generated code and reduce element-level inconsistencies. Extensive experiments demonstrate that ComUICoder significantly improves overall generation quality and code reusability on complex multipage websites. Our datasets and code are publicly available at https://github.com/WebPAI/ComUICoder.
Problem

Research questions and friction points this paper is trying to address.

UI-to-code
code reusability
semantic segmentation
UI inconsistency
complex websites
Innovation

Methods, ideas, or system contributions that make the work stand out.

component-based code generation
semantic segmentation
code reusability
element-wise feedback
multimodal LLMs
🔎 Similar Papers
No similar papers found.