← all repositories
emilwallner/Screenshot-to-code

An AI that turns design mockups into HTML—mostly Bootstrap

This project explores whether a neural network can look at a website mockup and generate the underlying HTML and CSS automatically.

Screenshot-to-code
Not currently ranked — collecting fresh signals.
star history

What it does The repository trains an encoder-decoder neural network to convert images of web designs into static HTML markup. It includes three progressively complex iterations—starting from a minimal “Hello World” model up to a Bootstrap-specific version that translates 16 domain-specific tokens into HTML and CSS. The raw HTML variant exists but remains unproven outside its training set.

The interesting bit Instead of generating raw HTML from arbitrary screenshots, the only version that actually generalizes to new mockups works by predicting a tiny vocabulary of Bootstrap tokens, then compiling those into markup. That constraint—16 tokens instead of open-ended tags—is what makes the model tractable on modest GPU hardware.

Key highlights

  • Only the Bootstrap version generalizes to unseen designs; the raw HTML version does not yet work reliably on new inputs.
  • Claims 97% accuracy on the Bootstrap token-prediction task using a GRU-based model.
  • Built on top of Tony Beltramelli’s pix2code architecture and trained on a small, homogeneous dataset.
  • Pre-trained weights and FloydHub workspaces are available for the Bootstrap model.
  • The project is explicitly structured as a learning tutorial with three educational iterations.

Caveats

  • The README admits the dataset is small and homogeneous, so behavior on complex, real-world layouts is unclear.
  • The raw HTML version requires “a significant amount of GPUs” to train and is still unproven.
  • Only the Bootstrap variant with its constrained token set can be trained on a few GPUs.

Verdict Worth a look if you are studying image-to-sequence models or want a hands-on tutorial for pix2code-style architectures. Skip it if you need a production-ready design-to-code pipeline; the README itself warns that complex layouts are untested.

Frequently asked

What is emilwallner/Screenshot-to-code?
This project explores whether a neural network can look at a website mockup and generate the underlying HTML and CSS automatically.
Is Screenshot-to-code open source?
Yes — emilwallner/Screenshot-to-code is an open-source project tracked on heatdrop.
What language is Screenshot-to-code written in?
emilwallner/Screenshot-to-code is primarily written in HTML.
How popular is Screenshot-to-code?
emilwallner/Screenshot-to-code has 16.5k stars on GitHub.
Where can I find Screenshot-to-code?
emilwallner/Screenshot-to-code is on GitHub at https://github.com/emilwallner/Screenshot-to-code.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.