Giting.
낮의 Giting

· AI 에이전트 · eval 운영 · FastAPI · 오픈코어

screenshot-to-code 대표 이미지 FastAPI + WebSocket 백엔드 · React/Vite 프론트
분석 리포트실측 정보적용점원문 README

구조와 기능

스크린샷·목업·화면 녹화를 HTML+Tailwind, React, Vue 등의 코드로 변환한다. 2023년 11월 GPT-4 Vision 데모로 시작해 GitHub 최상위권 스타를 받은 프로젝트지만, 현재 코드베이스는 그 시절과 다르다. 생성 경로는 프롬프트 한 방이 아니라 AgentEngine의 툴콜링 루프다. 도구 9종(create_file, edit_file, 이미지 생성·편집·배경 제거, 실제 로고를 추출해 재사용하는 extract_assets, 자가 시각 검증 screenshot_preview 등)에 최대 20툴턴 가드, 변형 4개를 서로 다른 모델로 병렬 생성해 비교 선택한다.

OpenAI·Anthropic·Gemini의 툴 결과 이어붙이기 차이를 ProviderSession 계약으로 격리한 프로바이더 추상화, 스트리밍 중 부분 툴 인자를 파싱해 실행 전에 프론트로 미리 흘리는 라이브 프리뷰까지, 에이전트 백엔드 설계의 교과서적 사례가 많다. 공개 리포는 셀프호스트 판이고 호스팅 SaaS는 별도 비공개 코드베이스로 연결되는 오픈코어 구조다.

하이라이트

평가가 모델 선택을 운전한다. eval set(스크린샷·텍스트 브리프)과 작업 기간에 고정되는 eval 세션, 이미지×모델 매트릭스, 사람의 0~4점 채점이 갖춰져 있고, 최근 커밋 이력에 "채점된 평가로 기본 모델 믹스 갱신"이 반복적으로 나타난다. 모델 교체 결정을 감이 아니라 채점 데이터로 하는 운영 루프가 실제로 돌았다는 뜻이다.

비용 거버넌스가 코드에 박혀 있다. 변형·평가 런당 3달러 하드 상한(초과 시 중단), 모델별 단가 테이블, 출력 없이 끝난 에이전트 런의 실패 처리. 에이전트 루프를 제품에 넣을 때 필요한 가드레일의 실물이다.

주의점

실측이 배지와 다르게 말한다. README에 CI 배지가 있지만 분석 시점 리포에는 워크플로우 디렉토리가 없고(테스트 스위트 자체는 존재), GitHub 릴리스 태그도 0개다. 마지막 커밋은 2026년 7월 22일로 이 분석 시점 기준 약 6주 전이다. MIT 코어와 비공개 SaaS의 오픈코어 경계, 그리고 데모 수준이 아닌 프로덕션 품질을 원하면 호스팅 판으로 유도되는 구조를 이해하고 접근해야 한다.

실측 정보

스택
FastAPI + WebSocket 백엔드 · React/Vite 프론트
규모
전체 315 파일 · 텍스트 5.1만 줄 (Py 21,517 · TSX 14,656)
테스트 / CI
테스트 매칭 파일 51개 · 워크플로우 0개 (README CI 배지는 스테일)
이력
커밋 1,455회 (2023-11-14 ~ 2026-07-22) · 90일 126회
기여
저자 32명 · 원격 태그 0개 (GitHub 릴리스 미사용)
라이선스
MIT · 호스팅 SaaS는 별도 비공개 코드베이스(오픈코어)

적용점

  • P0 · 비용 낮음런당 하드 지출 상한($3)과 산출물 없는 런 실패 처리. 에이전트 루프의 비용 폭주와 조용한 빈손 종료를 동시에 막는다.
  • P1 · 비용 중간eval set → 세션(이미지×모델 매트릭스) → 사람 채점 → 기본 모델 믹스 갱신의 운영 루프. 평가가 모델 선택을 운전하게 한다.
  • P1 · 비용 중간에이전트가 자기 산출물을 headless 브라우저로 렌더해 시각 검증하는 자가 확인 도구(screenshot_preview). 도구 부재 시 조용히 비활성화하는 graceful degradation 포함.
  • P2 · 비용 낮음CLAUDE.md를 AGENTS.md 심링크로 두는 단일 가이드 운용. 복수 CLI 병행 리포의 문서 이중화를 없앤다.
◈ 참고용

3년 된 바이럴 데모가 죽지 않고 에이전트 제품으로 재건축된 드문 사례. 도입할 라이브러리가 아니라 에이전트 루프, 평가 체계, 비용 가드의 설계를 배우러 가는 리포다. 마지막 커밋이 6주 전이고 CI 워크플로우가 현재 없다는 점은 실측이 배지와 다르게 말하는 부분이다.

원문 README

아래는 abi/screenshot-to-code 저장소의 README 원문입니다(GitHub 렌더, 수집 시점 기준). 저작권은 원 프로젝트에 있으며 원 저장소의 라이선스를 따릅니다. GitHub에서 보기

README 전문 펼치기

screenshot-to-code

Convert screenshots, mockups, Figma designs, and screen recordings into clean, functional code using AI. The easiest way to try this is using the official, hosted product at screenshottocode.com →

youtube.mp4

Supported stacks:

  • HTML + Tailwind
  • HTML + CSS
  • React + Tailwind
  • Vue + Tailwind
  • Bootstrap
  • Ionic + Tailwind

Default AI models:

  • Gemini 3 Flash Preview and Gemini 3.1 Pro Preview - the best models
  • GPT-5.5 and GPT-5.4 Mini
  • Claude Opus 4.6, Claude Opus 4.8
  • z-image-turbo (using Replicate) for image generation

See the Examples section below for more demos.

Screenshot to Code also supports taking a screen recording of a website in action and turning that into a functional prototype.

google in app quick 3

🛠 Getting Started

Choose the path that fits what you want to do:

  • Run locally: best if you want to customize, self-host, or contribute.
  • Use the hosted app: the fastest way to try Screenshot to Code with no local setup. Open the hosted app →

Running locally requires API keys and a backend/frontend setup. The app has a React/Vite frontend and a FastAPI backend.

API keys

You need at least one model provider key (OpenAI, Anthropic, or Gemini). Gemini and Replicate are strongly recommended for the best quality of screenshot-to-code accuracy — Gemini powers asset extraction (reusing the real logos/images from your screenshot) and Replicate powers image generation, background removal, and image editing. Adding all four keys gives the best results and lets you compare multiple models per generation.

Key Required? What it unlocks
OPENAI_API_KEY One of these three GPT code-gen variants (GPT-5.5, GPT-5.4 Mini)
ANTHROPIC_API_KEY One of these three Claude code-gen variants (Opus 5, Opus 4.8, Fable 5, Sonnet 4.6)
GEMINI_API_KEY One of these three — strongly recommended Gemini code-gen variants (3 Flash, 3.1 Pro); extracts real assets from the screenshot; required for video mode
REPLICATE_API_KEY Strongly recommended Image editing, background removal, and Replicate-backed image generation — without it, edit_images and remove_backgrounds are unavailable

With more keys, the app automatically picks a stronger mix of models per variant; with a single key it uses that provider's models only.

If you'd like to run the app with Ollama open-source models (not recommended due to poor-quality results), follow this comment.

Run the backend (I use Poetry for package management; run pip install --upgrade poetry if you don't have it):

cd backend
echo "OPENAI_API_KEY=sk-your-key" > .env
echo "ANTHROPIC_API_KEY=your-key" >> .env
echo "GEMINI_API_KEY=your-key" >> .env
echo "REPLICATE_API_KEY=r8_your-key" >> .env
poetry install
# Install the Chromium browser used by the screenshot preview tool.
# On Linux, use `poetry run playwright install --with-deps chromium` to also
# install the required system libraries (needs sudo/apt).
poetry run playwright install chromium
poetry env activate
# run the printed command, e.g. source /path/to/venv/bin/activate
poetry run uvicorn main:app --reload --port 7001

You can also set up OpenAI, Anthropic, and Gemini keys using the settings dialog in the frontend (click the gear icon after loading the app). Replicate must be configured in backend/.env as REPLICATE_API_KEY. The Settings dialog also shows whether screenshot preview is available on your backend.

Screenshot preview (optional) lets the agent render its own generated page in a headless browser and visually check its work. It's enabled automatically once Chromium is installed (the playwright install chromium step above, or automatically in the Docker image). If Chromium is missing, the app just skips the tool — the Settings dialog shows whether it's available.

Run the frontend:

cd frontend
pnpm install
pnpm dev

Open http://localhost:5173 to use the app.

If you prefer to run the backend on a different port, update VITE_WS_BACKEND_URL in frontend/.env.local.

Docker

If you have Docker installed, run this from the root directory:

echo "OPENAI_API_KEY=sk-your-key" > .env
docker-compose up -d --build

The app will be up and running at http://localhost:5173. Note that you can't develop the application with this setup, as file changes won't trigger a rebuild.

🙋‍♂️ FAQs

  • I'm running into an error when setting up the backend. How can I fix it? Try this. If that still doesn't work, open an issue.
  • How do I get an OpenAI API key? See https://github.com/abi/screenshot-to-code/blob/main/Troubleshooting.md
  • How can I configure an OpenAI proxy? If you're not able to access the OpenAI API directly, for example because of country restrictions, you can try a VPN or configure the OpenAI base URL to use a proxy. Set OPENAI_BASE_URL in backend/.env or directly in the UI in the settings dialog. Make sure the URL has v1 in the path, for example: https://xxx.xxxxx.xxx/v1.
  • How can I update the backend host that my frontend connects to? Configure VITE_HTTP_BACKEND_URL and VITE_WS_BACKEND_URL in frontend/.env.local. For example, set VITE_HTTP_BACKEND_URL=http://124.10.20.1:7001.
  • Seeing UTF-8 errors when running the backend? On Windows, open the .env file with Notepad++, then go to Encoding and select UTF-8.
  • How can I provide feedback? For feedback, feature requests, and bug reports, open an issue or ping me on Twitter.

📚 Examples

NYTimes

Original Replica
Screenshot 2023-11-20 at 12 54 03 PM Screenshot 2026-06-15 at 3 06 37 PM

Instagram

instagram.mp4

Hacker News

hacker.news.mp4

의견

판정에 대한 반론, 도입 경험, 정정 제보를 환영합니다. GitHub 계정으로 참여합니다.

이것도 재봤습니다

전체 리포트 →

이번 주 실측, 메일로 받기

매주 금요일, 그 주의 리포트와 매거진을 보내드립니다. 광고 없이 실측만.