abi / abi/screenshot-to-code

Optional no-key stock-photo fallback when image generation is disabled

Open
#592 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
78.7k
Forks
9.6k
PR merge metrics
No merged PRs in 30d

Description

When image generation is disabled, the current image policy falls back to placeholder URLs:

https://github.com/abi/screenshot-to-code/blob/7fb70a7f04e0b83c08ec15e2c83aa35986c82115/backend/prompts/policies.py#L15-L18

That is a reasonable safe default, but there is a useful middle lane between generated images and `placehold.co`: real stock photos for generic website assets such as hero images, team photos, restaurant/menu photos, travel/gallery images, blog headers, etc.

Possible feature shape:

- keep today's placeholder behavior as the default when the user wants a wireframe;
- add an optional "real stock photos" mode for missing non-user-specific images;
- when that mode is on, resolve semantic image prompts to a real image URL before returning code.

One no-key implementation path is `tteg`: https://tteg.kushalsm.com

It provides a CLI and an HTTP API over Unsplash without requiring each user to create an Unsplash developer app/key. Example:

```bash
uv tool install tteg
tteg save "coffee shop interior hero" ./public/hero --orientation landscape
```

Or via HTTP:

```bash
curl "https://tteg-api-53227342417.asia-south1.run.app/search?q=coffee+shop+interior+hero&n=1&orientation=landscape"
```

I am the maintainer of `tteg`, so treat this as a concrete implementation suggestion rather than a request to change defaults. The user-facing problem is broader: screenshot-to-code output can be structurally correct but visually fake when image generation is off. A stock-photo fallback would make that mode more useful for landing pages and demos without requiring image-generation spend.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.