Search papers, labs, and topics across Lattice.
This paper introduces WidgetGen, a lightweight tool-grounded framework that enhances the fidelity-efficiency trade-off in widget-to-code generation by extracting observable text and color evidence, performing high-level layout reasoning, and generating executable JSX. The framework outperforms both direct prompting and the structured Widget2Code pipeline across six multimodal models and 1,000 held-out widgets, achieving significant improvements in visual reconstruction metrics such as area, legibility, and style. Additionally, the use of reconstruction-derived image-code pairs for supervised fine-tuning boosts performance across all reported metrics for Qwen-family open-weight models, establishing WidgetGen as a competitive baseline in the field.
WidgetGen achieves superior visual reconstruction performance without the constraints of fixed UI schemas, redefining the widget-to-code generation landscape.
Existing screenshot-to-code systems face a trade-off between flexibility and controllability. Direct multimodal generation can hallucinate visible details, whereas structured pipelines reduce such errors through component-wise decomposition, predefined templates, and customized intermediate representations. These structures, however, introduce additional generative orchestration and restrict outputs to designs covered by the representation. We investigate whether selective tool grounding can improve the fidelity--efficiency trade-off of direct widget-to-code generation. We introduce \textbf{WidgetGen}, a lightweight tool-grounded framework that extracts observable text and color evidence, performs high-level layout and optional chart reasoning, and directly generates executable JavaScript XML (\emph{JSX}). This design reduces reliance on component-wise generation while avoiding a fixed UI schema. Across six multimodal models and \(1{,}000\) held-out widgets, WidgetGen outperforms direct prompting and the structured Widget2Code pipeline on most visual reconstruction metrics, with consistent gains in area, legibility, and style. Finally, reconstruction-derived image-code pairs improve six Qwen-family open-weight models across every reported metric through supervised fine-tuning. These results establish WidgetGen as a strong lightweight baseline and show that selective evidence grounding offers an effective alternative to extensive representation constraints.