Hugging Face Story Generator – How I Built a Fun App in One Weekend

Why staying hands-on with code matters, even as a CTO, and how I turned an image into a story using open source tools.

My days are often a whirlwind of strategy, leadership, and back-to-back meetings.
And while I enjoy shaping vision and guiding product direction, there’s still a part of me that finds joy in getting my hands dirty with code and in solving a real problem, line by line.

So this weekend, I decided to set aside a few hours for something different, a solo side project. No decks, no calls, no reviews. Just me, Python, Django, and a wild idea brewing:

💡 What if I could upload an image and instantly generate a fictional story around it using AI?

Why Staying Hands-On Still Matters (Especially as a CTO)

Over the years, I’ve realized something profoundly important:
👉 Staying hands-on keeps you honest.

It helps you truly understand your team’s challenges. You speak their language not just from a high-level perspective, but from the trenches. You never lose sight of the “how,” even while driving the “why.”

This wasn’t about impressing anyone or launching the next big thing.
It was about staying connected to the craft and rediscovering that pure builder’s excitement I felt when I first started coding.

What I Built: The Hugging Face Story Generator

At its core, the Hugging Face Story Generator app does this:

👉 You upload an image through a simple Django form.
👉 A BLIP model from Hugging Face generates a caption, a brief phrase of what it “sees.”
👉 That caption is passed to GPT-Neo, which writes a fictional short story.
👉 You get the image, caption, and the AI-generated story, optionally flavored with a mood like funny, dark, or wholesome.

Hugging Face Story Generator

The Tech Stack

Here’s what powered it all:

👉 Django – My go-to for backend dev. It helped me build forms, manage files, and render pages quickly.
👉 Hugging Face Transformers – For both image captioning (Salesforce/blip-image-captioning-base) and text generation (EleutherAI/gpt-neo-125M). Easy API, powerful results.
👉 Local Deployment – I ran the Hugging Face Story Generator locally to avoid heavy memory usage during dev. I did explore Render, but kept things lean.

Key Features

📸 Image Upload
Handled via Django’s ImageField and model forms. Simple and efficient.

🧠 AI-Powered Captioning
Using Salesforce/blip-image-captioning-base, I was able to generate captions like “a girl walking in a forest” with surprising accuracy.

✍️ AI Storytelling with GPT-Neo
This is where the fun begins. The generated caption becomes a seed, and GPT-Neo spins it into a short story.

🎭 Mood Selection
Users can add a creative touch by selecting a tone: dark, funny, wholesome, etc.

🌐 Minimal UI, Fully Functional
Built with pure Django templates. No React, no JavaScript frameworks. Just classic backend-driven web development.

Hugging Face Transformers

What the Code Looks Like (and Why It’s So Lean)

The whole Hugging Face Story Generator project came together in under 300 lines of Python.

🧩 generate_caption()
Loads the image, runs the BLIP model, and returns a short caption.
🧩 generate_story()
Sends that caption (plus mood) to GPT-Neo via Hugging Face’s Inference API and returns a story.
🧩 views.py
The Django view connects it all handles the form, invokes the AI, and renders the final result.

Optional Enhancements I Considered

This mini-project sparked more ideas:

✅ Run models locally with quantized versions to avoid API dependency
✅ Save user stories and history with authentication
✅ Add inline caption editing before story generation
✅ Offer audio narration using TTS
✅ Dockerize the app for easier sharing

Why I’m Sharing This

I don’t blog about code as much as I used to, but this project reminded me why I started.
Not every project has to be a startup or side hustle. Sometimes it’s enough to build something small and fun and finish it.

If you’re in a leadership role and haven’t opened VSCode in a while… I encourage you.
Take a weekend. Build something.

At the heart of it all, it’s the joy of creating that keeps us going.

👨‍💻 Try the Hugging Face Story Generator

GitHub repo: https://github.com/azeemuddinn/storybyimage
(Feel free to fork, remix, and improve it!)

✉️ Final Thought

This Hugging Face Story Generator reminded me, AI doesn’t need to be massive to feel magical. One image. A few lines of code. And suddenly, a story that never existed comes to life. That’s the power of staying hands-on.

👉 Explore more blogs here