This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass
What I Built
Touch Grass Tales turns a short walk into an illustrated children's story.
You step outside, photograph 5 to 10 random things (a park bench, a pigeon, a weird sign, a lamp post), and an open-weight model, Gemma, turns them into a story, a rhyming poem or a comic strip. The pictures in the finished tale are your own photos. You pick the mood: funny, spooky (never gory) or mystery.
The screen is the shortest part of the experience on purpose:
- The app sends you outside first. Each walk starts with a small mission, like "Photograph something that looks like a face" or "Find something red that isn't a stop sign".
- Your phone is just the camera. The walk is the fun part, and the tale is the reward when you get back.
- The tale is easy to read. Everything is written in simple English (short sentences, easy words, no idioms, about CEFR A2).
Who it's for:
- Parents and kids who want a reason to go outside together, and a bedtime story starring the things they found.
- Beginner English learners, who get a tale they can actually read, about things they saw themselves.
- Anyone who needs an excuse to close the laptop for twenty minutes.
Demo
Live app: https://touch-grass-flutonp.onrender.com/
No API key? The app has a built-in demo (a canned walk with a park bench, a lamp post and a pigeon) and a gallery of sample tales.
How a tale gets made, step by step:
- Connect the AI once. Paste a free Google AI Studio key, or point the app at LM Studio on your own computer.
- Go for a walk with a random mission.
- Add 5 to 10 photos.
- Pick a mood and a format.
- Press Make. A live panel shows each photo being checked and what was found in it ("park bench", "pigeon"β¦), then a sneak peek shows each scene as soon as it's written. A tale takes about 2 to 4 minutes.
- Read it as a book or as slides, and publish it to your gallery if you like.
Code
Touch Grass Tales π³
Go outside, photograph 5 to 10 random things, and Gemma AI turns them into a children's story, a rhyming poem or a comic strip (funny, spooky or mystery), illustrated with your own photos. Everything is written in simple words: short sentences, no idioms, about CEFR A2, so young readers and beginner English learners can follow it.
Using the site
-
Connect the AI once. Paste a free Google AI Studio key, or run Gemma locally with LM Studio.
/setup.htmlwalks through both. - Go for a walk. The Create page gives you a random photo mission (optional).
- Add 5 to 10 photos.
- Pick a mood (Funny, Spooky, Mystery) and a format (Story, Poem, Comic).
- Press Make. Progress and time left stream live, a photo check panel shows each photo being checked and the items found in it, and a sneak peek shows each scene, verse orβ¦
How I Built It
The open-source AI core: Gemma, an open-weight model. Every word in a tale comes from Gemma. I use two Gemma 4 models, each for the job it's best at:
| Task | Model | Why |
|---|---|---|
| Look at each photo | Gemma 4 26B-A4B | Fast mixture-of-experts model; one small (384px) photo at a time |
| Plan the plot and pick a photo for each moment | Gemma 4 26B-A4B | Fast, structured JSON planning |
| Write each scene or verse, then proofread and fix it | Gemma 4 31B | The best prose and rhyme |
| Write comic panel captions and speech bubbles | Gemma 4 26B-A4B | Fast; a caption plus up to two bubbles per panel |
Many small calls, never one long reply. Instead of asking for a whole story at once, the app builds it piece by piece:
- Look: one call per photo returns the objects in it.
- Plan: one call writes the plot and decides which photo illustrates which moment.
- Write: one call per scene (~170 words), stanza (4 lines) or comic panel, each building on the parts before it.
- Edit: an "editor" call reviews the whole piece, and up to 3 weak parts are rewritten.
- Readability check: this runs without the AI. It measures sentence length and long words, and any scene that's too hard is always sent back for a simpler rewrite.
Small calls keep the model focused, make each reply cheap to retry, and let the page show progress the whole time.
The rest of the stack:
- FastAPI backend with MongoDB (Atlas when deployed) storing every pipeline step. If a step fails, Retry resumes from that exact step instead of starting over.
- Live progress over Server-Sent Events: the photo-check panel, a countdown and the sneak peek all update as the tale is written.
- Plain HTML, CSS and JavaScript frontend served by FastAPI, so it's one service to deploy on Render.
- Gentle pacing for free API keys: calls go back-to-back, and only when a call is rejected does the app back off (30 s, then 60 s, then 90 s) before trying again.
Why Does Open Innovation Matter?
1. The same open model runs in the cloud or on your own machine.
Because Gemma's weights are open, the app has two interchangeable back ends: Google AI Studio (free key, nothing to install) and LM Studio, which runs Gemma locally. Switching is one click in the app, with no code changes. With LM Studio, your photos never leave your computer: the model that looks at your walk runs on your own hardware. A closed, API-only model can't offer that choice.
2. Your walk stays yours.
Photos of a walk can reveal where you live. So:
- Location data is stripped: photos are re-encoded and their EXIF data (including GPS location) is removed on upload.
- Photos are short-lived: they're deleted from the server after 24 hours.
- Published tales stay with you: they're saved in your own browser's local storage, not on my server.
- Your API key stays with you: it lives in your browser's local storage for 5 hours and is never stored on the server.
3. I pick the right model for each job.
Open weights come in many sizes, so the app uses a fast mixture-of-experts Gemma for looking and planning, and the large dense Gemma for writing and editing. In LM Studio you can swap in any Gemma build you've downloaded, per task, from a dropdown.
4. It costs nothing to run.
Gemma is free to use through a free AI Studio key, and completely free (and limitless) when run locally. A family can make a tale every weekend without a subscription.
Where open worked better than closed: <!-- TODO: in one or two sentences, add a concrete moment from building this, e.g. swapping models in LM Studio, testing locally for free, or keeping photos on your machine -->
Prize Categories
Best Use of Gemma: every tale is written, planned and proofread by Gemma 4 (26B-A4B and 31B), and the photos are read by Gemma too. LM Studio runs Gemma locally.
Best Use of MongoDB Atlas: every tale's pipeline state lives in MongoDB Atlas, which is what lets a failed step resume exactly where it stopped. We don't save user generated tales.
Best Use of Render: the app is deployed as a single Render web service (
render.yamlin the repo).

Top comments (0)