ComUICoder:基于语义分割和元素反馈的组件式可重用UI代码生成用于复杂网站
ComUICoder: Component-based Reusable UI Code Generation for Complex Websites via Semantic Segmentation and Element-wise Feedback
AI总结:
ComUICoder通过语义分割和元素反馈技术,提升复杂网站中可重用UI代码的生成质量与重用性。
摘要:
多模态大语言模型(MLLMs)在UI到代码任务中表现出强大的性能,该任务旨在从设计草图生成UI代码。然而,当应用于长且复杂的网站时,它们常常在碎片化分割、重复组件的冗余代码生成以及频繁的UI不一致方面遇到困难。为了系统地研究和解决这些挑战,我们引入了ComUIBench,一个具有组件标注的新多页复杂网页基准,旨在评估MLLMs在现实网站场景中生成可重用UI代码的能力。在此基准的基础上,我们提出了ComUICoder,一个基于组件的UI代码生成框架,强调语义感知的分割、代码重用和细粒度的细化。具体来说,ComUICoder包括(1)混合语义感知的块分割,用于准确检测UI语义连贯的块;(2)视觉感知的基于图的块合并,用于在网页内和跨网页中合并结构相似的组件以实现可重用的实现;(3)基于优先级的元素反馈,用于细化生成的代码并减少元素层面的不一致。广泛的实验表明,ComUICoder在复杂的多页网站上显著提高了整体生成质量和代码重用性。我们的数据集和代码已公开在https://github.com/WebPAI/ComUICoder。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。