2025-07-31 · 专家 · 计算机视觉 · 机器学习 · 自然语言处理

ScreenCoder: Advancing Visual-to-Code Generation for Front-End Automation via Modular Multimodal Agents

ScreenCoder通过模块化多智能体框架,实现了从视觉UI设计到前端代码的自动化转换,提高了代码生成的准确性和可解释性。

更新于 2025-07-31。作者:Yilei Jiang、Yaozhi Zheng、Yuxuan Wan、Jiaming Han、Qunzhong Wang、Michael R. Lyu、Xiangyu Yue。

中文摘要

自动化将用户界面(UI)设计转换为前端代码具有加速软件开发和民主化设计流程的巨大潜力。尽管最近的大型语言模型(LLMs)在文本到代码生成方面取得了进展,但许多现有方法仅依赖于自然语言提示,这限制了它们在捕捉空间布局和视觉设计意图方面的有效性。相比之下,实际中的UI开发本质上是多模态的,通常从视觉草图或原型开始。为了解决这一差距,我们引入了一个模块化多智能体框架,该框架通过三个可解释的阶段进行UI到代码的生成:定位、规划和生成。定位智能体使用视觉语言模型来检测和标记UI组件,规划智能体使用前端工程先验构建层次布局,生成智能体通过自适应提示合成生成HTML/CSS代码。这种设计在鲁棒性、可解释性和保真度方面优于端到端黑盒方法。此外,我们将该框架扩展为一个可扩展的数据引擎,能够自动生成大规模图像-代码对。使用这些合成示例,我们微调和强化了一个开源的VLM,在UI理解和代码质量方面取得了显著的提升。广泛的实验表明,我们的方法在布局精度、结构连贯性和代码正确性方面达到了最先进的性能。我们的代码已在https://github.com/leigest519/ScreenCoder上公开。

英文摘要

Automating the transformation of user interface (UI) designs into front-end code holds significant promise for accelerating software development and democratizing design workflows. While recent large language models (LLMs) have demonstrated progress in text-to-code generation, many existing approaches rely solely on natural language prompts, limiting their effectiveness in capturing spatial layout and visual design intent. In contrast, UI development in practice is inherently multimodal, often starting from visual sketches or mockups. To address this gap, we introduce a modular multi-agent framework that performs UI-to-code generation in three interpretable stages: grounding, planning, and generation. The grounding agent uses a vision-language model to detect and label UI components, the planning agent constructs a hierarchical layout using front-end engineering priors, and the generation agent produces HTML/CSS code via adaptive prompt-based synthesis. This design improves robustness, interpretability, and fidelity over end-to-end black-box methods. Furthermore, we extend the framework into a scalable data engine that automatically produces large-scale image-code pairs. Using these synthetic examples, we fine-tune and reinforce an open-source VLM, yielding notable gains in UI understanding and code quality. Extensive experiments demonstrate that our approach achieves state-of-the-art performance in layout accuracy, structural coherence, and code correctness. Our code is made publicly available at https://github.com/leigest519/ScreenCoder.

解读

一句话总结

ScreenCoder通过模块化多智能体框架,实现了从视觉UI设计到前端代码的自动化转换,提高了代码生成的准确性和可解释性。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源