I built a Stable Diffusion playground in 200 lines and zero API keys. Here's how.
The first time I generated an AI image, I expected the worst. A signup page. Email verification. A "free trial" with a credit card on file. A Python SDK that wouldn't install. CUDA. A Hugging Face account. None of that happened. I typed a URL into my browser, pressed Enter, and waited five seconds. An image of an astronaut riding a horse on Mars appeared. I had not given anyone an email address. I had not installed anything. That's the API I built Day 34 of TechFromZero around: a free, zero-auth gateway called Pollinations.ai that hosts Stable Diffusion, FLUX, and a handful of other models behind a beautifully boring URL pattern. If you've been putting off learning generative AI because the setup looked like Day 1 of a Computer Science PhD, this is your skip-the-cutscene button. https://image.pollinations.ai/prompt/an+astronaut+cat?model=flux Hit that URL. You get an image. That is the entire integration. There is no JSON to parse. There is no SDK to install. There is no token to manage. The image flows from Pollinations' CDN straight into your browser's tag, and your browser doesn't know or care that an AI generated it. As far as it's concerned, it loaded a picture. Compared to the way the same task usually feels β npm install some-sdk; set ANTHROPIC_API_KEY; add billing; wait for the cold start β this is approximately 100% less ceremony. A single-page React app. You type a prompt, click Generate, and an image appears. The app remembers your last 50 generations in localStorage (metadata only β the images live on Pollinations' CDN), lets you favorite the ones you like, lock the seed for reproducible variations, and download any image as a PNG. I deliberately kept the whole thing one React component (~200 lines). Splitting it across five files and a Redux store would have added zero clarity for the reader and a lot of noise. Tech: Vite + React 19 + TypeScript + localStorage. Backend: none. API keys: zero. Vercel deploy: static SPA, ~10 seconds. πΈ Try it: stable-diffusion-from-zero.vercel.app github.com/dev48v/stable-diffusion-from-zero Pollinations supports a fistful of query params. Four of them are the ones a beginner cares about: model Pick the generator. The defaults you'll actually want: flux β fast, photorealistic, great default. flux-anime β illustration / stylised art. sdxl β Stable Diffusion XL, the classic. Strong on composition. sd3 β Stable Diffusion 3. Specifically good at rendering legible text inside images. Yes, the AI can write the word "BAKERY" on a shop sign now. dalle3 β OpenAI's DALLΒ·E 3 routed through Pollinations. Surreal, concept-art-friendly. seed Same prompt + same seed = same image, byte for byte. This is the most important parameter beginners ignore. Why? Because once you find a composition you like, you want to iterate β slightly different lighting, slightly different angle, but the same person. Lock the seed, change the prompt by one word at a time, and you can see what a single word does to the model's mental picture. In the playground, every generation rolls a new random seed automatically. If you find one you like, copy the number, paste it back into the seed input, and lock it for the next try. width + height Pollinations accepts almost any pixel size, but the model was trained on 1024Γ1024-ish inputs, so it's best at square (1024Γ1024) and gentle aspect ratios (768Γ1152 portrait, 1152Γ768 landscape). Push past 2048 in either direction and you'll start to see weird artifacts β extra fingers, fractal hair, that AI-image uncanny-valley vibe. enhance Easily my favorite. With enhance=true, Pollinations runs your prompt through a small LLM first, expanding it into a more descriptive version before handing it to the image model. So when you type "astronaut cat", the LLM rewrites that to something like: "A highly detailed astronaut cat floating in zero gravity, photorealistic, cinematic lighting, 4k resolution, intricate space suit details, distant Earth in the background" β¦and then the image model renders the expanded version. Your three-word prompt looks like it was written by someone who's been making Midjourney art for two years. Generated images aren't free in the legal sense. Pollinations' terms permit personal use; many model licences (FLUX in particular) restrict commercial use. If you're shipping a product, read the licence of the specific model you're using before you sell anything you generated. The seed parameter is reproducibility, not randomness. I used to think seed=42 was "the 42nd image". It's not. It's the random-number-generator's starting state. Different prompts with seed=42 produce wildly different images. The seed only "matches" when the prompt is also identical. Aspect ratio affects content. Ask for "a portrait of a librarian" at 1024Γ1024 and you'll get the librarian centered with bookshelves around them. Ask for the same thing at 1152Γ768 and you'll get a wider shot β the librarian plus a reading nook. The model uses the canvas shape as a hint. enhance makes lazy prompts good. Three words become twenty. The output looks 5Γ better. For 95% of users this is the right default, which is why my playground turns it on automatically. A few good next steps if you want to keep going: Inpainting β Pollinations supports a mask= parameter for editing parts of an existing image. Add a brush tool. Image-to-image β pass an existing image URL as a starting point. Useful for stylistic transfer. Batch generation β fire off a 4Γ4 grid of variations on the same prompt with different seeds. Pollinations is happy to serve in parallel. Self-host β Pollinations is open source. You can run the inference stack yourself on a GPU and avoid even the implicit dependency on someone else's free infrastructure. This is Day 34 of TechFromZero β one new technology every day, built from scratch with detailed commits. Day 35 picks up the AI thread with voice AI (Whisper + Gemini + ElevenLabs). If you're learning AI from a beginner background and want a curriculum that's actually fun, follow along at dev48v.infy.uk/techfromzero. Each day stands alone β start anywhere. Generated AI images used to require a CS degree, a GPU, and a credit card. Now they require a browser tab. The barrier to creating with AI is gone. The only barrier left is curiosity. Try a weird prompt. See what happens.
