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.


翻译:多模态大语言模型(MLLMs)在UI到代码任务(即从设计稿生成UI代码)上已展现出强大的性能。然而,当应用于长而复杂的网站时,它们常常面临分割碎片化、为重复组件生成冗余代码以及频繁出现UI不一致等问题。为了系统性地研究并应对这些挑战,我们引入了ComUIBench,这是一个带有组件标注的新多页面复杂网页基准,旨在评估MLLMs在真实网站场景中生成可复用UI代码的能力。基于此基准,我们提出了ComUICoder,一个强调语义感知分割、代码复用和细粒度优化的组件化UI代码生成框架。具体而言,ComUICoder包含:(1)混合语义感知块分割,用于精确检测UI语义连贯的区块;(2)基于视觉感知的图块合并,用于整合网页内及跨网页的结构相似组件以实现可复用实现;(3)基于优先级的元素级反馈,用于优化生成代码并减少元素级不一致。大量实验表明,ComUICoder在复杂多页面网站上显著提升了整体生成质量和代码可复用性。我们的数据集和代码已在 https://github.com/WebPAI/ComUICoder 公开。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
探索长视频生成的最新趋势
专知会员服务
23+阅读 · 2024年12月30日
西工大最新《多模态大型语言模型》全面综述
专知会员服务
70+阅读 · 2024年8月6日
《大型语言模型代码生成》综述
专知会员服务
68+阅读 · 2024年6月4日
《多模态大型语言模型进化》最新综述
专知会员服务
105+阅读 · 2024年2月23日
Meta-Transformer:多模态学习的统一框架
专知会员服务
59+阅读 · 2023年7月21日
从 Encoder 到 Decoder 实现 Seq2Seq 模型
AI研习社
10+阅读 · 2018年2月10日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员