Skip to content
Proyek

s-smits/ui-screenshot-to-prompt

Lihat di GitHub

Tentang

ui-screenshot-to-prompt is an AI-powered tool that analyzes UI images to generate detailed prompts for AI coders. It uses computer vision and natural language processing to break down UI components, analyze design patterns, and create comprehensive descriptions for reproducing the design. Very useful for Bolt.new, v0 and other upcoming SaaS

Pembelajaran dan pendidikan

Cara angka ini diukur

Yang dapat Anda lakukan

  • ui_screenshot_to_prompt/config.py – detection mode defaults, prompt templates, component thresholds.
  • .env – choose which LLM vendors to call; OpenAI Vision is required, Anthropic/OpenRouter is optional but improves the final prompt.

Pertumbuhan bintang terukur

dalam 24 jam
0
dalam 7 hari
+1
dalam 15 hari
+1
dalam 1 bulan
Mengumpulkan riwayat

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

ui-screenshot-to-prompt

Turn a UI screenshot into an implementation brief. The pipeline detects layout regions, runs OCR where it matters, and assembles a prompt you can hand to an AI coding copilot.

Demo

https://github.com/user-attachments/assets/79c2722e-942d-4f0c-84bd-11066b63f4c5

What it does

  • Basic mode: deterministic grid slicing for fast spatial summaries.
  • Advanced mode: EasyOCR + OpenCV to pull out likely UI components (still experimental; expect false positives).
  • Aggregated analysis: OpenAI vision models describe each region, then a Claude/OpenRouter pass crafts the final build instructions.
  • Gradio front-end so designers can drag-and-drop without touching the CLI.

Getting started

git clone https://github.com/s-smits/ui-screenshot-to-prompt.git
cd ui-screenshot-to-prompt
uv venv .venv
uv sync
cp .env.example .env  # fill in OPENAI / optional ANTHROPIC or OPENROUTER keys

Run locally:

uv run python -m ui_screenshot_to_prompt.main

Configuration highlights

  • ui_screenshot_to_prompt/config.py – detection mode defaults, prompt templates, component thresholds.
  • .env – choose which LLM vendors to call; OpenAI Vision is required, Anthropic/OpenRouter is optional but improves the final prompt.

Notes

  • The project is CPU-friendly; EasyOCR will download weights on the first run.
  • Advanced detection is under active tuning—log output will tell you what it caught.
  • Pytest suites live under tests/; run them with uv run pytest if you touch the core pipeline.

Contributing

Issues and PRs are welcome. Aim for pragmatic fixes and keep prompts reversible for future tuning.

License

MIT

Jelajahi proyek terkait

Memuat…