Downloads · 30 days
5
21% of all-time downloads
zhongweixie/ui2app-qwen35-9b-best
ui2app-qwen35-9b-best is a machine learning model from zhongweixie. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Fine-tuned Qwen3.5-9B for UI screenshot to React code generation.
Downloads · 30 days
5
21% of all-time downloads
All-time downloads
24
Public
Parameters
9.4B
18.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors18.9 GB · 100%
From the Hugging Face model README
Fine-tuned Qwen3.5-9B for UI screenshot to React code generation.
| Metric | Score | Description |
|---|---|---|
| exec@1 | 11.1% | 5/45 apps build & run successfully on first generation |
| exec@3 | 20.0% 🏆 | 9/45 apps succeed after 3 self-debug rounds |
| VFS | 8.8% | Visual Feature Similarity score |
Highest scoring checkpoint in UI2APP ablation study.
from transformers import AutoModelForCausalLM, AutoProcessor
import torch
# Load model
model = AutoModelForCausalLM.from_pretrained(
"zhongweixie/ui2app-qwen35-9b-best",
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True
)
processor = AutoProcessor.from_pretrained(
"zhongweixie/ui2app-qwen35-9b-best",
trust_remote_code=True
)
# Load screenshot
from PIL import Image
screenshot = Image.open("screenshot.png")
# Generate code
messages = [
{
"role": "user",
"content": [
{"type": "image", "image": screenshot},
{"type": "text", "text": "Generate React code for this UI"}
]
}
]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(text=[text], images=[screenshot], return_tensors="pt").to(model.device)
# Generate
outputs = model.generate(**inputs, max_new_tokens=4096)
generated_code = processor.batch_decode(outputs, skip_special_tokens=True)[0]
print(generated_code)
This model is the "both" variant from the UI2APP ablation study, which combined:
Successfully generated working code for:
07_solid-nextjs: Modern landing page08_crypto-exchange: Trading dashboard17_antd-dashboard: Admin interface32_shadcnspace: Component showcase37_magicui-portfolio: Portfolio site@article{ui2app2024,
title={UI2APP: Screenshot to Code Generation},
author={4open.science},
year={2024}
}
Apache 2.0