How to generate images for your prototypes --- placeholders first, then a third-party text-to-image API
A prototype usually needs one of these: a hero image, an icon set, a texture or a game sprite. Try a placeholder before using an image model or API.
Placeholders first#
Most of the time you do not need a real model at all. A prototype is about the build, not the art, so try picsum.photos for stock photos, DiceBear for avatars, or an inline SVG the agent writes for you. These need no key and no billing, and they keep a static site static. Swap in real imagery only once the idea is proven.
When you need a real model#
The course key no longer generates images: the course’s image credit has run out. Use a third-party host instead. Two things matter: that you can call it from code, and that the free tier is enough to prototype on.
Good places to look, roughly cheapest first:
- Pollinations generates an image straight from a URL, with no key at all. The fastest way to get a generated picture into a page, and fine for quick experiments.
- Hugging Face Inference gives a free tier over thousands of open models (SDXL, FLUX-schnell and more) behind one token and a simple REST call. The first stop for a real model without a credit card.
- fal.ai and Replicate are pay-per-image hosts with trial credit and clean APIs. Reach for these when you want current models (FLUX, Ideogram) and will add a card.
- Google AI Studio has a free tier that includes Imagen, handy if you already have a Google account.
Whichever you pick, the process is the same. Sign up, mint an API token, and keep it out of your source: an untracked environment variable, never a committed file (the LLM access page covers the habit). A third-party key is yours rather than the course’s, so its spend is yours too. Stay on free tiers while you prototype, and check the per-image price before you loop over a hundred prompts.
Then call the endpoint from a small script or a build step. If the model only runs server-side, remember the static half has no server: generate the image at build time and commit the output, or leave the live call for the full-stack half.