Research project · arXiv:2507.22827

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

A modular multi-agent framework that separates visual grounding, structural planning, and code generation to produce faithful and interpretable front-end implementations from UI screenshots and design sketches.

Yilei Jiang* Yaozhi Zheng* Yuxuan Wan* Jiaming Han Qunzhong Wang Michael R. Lyu Xiangyu Yue

CUHK MMLab & ARISE Lab

* Equal contribution · Corresponding author

ScreenCoder overview showing screenshots and design sketches transformed through grounding, planning, generation, and placeholder mapping into webpages and code
ScreenCoder decomposes UI-to-code generation into interpretable, specialized stages.

Motivation

Why UI-to-Code Needs Structure

End-to-end multimodal models must perceive fine visual details, reason about nested layouts, and synthesize valid front-end code at once. ScreenCoder begins from two recurring failure modes observed in this monolithic setting.

01

Perception Errors

Small elements are omitted, text or colors are distorted, and interface components are assigned the wrong semantic roles.

02

Planning Errors

Correctly perceived elements are still misplaced or assembled into flat structures that do not reflect a coherent DOM hierarchy.

Method

A Modular Path from Pixels to Code

ScreenCoder assigns perception, structural reasoning, and synthesis to specialized stages, then restores visual assets through explicit placeholder matching.

  1. 1

    Grounding Agent

    Locates and labels major UI regions such as headers, navigation, sidebars, and content, providing a semantic spatial map.

  2. 2

    Planning Agent

    Converts grounded regions into a hierarchical, DOM-like layout tree using front-end engineering priors.

  3. 3

    Generation Agent

    Generates executable HTML and CSS from the layout tree, semantic context, and optional design instructions.

  4. 4

    Placeholder Mapping

    Matches detected visual assets to generated placeholders and restores image patches with optimal assignment.

Four-stage ScreenCoder pipeline from an input UI through grounding, planning, generation, and placeholder mapping to executable output
A web-native summary of the modular ScreenCoder pipeline.

Interactive evidence

From Research Pipeline to Working Demo

The public demo exposes the full screenshot-to-code workflow and supports examples ranging from familiar websites to rough design drafts. This project page stays static and links to the hosted system.

Stylized preview of the ScreenCoder research demo with input screenshot, structured plan, and generated code

Public Hugging Face Space

Inspect the end-to-end workflow on real UI screenshots.

Upload an interface image, review the generated layout and webpage, then download the resulting code package.

Open the Demo

Experiments

Evidence across ScreenBench and Design2Code

The paper evaluates block, text, position, and color consistency alongside CLIP similarity. Values below are reproduced from arXiv v2 tables; the full paper remains the authoritative source.

Selected main results

See full Table 1
Selected automatic evaluation results from ScreenCoder arXiv v2.
Model ScreenBench Design2Code
BlockTextPositionColorCLIP BlockTextPositionColorCLIP
GPT-4o 0.7450.8350.7250.7020.775 0.8450.9620.9030.8810.917
ScreenCoder (Agentic) 0.7680.8570.7550.7340.812 0.8650.9750.9250.9080.922
ScreenCoder (Finetuned) 0.7580.8410.7420.7180.791 0.8490.9680.9130.8860.915

Source note: arXiv v2 prose refers to 0.755 as a Block score, while Table 1 places 0.768 under Block and 0.755 under Position. This page preserves the table layout and does not promote either value as a standalone headline claim.

Dual-stage post-training

Qwen2.5-VL → SFT → RL

Effect of supervised fine-tuning and reinforcement learning.
Training stage ScreenBench Design2Code
BlockTextPositionColorCLIP BlockTextPositionColorCLIP
Base model 0.7230.8280.6130.6320.762 0.8220.9510.8150.8310.893
+ SFT 0.7410.8350.7050.6810.784 0.8420.9630.8900.8700.908
+ RL (Final) 0.7580.8410.7420.7180.791 0.8490.9680.9130.8860.915
65%ScreenCoder preferred over GPT-4o in pairwise visual fidelity
2.2×Faster average completion in the workflow usefulness study
4.6/5Average UI similarity score with ScreenCoder-assisted workflows

Data engine

From a Modular System to Model Post-Training

Beyond inference, ScreenCoder is used to curate clean image-code pairs and improve an open-source multimodal model through supervised fine-tuning and reinforcement learning.

50Kinitially collected webpages
10Kcurated Screen-10K pairs
9Kpairs for supervised fine-tuning
1Kpairs for reinforcement learning

ScreenBench

A benchmark of 1,000 contemporary webpage screenshot and HTML pairs for evaluating modern UI-to-code systems.

View the public dataset

Citation

Reference the Paper

@article{jiang2025screencoder,
  title   = {ScreenCoder: Advancing Visual-to-Code Generation for Front-End Automation via Modular Multimodal Agents},
  author  = {Jiang, Yilei and Zheng, Yaozhi and Wan, Yuxuan and Han, Jiaming and Wang, Qunzhong and Lyu, Michael R. and Yue, Xiangyu},
  journal = {arXiv preprint arXiv:2507.22827},
  year    = {2025}
}

ScreenCoder builds on open research including UIED, DCGen, and Design2Code. See the paper and repository for complete references and acknowledgements.