Skip to content

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

Description

@kiluazen

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:

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

Or via HTTP:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions