Hackathon project Screenshot to Tokens turns any screenshot into a full design system via SAM 3.1

usamawahabkhan · x · 2026-11-05

Open-source hackathon project "Screenshot to Tokens" (Meta Global AI Developer Hackathon) generates a full three-tier design system (primitive → semantic → component) from pixels for live apps with no design tokens.

Pipeline: Playwright captures a full-page screenshot plus computed styles; SAM 3.1 segments buttons, inputs, and icons from pixels even where markup describes nothing; Muse Spark names tokens with a reason each; a human reviews in an HTML report; hardcoded values in the real source become var(--token, original) so originals stay as fallbacks; four checks (zero-px fallback changes, invisible merged colors, reviewable diff, WCAG AA contrast) must pass before an automated PR opens. Only two steps use Meta models; the rest is deterministic code.

Original post →

More from coding & agent

coding & agent channel →